Skip to content

Show active editor language first in Configure Snippets - #324369

Merged
Martin Aeschlimann (aeschli) merged 5 commits into
microsoft:mainfrom
dobbydobap:snippets-active-language-first
Sep 15, 2026
Merged

Martin Aeschlimann (aeschli) merged 5 commits into
microsoft:mainfrom
dobbydobap:snippets-active-language-first

Conversation

@dobbydobap

Copy link
Copy Markdown
Contributor

Fixes #324336.

Reorders the "Configure Snippets" quick pick so the active editor's language is listed first, in both the existing-snippet-files group and the new-language group. So with a Python file open, python.json (or the "new Python snippets" entry) shows at the top instead of alphabetically.

Falls back to the current order when there's no active editor or the language is already first.
Tested in the dev build: opened a Python file, ran Configure Snippets, python was at the top; switched to a JS file and JavaScript moved to the top.
Kept this to the reordering only. Happy to add an indicator for the detected language as a follow-up if that's wanted.

Copilot AI review requested due to automatic review settings July 5, 2026 12:33
@dobbydobap

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the "Configure Snippets" quick pick (workbench.action.openSnippets) so the active editor's language surfaces first, addressing issue #324336. It passes editorService.activeTextEditorLanguageId into computePicks, and after the usual sort it promotes the matching entry to the top of both the existing-snippet-files group and the new-language group. When there is no active editor, or the language is already first/absent, the previous ordering is preserved.

Changes:

  • Injected IEditorService into ConfigureSnippetsAction.run and forwarded the active language id to computePicks.
  • Added post-sort reordering in computePicks to move the active language's existing .json file and its "new language" entry to the front.
  • Kept a graceful fallback to the prior order when there is no active editor language or it's already first.

@dobbydobap

Copy link
Copy Markdown
Contributor Author

closing this — #324336 was closed as not planned on sep 6 after the feature request didn't reach the 20 upvote threshold, so there's no issue left for this to fix. happy to revisit if it ever makes the backlog.

@aeschli

Copy link
Copy Markdown
Contributor

The request makes sense, ok to continue with it

@saitanallensantiago26-beep

Fixes #324336.

Reorders the "Configure Snippets" quick pick so the active editor's language is listed first, in both the existing-snippet-files group and the new-language group. So with a Python file open, python.json (or the "new Python snippets" entry) shows at the top instead of alphabetically.

Falls back to the current order when there's no active editor or the language is already first.
Tested in the dev build: opened a Python file, ran Configure Snippets, python was at the top; switched to a JS file and JavaScript moved to the top.
Kept this to the reordering only. Happy to add an indicator for the detected language as a follow-up if that's wanted.

1 similar comment
@saitanallensantiago26-beep

Fixes #324336.

Reorders the "Configure Snippets" quick pick so the active editor's language is listed first, in both the existing-snippet-files group and the new-language group. So with a Python file open, python.json (or the "new Python snippets" entry) shows at the top instead of alphabetically.

Falls back to the current order when there's no active editor or the language is already first.
Tested in the dev build: opened a Python file, ran Configure Snippets, python was at the top; switched to a JS file and JavaScript moved to the top.
Kept this to the reordering only. Happy to add an indicator for the detected language as a follow-up if that's wanted.

@aeschli
Martin Aeschlimann (aeschli) merged commit b964d54 into microsoft:main Sep 15, 2026
33 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.139.0 milestone Sep 15, 2026
@dobbydobap
varshitha (dobbydobap) deleted the snippets-active-language-first branch September 17, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Configure Snippets" should list relevant files first

7 participants