Skip to content

NES: enable trigger on active editor change by default#309489

Merged
ulugbekna merged 2 commits intomainfrom
ulugbekna/nes-trigger-on-editor-change-defaults
Apr 13, 2026
Merged

NES: enable trigger on active editor change by default#309489
ulugbekna merged 2 commits intomainfrom
ulugbekna/nes-trigger-on-editor-change-defaults

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

Summary

Enable NES triggering on active editor change by default and improve same-line cooldown behavior.

Changes

Default config changes:

  • triggerOnEditorChangeAfterSeconds: undefined10 — NES now triggers when switching editors by default
  • triggerOnEditorChangeStrategy: AlwaysAfterAcceptance — document switch only triggers NES if the last suggestion was accepted

Same-line cooldown behavior change:

  • Before: When triggerOnEditorChangeAfterSeconds was set, the same-line cooldown was completely disabled — every cursor move on the same line re-triggered NES
  • After: Same-line cooldown is always enforced within a file session but resets when switching away and returning. Example:
    1. User triggers NES in file A on line 10 → cooldown active
    2. Cursor moves on same line → blocked by cooldown
    3. User switches to file B → file A's line cooldowns are cleared
    4. User returns to file A, line 10 → triggers again

Test updates

  • Added lastOutcome = NesOutcome.Accepted to document-switch tests (needed with AfterAcceptance default)
  • Rewrote cooldown bypass test to verify the new switch-away-and-back behavior

- Set triggerOnEditorChangeAfterSeconds default to 10 (was undefined)
- Set triggerOnEditorChangeStrategy default to AfterAcceptance (was Always)
- Replace unconditional same-line cooldown bypass with smart reset:
  cooldown is enforced within a file session but clears when switching
  away and returning, so NES re-triggers on the same line after a
  round-trip to another file
- Update tests to match new defaults and behavior
Copilot AI review requested due to automatic review settings April 13, 2026 15:10
@ulugbekna ulugbekna added the ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch label Apr 13, 2026
@ulugbekna ulugbekna self-assigned this Apr 13, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

This PR will be automatically cherry-picked to release/1.116 when merged.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Screenshot Changes

Base: d9b443da Current: bb7c847b

Changed (5)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/PromptsTabScrolled/Dark
Before After
before after
editor/inlineCompletions/other/JumpToHint/Light
Before After
before after
agentSessionsViewer/ApprovalRowLongLabel/Dark
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables Next Edit Suggestions (NES) triggering on active editor (document) switches by default, and adjusts same-line cooldown handling so it remains enforced within a file session while resetting after switching away and returning.

Changes:

  • Change default triggerOnEditorChangeAfterSeconds from undefined to 10 to enable editor-switch triggering by default.
  • Change default document-switch trigger strategy from Always to AfterAcceptance.
  • Enforce same-line cooldown even when document-switch triggering is enabled, and reset cooldown when switching documents.
Show a summary per file
File Description
extensions/copilot/src/platform/configuration/common/configurationService.ts Updates default config values for editor-switch triggering and strategy.
extensions/copilot/src/extension/inlineEdits/vscode-node/inlineEditTriggerer.ts Clears same-line trigger state on document switches and removes the prior cooldown bypass tied to editor-switch triggering.
extensions/copilot/src/extension/inlineEdits/test/vscode-node/inlineEditTriggerer.spec.ts Updates document-switch tests for AfterAcceptance default and rewrites cooldown test for switch-away/back behavior.
extensions/copilot/package.json Sets the contributed configuration default for triggerOnEditorChangeAfterSeconds to 10.

Copilot's findings

  • Files reviewed: 4/4 changed files
  • Comments generated: 1

@ulugbekna ulugbekna merged commit 8b622da into main Apr 13, 2026
26 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/nes-trigger-on-editor-change-defaults branch April 13, 2026 15:54
@vs-code-engineering vs-code-engineering bot added this to the 1.115.0 milestone Apr 13, 2026
@vs-code-engineering vs-code-engineering bot added release-cherry-pick Automated cherry-pick between release and main branches and removed ~release-cherry-pick Trigger: cherry-pick this PR to the latest release branch labels Apr 13, 2026
ulugbekna added a commit that referenced this pull request Apr 13, 2026
* NES: enable trigger on active editor change by default

- Set triggerOnEditorChangeAfterSeconds default to 10 (was undefined)
- Set triggerOnEditorChangeStrategy default to AfterAcceptance (was Always)
- Replace unconditional same-line cooldown bypass with smart reset:
  cooldown is enforced within a file session but clears when switching
  away and returning, so NES re-triggers on the same line after a
  round-trip to another file
- Update tests to match new defaults and behavior

* fix indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-cherry-pick Automated cherry-pick between release and main branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants