TS: Add setting to prompt users about workspace tsdk by DuncanWalter · Pull Request #95566 · microsoft/vscode
Thank you for taking a look at this!
I'm having trouble following some of the logic and how all the events interact with each other. Here's a quick breakdown of the expected behavior for a few different cases:
User opens a workspace without a tsdk setting
No change.
User opens a workspace with a tsdk setting and enablePromptUseWorkspaceTsdk != true
No change.
User opens a workspace for the first time that has tsdk set and enablePromptUseWorkspaceTsdk = true
- We start the normal server.
- At this point, we also show a prompt to the user asking if they would like to switch to the workspace version.
- If the user says no, we remember that and don't prompt them again.
- If the user says yes, we perform the equivalent of manually selecting the workspace version using the
Select TypeScript versioncommand. This automatically restarts the TS Server with the workspace version
User opens a workspace and is using global TS version. Then tsdk or enablePromptUseWorkspaceTsdk is written into the workspace setting
Show the same prompt as above. (Make sure that using the Select TypeScript Version command does not trigger a prompt)
User opens a workspace that they previously configured to use the workspace version
The user should never be prompted to switch.
This seems to mostly match what the PR is doing but make sure to try out the edge case too.
For the code changes, I'd try to avoid touching the TypeScriptVersionProvider and keep the logic centralized to the version manager