feat(language-service): migrate to named pipe server using TypeScript LanguageService#3908
feat(language-service): migrate to named pipe server using TypeScript LanguageService#3908johnsoncodehk merged 11 commits intomasterfrom
Conversation
| import * as vue from '@vue/language-core'; | ||
| import { Provide } from 'volar-service-typescript'; | ||
| import type * as vscode from 'vscode-languageserver-protocol'; | ||
| import { getQuickInfoAtPosition } from 'typescript-vue-plugin/out/namedPipe/client'; |
There was a problem hiding this comment.
Should it not rely on internal package build paths?
There was a problem hiding this comment.
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.
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.
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.
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:
.valueDetect Missing(No longer needed)lang="ts"/"allowJs": true/jsconfig.jsonThe "Show Component Meta" command is not supported in the absence of TypeScript LanguageService and has been removed.