|
1 | 1 | # TSC Language Server |
2 | 2 |
|
3 | | -A work-in-progress language server written in Go, made for the TSC scripting |
4 | | -format. It aims to be small, performant, and completely editor-agnostic. The |
5 | | -language server implements the `.tscrc.json` spec (the spec document is also a |
6 | | -WIP). |
| 3 | +A language server made for the TSC scripting format used in games such as Cave |
| 4 | +Story. It aims to be small, performant, and completely editor-agnostic. The |
| 5 | +language server implements the [`.tscrc.json` spec][tscrc-spec]. |
| 6 | + |
| 7 | +## Project Overview |
| 8 | + |
| 9 | +The language server is written in the Go programming language and it ships as a |
| 10 | +standalone binary. Language clients can connect to the server through TCP or |
| 11 | +stdio. |
| 12 | + |
| 13 | +Please note that this language server is currently not 100% stable, so bugs may |
| 14 | +appear here and there. |
| 15 | + |
| 16 | +## Getting Started |
| 17 | + |
| 18 | +Language clients should normally install the language server for you |
| 19 | +automatically but you can also install it manually. In this case, you have to |
| 20 | +keep it up to date yourself, however. |
| 21 | + |
| 22 | +You can download a binary from the [GitHub releases page][releases]. Checksums |
| 23 | +are always attached so you can verify the integrity after download. Placing the |
| 24 | +binary somewhere in your PATH means that language cliens will be able to use it |
| 25 | +without any additional steps. |
| 26 | + |
| 27 | +## Usage |
| 28 | + |
| 29 | +You can start the server in one of two modes: |
| 30 | + |
| 31 | +- Standard I/O mode (by running `tsc-ls start`) |
| 32 | +- TCP mode (by running `tsc-ls tcp`) |
| 33 | + |
| 34 | +...however, you'd normally want a language client to handle this for you (a |
| 35 | +plugin or configuration in your IDE/editor). |
| 36 | + |
| 37 | +### Current Language Clients/Configurations |
| 38 | + |
| 39 | +- Visual Studio Code (WIP) |
| 40 | + |
| 41 | +## For Language Client Developers |
| 42 | + |
| 43 | +The TSC language server exposes the following LSP-specific JSON-RPC methods: |
| 44 | + |
| 45 | +- `textDocument/didOpen` - adds the opened document to the language server's |
| 46 | +file handler |
| 47 | +- `textDocument/didClose` - removes the document from the language server's file |
| 48 | +handler |
| 49 | +- `textDocument/didChange` - updates the document in the language server's file |
| 50 | +handler and sends error/warning diagnostics to the client |
| 51 | +- `textDocument/completion` - sends a list of TSC commands that can be used from |
| 52 | +within the editor's autocompletion feature |
| 53 | +- `textDocument/hover` - provides hover information for commands and events |
| 54 | +- `tsc/setConfig` - updates the LSP's default configuration with overrides from |
| 55 | +the workspace's `.tscrc.json` file |
| 56 | +- `tsc/resetConfig` - reverts to the LSP's built-in (standard) TSC configuration |
| 57 | + |
| 58 | +## Credits |
| 59 | + |
| 60 | +- [Studio Pixel][studio-pixel] and [Nicalis][nicalis] for Cave Story and the TSC |
| 61 | +scripting format |
| 62 | +- The [Terraform Language Server][terraform-ls] for inspiring a big part of this |
| 63 | +project's structure and inner workings (seriously guys, you did a phenomenal |
| 64 | +job!) |
7 | 65 |
|
8 | 66 | ## License |
9 | 67 |
|
10 | 68 | [MIT](https://github.com/nimblebun/tsc-language-server/blob/master/LICENSE). |
| 69 | + |
| 70 | +[tscrc-spec]: https://docs.nimblebun.works/tscrc-json |
| 71 | +[releases]: https://github.com/nimblebun/tsc-language-server/releases/latest |
| 72 | +[studio-pixel]: https://studiopixel.jp/ |
| 73 | +[nicalis]: https://www.nicalis.com/ |
| 74 | +[terraform-ls]: https://github.com/hashicorp/terraform-ls |
0 commit comments