-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
feat(language-service): migrate to named pipe server using TypeScript LanguageService #3908
Conversation
import type * as vscode from 'vscode-languageserver-protocol'; | ||
import { getQuickInfoAtPosition } from 'typescript-vue-plugin/out/namedPipe/client'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it not rely on internal package build paths?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand. Just need to make sure that both node and esbuild can interpret the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just saying that /out/namedPipe/client
path is an internal detail of the typescript-vue-plugin
package and should not be hardcoded like that. But since you control both, I guess you can get away with it :)
export function startNamedPipeServer() { | ||
if (started) return; | ||
started = true; | ||
const server = net.createServer(connection => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not possible to communicate using node-ipc for example? At least that's what typescript-language-server is using to communicate with tsserver but not sure if that's relevant for this case...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my memory IPC communication requires obtaining a ChildProcess instance? Neither the LSP server nor the language client can obtain a process instance of tsserver so this may not be possible.
After migrating to the TS Plugin, the LSP Server no longer provides the semantic functionality of the TypeScript LanguageService instance. It needs to communicate with tsserver to invoke its LanguageService instance.
The communication between LSP Server and tsserver is based on named pipes instead of websockets. This is to avoid occupying local ports and dependencies on the ws package.
The following features have been migrated to the named pipe server that uses the TypeScript LanguageService:
.value
Detect Missing(No longer needed)lang="ts"
/"allowJs": true
/jsconfig.json
The "Show Component Meta" command is not supported in the absence of TypeScript LanguageService and has been removed.