Azure / Azure/monaco-kusto

Format Document removes blank-line separators between KQL query blocks

Open
#538 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
84
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Running **Format Document** removes all blank-line separation between adjacent KQL query blocks.

This can merge independently runnable queries into one contiguous block. In applications such as Azure Monitor Logs, blank lines are used to distinguish query blocks, so removing the separator can change editor behavior or leave invalid KQL.

### Versions

- `@kusto/monaco-kusto`: `15.0.1`
- `monaco-editor`: `0.55.1`
- `@kusto/language-service-next`: `12.4.1` (transitive dependency)

For comparison, this did not occur in our previous integration using:

- `@kusto/monaco-kusto`: `5.3.7`
- `monaco-editor`: `0.34.1`
- `@kusto/language-service-next`: `0.0.59`

### Steps to reproduce

1. Create a Monaco editor model with language `kusto`.
2. Enter two query blocks separated by multiple blank lines:

```kusto
Usage
| where Computer == "b"

AACAudit
| where _BilledSize == 4

3. Right-click in the editor.
4. Select Format Document.

Actual result
The blank-line separator is removed:

Usage
| where Computer == "b"
AACAudit
| where _BilledSize == 4

Expected result
The formatter should retain one blank line between query blocks, optionally normalizing multiple blank lines to one:

Usage
| where Computer == "b"

AACAudit
| where _BilledSize == 4

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a Monaco editor model using language kusto and the Format Document action, using the two query blocks and blank lines from the report. Trace the formatter or language-service entry point invoked by that action. Done means formatting retains one blank line between adjacent query blocks, while optionally normalizing multiple blank lines to one.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.