The goal of this fork is:
- Simplify file system model (only use local file system)
- Largely Reduce memory footprint
- Replace Observable with promise
- Add APIs that specific for Elastic Code
- Make it a full featured langserver that do best for all LSP calls, specifically, it will optimize for readonly use cases
Q: Why not https://github.com/theia-ide/typescript-language-server? A: the fact it calls tsserver bring a lot of overhead, making the indexing speed very slow. However, we are going to brow code from them
Try it out
- On sourcegraph.com
- In Visual Studio Code (as an alternative to the built-in TypeScript integration)
- In Eclipse Che
- In NeoVim
- In Sublime Text
- Goto definition
- Goto type definition
- Find all references
- Document symbols
- Workspace symbol search
- Signature help
- Quick fixes
Run it from source
# install dependenciesnpm install# compilenpm run build# or compile on file changesnpm run watch# run over STDIOnode lib/language-server-stdio# or run over TCPnode lib/language-server# run testsnpm test
Usage: language-server [options] Options: -h, --help output usage information -V, --version output the version number -s, --strict enabled strict mode -p, --port [port] specifies LSP port to use (2089) -c, --cluster [num] number of concurrent cluster workers (defaults to number of CPUs, 8) -t, --trace print all requests and responses -l, --logfile [file] log to this file -j, --enable-jaeger enable OpenTracing through Jaeger
This language server implements some LSP extensions, prefixed with an
- Files extension Allows the server to request file contents without accessing the file system
- SymbolDescriptor extension Get a SymbolDescriptor for a symbol, search the workspace for symbols or references to it
- Streaming Supports streaming partial results for all endpoints through JSON Patches
- Packages extension Methods to get information about dependencies
- TCP / multiple client support
When running over TCP, the
exitnotification will not kill the process, but close the TCP socket
This project follows semver for command line arguments and standard LSP methods. Any change to command line arguments, Node version or protocol breaking changes will result in a major version increase.
Debugging Performance with OpenTracing
The language server is fully traced through OpenTracing, which allows to debug what exact operations caused method calls to take long.
You can pass a span context through an optional
meta field on the JSON RPC message object.
docker run -d -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp \ -p5778:5778 -p16686:16686 -p14268:14268 jaegertracing/all-in-one:latest
After that, run the language server with the
--enable-jaeger command line flag and do some requests from your client.
Open http://localhost:16686 in your browser and you will see method calls broken down into spans.