toResource incorrectly calls URI.parse on zipfile:// resources
michael-withington-simplisafe opened this issue · comments
toTsFilePath
and toResource
both have the same comment:
// Yarn v2+ hooks tsserver and sends `zipfile:` URIs for Vim. Keep as-is.
// Example: zipfile:///foo/bar/baz.zip::path/to/module
however, toTsFilePath correctly returns the URL without doing anything, and toResource calls URI.parse
on it, causing it to break and not be able to load the resource.
typescript-language-server/src/ts-client.ts
Line 249 in 223a497
@rchl want me to open a PR with the bug-fix?
I think that a proper fix would require quite some work given how now things are expected to be URI. If you have some simple fix then it would probably not work in all cases.
I've looked into it a bit but so far haven't come up with satisfying solution.