Skip to content

Commit

Permalink
fix: tsserver failed to start
Browse files Browse the repository at this point in the history
typescript.tsserver.web.projectWideIntellisense.enabled can now be disabled
  • Loading branch information
kaisalmen committed Sep 27, 2023
1 parent a2b7849 commit 8a99d13
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"xterm-addon-webgl": "0.16.0"
},
"volta": {
"node": "18.14.2",
"npm": "9.5.1"
"node": "18.18.0",
"npm": "9.8.1"
}
}
17 changes: 3 additions & 14 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ export default defineConfig({
next()
})
}
},
{
// prevent vite from trying to inject code into an extension file du to an `import()` in that file
name: 'hack-prevent-transform-javascript',
apply: 'serve',
load (source) {
if (source.includes('tsserver.web.js')) {
return `eval(${JSON.stringify(fs.readFileSync(source).toString('utf-8'))})`
}
}
}
],
optimizeDeps: {
Expand All @@ -50,10 +40,9 @@ export default defineConfig({
'vscode/default-extensions/objective-c', 'vscode/default-extensions/perl', 'vscode/default-extensions/php', 'vscode/default-extensions/powershell',
'vscode/default-extensions/python', 'vscode/default-extensions/r', 'vscode/default-extensions/ruby', 'vscode/default-extensions/rust',
'vscode/default-extensions/scss', 'vscode/default-extensions/shellscript', 'vscode/default-extensions/sql', 'vscode/default-extensions/swift',
'vscode/default-extensions/typescript-basics', 'vscode/default-extensions/vb', 'vscode/default-extensions/xml', 'vscode/default-extensions/yaml',
'vscode/default-extensions/theme-defaults', 'vscode/default-extensions/theme-seti',
'vscode/default-extensions/references-view', 'vscode/default-extensions/typescript-basics', 'vscode/default-extensions/search-result',
'vscode/default-extensions/typescript-language-features', 'vscode/default-extensions/markdown-language-features',
'vscode/default-extensions/typescript-basics', 'vscode/default-extensions/typescript-language-features', 'vscode/default-extensions/vb',
'vscode/default-extensions/xml', 'vscode/default-extensions/yaml', 'vscode/default-extensions/theme-defaults', 'vscode/default-extensions/theme-seti',
'vscode/default-extensions/references-view', 'vscode/default-extensions/search-result', 'vscode/default-extensions/markdown-language-features',
'vscode/default-extensions/json-language-features', 'vscode/default-extensions/css-language-features',
'vscode/default-extensions/npm', 'vscode/default-extensions/css', 'vscode/default-extensions/markdown-basics', 'vscode/default-extensions/html',
'vscode/default-extensions/html-language-features', 'vscode/default-extensions/configuration-editing', 'vscode/default-extensions/media-preview', 'vscode/default-extensions/markdown-math',
Expand Down
2 changes: 1 addition & 1 deletion docs/vscode_monaco_upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
- Update dependencies
- Implement improvements dependening on the new features available from vscode (optional)

## Hints:
## Hints

Use repo log viewers and check the last update branch when in doubt
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"recast": "^0.23.4"
},
"volta": {
"node": "18.17.1",
"npm": "9.6.7"
"node": "18.18.0",
"npm": "9.8.1"
}
}
13 changes: 13 additions & 0 deletions scripts/vscode.patch
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ index 775a1be5996..ce8435bd920 100644
relativePath = relativePath.replace(/\\/g, '/');
if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) {
relativePath = './' + relativePath;
diff --git a/extensions/typescript-language-features/web/typingsInstaller.ts b/extensions/typescript-language-features/web/typingsInstaller.ts
index 7b9b164c40c..a961bb7267a 100644
--- a/extensions/typescript-language-features/web/typingsInstaller.ts
+++ b/extensions/typescript-language-features/web/typingsInstaller.ts
@@ -66,6 +66,8 @@ export default class WebTypingsInstallerClient implements ts.server.ITypingsInst
case 'action::packageInstalled':
case 'action::invalidate':
case 'action::set':
+ // missing case leads to error
+ case 'action::watchTypingLocations':
this.projectService!.updateTypingsForProject(response);
break;
case 'event::beginInstallTypes':
diff --git a/extensions/typescript-language-features/web/webServer.ts b/extensions/typescript-language-features/web/webServer.ts
index 191c2d03f63..f1526cf68ac 100644
--- a/extensions/typescript-language-features/web/webServer.ts
Expand Down

0 comments on commit 8a99d13

Please sign in to comment.