Skip to content

[pull] main from microsoft:main#985

Merged
pull[bot] merged 12 commits intocode:mainfrom
microsoft:main
Mar 1, 2026
Merged

[pull] main from microsoft:main#985
pull[bot] merged 12 commits intocode:mainfrom
microsoft:main

Conversation

@pull
Copy link

@pull pull bot commented Mar 1, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Jai and others added 12 commits February 18, 2026 13:03
Add a new 'foldedLine' movement unit to the `cursorMove` command that moves
by model lines while treating each folded region as a single step.

When moving down/up by 'wrappedLine' the cursor skips folds naturally because
it operates in view space. When moving by 'line' it uses model coordinates and
can land inside a fold, causing VS Code to auto-unfold it. The new 'foldedLine'
unit moves in model space but queries `viewModel.getHiddenAreas()` to detect
folds and jump to the first visible line past each one, so folds are skipped
without being opened.

This is the semantics needed by vim's j/k motions (VSCodeVim/Vim#1004):
each fold counts as exactly one step, matching how real vim treats folds.

Fixes: VSCodeVim/Vim#1004
Replace the step-by-step simulation (O(count × folds)) with a single
pass over sorted hidden areas (O(folds in path)). Compute a naive
target, then extend it for each fold encountered, stopping before any
fold that reaches the document boundary.

Also extracts _targetFoldedDown/_targetFoldedUp helpers to eliminate
the duplicated loop structure between the two directions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot-authored message: Fix inline reference at block start rendering on its own line

When an inlineReference is the first item in a chat response (no preceding
markdown), it creates a standalone markdownContent with default MarkdownString
properties. The subsequent markdown from the model has different properties
(e.g. isTrusted: true), causing canMergeMarkdownStrings to return false. This
leaves them as separate content parts, rendering the inline reference link on
its own line.

Fix by detecting when the previous item consists solely of synthesized
content-ref links (via isContentRefOnly check) and merging them by prepending
the reference text while adopting the incoming markdown's properties.

Fixes #278191
* editor: add 'foldedLine' unit to cursorMove command

Add a new 'foldedLine' movement unit to the `cursorMove` command that moves
by model lines while treating each folded region as a single step.

When moving down/up by 'wrappedLine' the cursor skips folds naturally because
it operates in view space. When moving by 'line' it uses model coordinates and
can land inside a fold, causing VS Code to auto-unfold it. The new 'foldedLine'
unit moves in model space but queries `viewModel.getHiddenAreas()` to detect
folds and jump to the first visible line past each one, so folds are skipped
without being opened.

This is the semantics needed by vim's j/k motions (VSCodeVim/Vim#1004):
each fold counts as exactly one step, matching how real vim treats folds.

Fixes: VSCodeVim/Vim#1004

* editor: simplify foldedLine movement using fold-walk algorithm

Replace the step-by-step simulation (O(count × folds)) with a single
pass over sorted hidden areas (O(folds in path)). Compute a naive
target, then extend it for each fold encountered, stopping before any
fold that reaches the document boundary.

Also extracts _targetFoldedDown/_targetFoldedUp helpers to eliminate
the duplicated loop structure between the two directions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* editor: fix foldedLine count movement at fold boundaries

---------

Co-authored-by: Jai <jai@jai.one>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Alexandru Dima <alexdima@microsoft.com>
Better handle event subscriptions (#293200)
* fix #288515: wrong current index in find widget if matches > 1000

When there are more than 1000 matches, decorations use
_FIND_MATCH_NO_OVERVIEW_DECORATION instead of _FIND_MATCH_DECORATION.
getCurrentMatchesPosition did not check for this decoration type,
causing it to return 0 and fall through to a fallback with an
off-by-one error.

* Address review feedback

* Fix unused error
* Fix potential listener leak in document semantic tokens

Hoist provider onDidChange and registry onDidChange subscriptions from
each ModelSemanticColoring instance into the singleton
DocumentSemanticTokensFeature.

Previously, every ModelSemanticColoring subscribed individually to both
the global LanguageFeatureRegistry.onDidChange and each provider's
onDidChange event, resulting in O(N*M) listeners (N models × M
providers). In scenarios like chat editing where many models are created
rapidly, these listeners accumulated and triggered leak detection.

Now the singleton subscribes once to the registry change and once per
provider (via allNoModel()), then fans out notifications to watchers.
Each watcher checks provider relevance via _provider.all(model).includes()
before acting on the event.

Also replaces manual IDisposable[] management with a DisposableStore for
proper lifecycle tracking.

* Review feedback
* fix non-edit codeblocks in thinking

* Address some comments
@pull pull bot locked and limited conversation to collaborators Mar 1, 2026
@pull pull bot added the ⤵️ pull label Mar 1, 2026
@pull pull bot merged commit 4ede078 into code:main Mar 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants