Open boan-anbo opened 13 hours ago
I don't think we can load multiple language server(on top of the performance implication). VSCode typescript also requires you to pass a single path to the typescript version used.
What mono repo setup do you have so the server needs to be different?
What's adding to the issue is that the extension currently doesn't reload on path change. Restart TSP Server doesn't work either. You have to uninstall and reinstall the extension for the new path to take effect.
That would seem like quite an issue, do you mean if you change the server-path config it won't reload even if you do Restart TSP server
or Reload window
? Could you share the logs when that is happening
(filed a separate one #4765 on auto reloading)
Issue
It is common to open multiple workspaces in VSCode for the same TypeSpec project, especially in monorepos.
Currently,
tsp-server.path
only accepts a single string.https://github.com/microsoft/typespec/blob/5f21e0c53b767f5bbf5dfbe8795c530b1534fc81/packages/typespec-vscode/package.json#L61-L66
So if you change workspace locations, you will have to change the tsp-server path.
For example:
This shouldn't be a problem if VSCode does well with monorepo detection, but it doesn't. So it's important to allow multiple paths, in the order of priority.
What's adding to the issue is that the extension currently doesn't reload on path change.
Restart TSP Server
doesn't work either. You have to uninstall and reinstall the extension for the new path to take effect.Proposal
tsp-server.path
config, in the order of search priority.I could open a PR if desired.