Closed 4513ECHO closed 3 months ago
For now, typescript.tsdk
specifies the tsserver used as the workspace version. To ignore the bundled version, set vtsls.autoUseWorkspaceTsdk
to true
.
I can consider fixing this for deno, but I must clear that the server only targets on Node platform, which is because the upstream extension code from VSCode runs in Node provided by Electron
and VSCode devs won't care the compatibility with other JS runtimes.
I tried using vtsls.autoUseWorkspaceTsdk
, but the issue have not been resolved.
Vtsls imports bundled tsserver before checking autoUseWorkspaceTsdk option, which will leads vtsls to exit with error code.
I can consider fixing this for deno, but I must clear that the server only targets on Node platform
Yes, that is perfectly correct. I am a user trying to do something that is not supported......
If configuration.globalTsdk
is set, bundled version is not looked up.
To do it inspected value must have globalValue
property,
But shim does not implement it.
One idea that introduce typescript.globalTsdk
new option:
--- a/src/configuration/configuration.electron.ts
+++ b/src/configuration/configuration.electron.ts
protected readGlobalTsdk(configuration: vscode.WorkspaceConfiguration): string | null {
- const inspect = configuration.inspect('typescript.tsdk');
- if (inspect && typeof inspect.globalValue === 'string') {
- return this.fixPathPrefixes(inspect.globalValue);
+ const value = configuration.get<string>('typescript.globalTsdk');
+ if (value) {
+ return this.fixPathPrefixes(value);
}
return null;
}
PR welcome. One suggestion: prefix typescript.globalTsdk
with vtsls.
to mark it as vtsls specific so that we can differentiate it is not from the upstream VSCode extension.
I'm trying running vtsls with Deno by configuring cmd option to:
But it does not succsed with following error:
I believe the cause of this error is the difference between the general
node_modules
structure and the structure of the directory where Deno caches the npm package. The actual tsserver.js is located<path to DENO_DIR>/npm/registry.npmjs.org/typescript/5.4.2/lib/tsserver.js
, which is slightly different from where vtsls is trying to find it by applying patch. Also settingtypescript.tdsk
options does not prevent vtsls from looking up bundled tsserver.Could you consider improving a logic of
002-redirect-tsserver-path.patch
or adding option to ignore bundled tsserver?