sourcegraph/javascript-typescript-langserver

Name: javascript-typescript-langserver

Owner: Sourcegraph

Description: JavaScript and TypeScript code intelligence through the Language Server Protocol

Created: 2016-09-21 10:20:04.0

Updated: 2018-05-24 14:03:27.0

Pushed: 2018-05-24 17:32:28.0

Homepage: https://sourcegraph.com

Size: 1671

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

JavaScript/TypeScript language server

npm downloads build appveyor build codecov dependencies OpenTracing: enabled semantic-release code style: prettier license chat: on gitter

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.

Try it out
Features
Run it from source
stall dependencies
install

mpile
run build
 compile on file changes
run watch

n over STDIO
 lib/language-server-stdio
 run over TCP
 lib/language-server

n tests
test
Options
age: language-server [options]

tions:

-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
Extensions

This language server implements some LSP extensions, prefixed with an x.

Versioning

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.

For local development, there is built-in support for the open source OpenTracing implementation Jaeger, which can be set up to run on localhost with just one command (you need Docker installed):

er run -d -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp \
5778: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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.