Some mechanism for a file to inherit the workspace it belongs to
See original GitHub issueI’m not clear if this is a VSCode issue or a vscode-languageserver-node issue, apologies if this is the wrong repo.
My use case is: I have a file open from a workspace, I ‘jump to def’ into a library, that source file is outside of the workspace folder, but the language server for the original workspace has the information for the library. Currently, VSCode doesn’t forward any notifications/requests for the library file to any language server.
This happens with the Rust language server. In Rust there is no equivalent to the node_modules
directory, library code is in a central registry. E.g., if my project (and workspace directory) is /Users/nick/projects/foo', my code is in
/Users/nick/projects/foo/srcand libraries are in something like
/Users/nick/.cargo/registry/src/some_library`.
What I would like is that when a file is opened by vscode (c.v, the user opening a file from the folder view) and there is some file that we’re coming from and the newly opened file is not otherwise part of a workspace, then the newly opened file is considered to be in the workspace of the ‘from’ file.
Note that adding the registry folder to a workspace is not good enough (and I don’t think possible today anyway) because multiple workspaces could be using the registry.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top GitHub Comments
Actually there is a way how you can do this for something like goto def. The VS Code language client as a middleware which allows you to intercept all message. There could record these cases and when the file opens forward it to the right server. The middleware is documented here: https://github.com/Microsoft/vscode-languageserver-node/blob/master/client/src/client.ts#L411
Seems fine, I’ll give the suggestion in your earlier a comment (thanks for that!) a spin when I have some time.