Show query CodeLens only for active query#125
Conversation
Scope query action CodeLens entries to the active cursor or selection and keep running indicators visible when focus moves away. Disable bulky query separators by default and make opt-in separators subtle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refines the Kusto query editor UX by limiting query CodeLens actions to the currently active query block while keeping “Running” visibility for in-flight queries, and it makes query separators opt-in and visually subtler.
Changes:
- Filter query CodeLens actions to only show for the active (in-scope) query range, while still showing a “Running” indicator for running queries even when focus moves away.
- Add a small range-scope utility (
isQueryRangeInScope) plus unit tests covering cursor/selection/multi-selection/reversed selection and boundary behavior. - Make query separators disabled by default and reduce their visual prominence when enabled.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Client/features/queryEditor.ts | Refresh CodeLens on editor/selection changes; filter CodeLens output by active selection scope; keep running indicator visible; make separators subtler + default-off. |
| src/Client/features/queryRangeScope.ts | Add range/selection-scope helper to decide whether a query range is “active”. |
| src/Client/tests/unit/queryRangeScope.test.ts | Add unit coverage for selection normalization and intersection/boundary cases. |
| src/Client/package.json | Change msKustoExplorer.editor.showQuerySeparators default to false and update setting description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This means you will have to put the caret into the text of a specific query before the code lens will appear at the top of that query? Why do you believe this experience is better? |
|
Because I hate notebooks and love how our existing KE/KWE handle themselves. |
Summary
Validation
Notes