Skip to content

Fix missing "Restart TS Server" command in Command Palette #223433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dangerman
Copy link
Contributor

Fixes #210649

image

Problem

Some of the TypeScript extension command rely on certain context keys being updated.

Due to changes made in #201847 this logic was updated in activeJsTsEditorTracker to find active editors using tabs, so we can set the right context keys even if you've got the typescript files open in the diff view, and other scenarios.

However, because the logic was being run on text editor events, it seems that the state of the vscode.window.tabGroups.activeTabGroup was not always correct, resulting in the wrong editor being chosen.
As such, you might have a typescript editor open, but the commands wouldn't show up.

Fix

This PR adds a subscription to the tabGroups.onDidChangeTabGroups event, so that when the ActiveJsTsEditorTracker.update() method is run, the activeTabGroup state has already been updated correctly.

@dangerman
Copy link
Contributor Author

@microsoft-github-policy-service agree

@Irfansyah1234
Copy link

cloneapp2024

Copy link
Collaborator

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

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

Thanks!

@mjbvz mjbvz marked this pull request as ready for review July 29, 2024 20:57
@mjbvz mjbvz added this to the August 2024 milestone Jul 30, 2024
@mjbvz mjbvz merged commit 7d0a6b8 into microsoft:main Jul 30, 2024
6 checks passed
@mjbvz
Copy link
Collaborator

mjbvz commented Jul 30, 2024

Thanks. Will be in the first 1.93 insiders build we release later this week

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"TypeScript: Restart TS Server" no longer displayed in command palette
4 participants