-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Support TS server returning custom schemes #98830
Comments
Moving upstream as this will require coordination between TS Server and VS Code Historically, TS server crashes if you send it a document with a weird scheme that it can't handle so we need to make sure the plugin that handles |
VS Code can't send over |
But why would VSCode send a |
Won’t that file reference other files that are also under the zip path? |
In our use-case, the zip paths always originate from the TS server, not VSCode.
In the above timeline, VSCode is sending zip paths to TSServer, but only after those zip paths originated from TSServer, so it all works. I'm still not sure what format these paths should be in. Today, yarn does zip paths kinda like this: EDIT: sorry, I might be polluting the thread; sounds like @arcanis's explanation covers it. |
Yep, but if I understand correctly I think sending schemed references to VSCode is a better fit for the thread over at #59650 - this one is purely to receive them (both are needed for a perfect integration, but they are independent enough that they can be implemented separately). Basically, for #59650 to be fixed TS will have to support custom schemes, but for the issue described in this thread to be fixed, changes are only needed on the VSCode side. |
Thanks for the details. A few potential options:
|
Why would language features have to be disabled or enabled on the VSCode side? I'm probably missing a piece, but for example in the case I mentioned the Zip extension provides the ambient scheme through the FileSystemProvider API, so it doesn't need to be enabled at runtime. |
Ping? Is this issue still "Needs more info"? |
VS Code will have to maintain this fix and I'm concerned about it—as small a code change as it may be—causing problems down the road. You need to prove not just that the change fixes for the feature request, but that it won't cause additional problems. Basically, apply the fix and then try breaking things. Go through a thorough test pass of all different states the editor could be in: having the extension enabled/disabled, files opened in different states, using different TS server versions, and so on. Test if as if you were the person who will have to maintain the code going forward and deal with every bug report related to JS/TS that comes in Report the scenarios you tested, what works and what doesn't, and then we can go from there |
Please find below details for a matrix of scenarios that should hopefully add to the confidence levels of this proposed change. To run the procedures:
Matrix: Note all these scenarios are with the proposed change. ping @mjbvz |
Thanks. Can you also test the case where I have a file opened that relies on your plugin, but I then reload VS Code so that the file is loaded again but with the plugin in a disabled or crashed ? I want to make sure we handle the case when TS server is sent a schema that it doesn't understand |
@mjbvz Extra test case added for disabled extension and reload |
Should be fixed by #94986 I believe. I only verified the change did not break the normal VS Code JS/TS support. @elmpp or @cspotcode Can you please verify that the fix also addresses the original problem you were running into? |
Ah, bot doesn't know what commit closed this so it doesn't know when it should be released. |
We have a TS server that can return zip paths (
zip:///path/to/module.zip/package.json
). We also have a VSCode extension that can handle such paths using azip:
protocol handler.Using "Go to definition" unfortunately doesn't work because VSCode hardcodes the list of valid protocols, so the
zip:
protocol is lost as soon as the service client reworks the path.Looking at the blame history, it looks like the hardcode occurred organically, with the first one being a one-of check, later followed by another one-of workaround. I believe at this time VSCode didn't support custom schemes (at least not visible for extensions), so this made sense. Now, I think it should simply forward all schemes it recognizes. Would you accept a PR to this effect?
Related: #59650
Cc: @mjbvz @cspotcode
The text was updated successfully, but these errors were encountered: