Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 3a9c34e

Browse files
committed
docs: update README
1 parent eeabb3c commit 3a9c34e

File tree

1 file changed

+63
-31
lines changed

1 file changed

+63
-31
lines changed

README.md

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,84 @@
77
)](https://ci.appveyor.com/project/sourcegraph/javascript-typescript-langserver/branch/master)
88
[![codecov](https://codecov.io/gh/sourcegraph/javascript-typescript-langserver/branch/master/graph/badge.svg)](https://codecov.io/gh/sourcegraph/javascript-typescript-langserver)
99
[![Dependencies](https://david-dm.org/sourcegraph/javascript-typescript-langserver.svg)](https://david-dm.org/sourcegraph/javascript-typescript-langserver)
10+
[![OpenTracing Badge](https://img.shields.io/badge/OpenTracing-enabled-blue.svg)](http://opentracing.io)
1011
[![Gitter](https://badges.gitter.im/sourcegraph/javascript-typescript-langserver.svg)](https://gitter.im/sourcegraph/javascript-typescript-langserver?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1112

1213
This is a language server for JavaScript and TypeScript that adheres to the [Language Server Protocol (LSP)](https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md). It uses [TypeScript's](http://www.typescriptlang.org/) LanguageService to perform source code analysis.
1314

14-
## Getting started
1515

16-
1. `npm install`
17-
1. `npm run build`
18-
1. `node lib/language-server.js`
16+
## Try it out
1917

20-
To try it in [Visual Studio Code](https://code.visualstudio.com), install the [vscode-client](https://github.com/sourcegraph/langserver/tree/master/vscode-client) extension and then open up a `.ts` file.
18+
- On [sourcegraph.com](https://sourcegraph.com/github.com/sourcegraph/javascript-typescript-langserver/-/blob/src/typescript-service.ts)
19+
- In [Visual Studio Code](https://github.com/sourcegraph/vscode-javascript-typescript) (as an alternative to the built-in TypeScript integration)
20+
- In [Eclipse Che](https://eclipse.org/che/)
21+
- In [NeoVim](https://github.com/autozimu/LanguageClient-neovim)
2122

22-
## Development
23+
## Features
2324

24-
Run `npm run watch`.
25+
- Hovers
26+
- Goto definition
27+
- Find all references
28+
- Document symbols
29+
- Workspace symbol search
30+
- Rename
31+
- Completion
32+
- Signature help
33+
- Diagnostics
34+
- Quick fixes
2535

26-
## Tests
36+
## Run it from source
2737

28-
Run `npm test`.
38+
```bash
39+
# install dependencies
40+
npm install
2941

30-
## Command line arguments
42+
# compile
43+
npm run build
44+
# or compile on file changes
45+
npm run watch
3146

32-
* `-p, --port` specifies port to use, default one is `2089`
33-
* `-s, --strict` enables strict mode where server expects all files to be receives in `didOpen` notification requests
34-
* `-c, --cluster` specifies number of concurrent cluster workers (defaults to number of CPUs)
35-
* `-t, --trace` enables printing of all incoming and outgoing messages
36-
* `-l, --logfile` specifies log file to print all messages to
47+
# run over STDIO
48+
node lib/language-server-stdio
49+
# or run over TCP
50+
node lib/language-server
3751

38-
## Supported LSP requests
52+
# run tests
53+
npm test
54+
```
3955

40-
### `initialize`
41-
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.
42-
### `exit`
43-
Implementation closes underlying communication channel
44-
### `shutdown`
45-
Does nothing opposite to LSP specification that expects server to exit
46-
### `textDocument/hover`
47-
### `textDocument/definition`
48-
### `textDocument/references`
49-
### `workspace/symbols`
50-
Introduces `limit` parameter to limit number of symbols to return
56+
## Options
5157

52-
## Differences from LSP protocol specification
53-
In strict mode LSP server does not touch underlying file system, instead it uses the [LSP files extension](https://github.com/sourcegraph/language-server-protocol/blob/master/extension-files.md) to retrieve workspace files and file contents.
58+
```
59+
Usage: language-server [options]
5460
55-
## Known issues
61+
Options:
5662
57-
* 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.
63+
-h, --help output usage information
64+
-V, --version output the version number
65+
-s, --strict enabled strict mode
66+
-p, --port [port] specifies LSP port to use (2089)
67+
-c, --cluster [num] number of concurrent cluster workers (defaults to number of CPUs, 8)
68+
-t, --trace print all requests and responses
69+
-l, --logfile [file] log to this file
70+
```
5871

72+
## Extensions
73+
74+
This language server implements some LSP extensions, prefixed with an `x`.
75+
76+
- **[Files extension](https://github.com/sourcegraph/language-server-protocol/blob/master/extension-files.md)**
77+
Allows the server to request file contents without accessing the file system
78+
- **[SymbolDescriptor extension](https://github.com/sourcegraph/language-server-protocol/blob/master/extension-workspace-references.md)**
79+
Get a SymbolDescriptor for a symbol, search the workspace for symbols or references to it
80+
- **[Streaming](https://github.com/sourcegraph/language-server-protocol/blob/streaming/protocol.md#partialResult)**
81+
Supports streaming partial results for all endpoints through JSON Patches
82+
- **Packages extension**
83+
Methods to get information about dependencies
84+
- **TCP / multiple client support**
85+
When running over TCP, the `exit` notification will not kill the process, but close the TCP socket
86+
87+
## Versioning
88+
89+
This project follows [semver](http://semver.org/) for command line arguments and standard LSP methods.
90+
Any change to command line arguments, Node version or protocol breaking changes will result in a major version increase.

0 commit comments

Comments
 (0)