This is a language server for JavaScript and TypeScript that adheres to the Language Server Protocol (LSP). It uses TypeScript's LanguageService to perform source code analysis.
npm installnpm run buildnode lib/language-server.js
To try it in Visual Studio Code, install the vscode-client extension and then open up a .ts file.
Run npm run watch.
Run npm test.
-p, --portspecifies port to use, default one is2089-s, --strictenables strict mode where server expects all files to be receives indidOpennotification requests-c, --clusterspecifies number of concurrent cluster workers (defaults to number of CPUs)-t, --traceenables printing of all incoming and outgoing messages-l, --logfilespecifies log file to print all messages to
In strict mode we expect rootPath to be equal file:/// while in non-strict mode VSCode usually sends absolute file URL. In both modes does not track existence of calling process.
Implementation closes underlying communication channel
Does nothing opposite to LSP specification that expects server to exit
Introduces limit parameter to limit number of symbols to return
In strict mode LSP server does not touch underlying file system, instead it uses the LSP files extension to retrieve workspace files and file contents.
- You need to disable VSCode's built-in TypeScript support to avoid weird conflicts on TypeScript files (double hover tooltips, etc.). There's a hacky way to do this: add the setting
{"typescript.tsdk": "/dev/null"}to your VSCode user or workspace settings.