# kos-language-server

> A Language server for Kerbal Operating System. A mod for Kerbal Space Program.

Latest version **1.1.5** (published 2020-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install kos-language-server
pnpm add kos-language-server
yarn add kos-language-server
bun add kos-language-server
```

Provides the command `kls`.

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.5 |
| Published | 2020-08-05 |
| First published | 2019-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.9.0 |
| Dependencies | 7 |
| Unpacked size | 2.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Author | John Chabot |
| Maintainers | jonnyboyc |
| Keywords | Kerbal Operating System, kos, Kerbal Space Program, ksp, language-server |

## Links

- npm: https://www.npmjs.com/package/kos-language-server
- Repository: https://github.com/jonnyboyC/kos-language-server
- Homepage: https://github.com/jonnyboyC/kos-language-server#readme
- Issues: https://github.com/jonnyboyC/kos-language-server/issues
- npm.io page: https://npm.io/package/kos-language-server

## Dependencies (7)

- [denque](https://npm.io/package/denque.md) ^1.4.1
- [commander](https://npm.io/package/commander.md) ^5.1.0
- [vscode-uri](https://npm.io/package/vscode-uri.md) ^2.1.2
- [jsonc-parser](https://npm.io/package/jsonc-parser.md) ^2.3.0
- [ts-set-utils](https://npm.io/package/ts-set-utils.md) ^0.2.0
- [vscode-languageserver](https://npm.io/package/vscode-languageserver.md) ^6.1.1
- [vscode-languageserver-textdocument](https://npm.io/package/vscode-languageserver-textdocument.md) ^1.0.1

## Recent versions

- 1.1.5 (latest) — 2020-08-05
- 1.1.3 — 2020-06-05
- 1.1.1 — 2020-01-19
- 1.1.0 — 2020-01-18
- 1.0.1 — 2020-01-03
- 1.0.0 — 2019-12-28
- 0.14.0 — 2019-12-17
- 0.13.0 — 2019-11-27
- 0.12.1 — 2019-11-07
- 0.12.0 — 2019-10-12
- 0.11.0 — 2019-09-10
- 0.10.0 — 2019-08-22
- 0.9.1 — 2019-07-25
- 0.9.0 — 2019-07-25
- 0.8.0 — 2019-07-12
- … 14 more at https://npm.io/package/kos-language-server/versions

## README

# KOS Language Server

kos-language-server is a language server for the Kerboscript language, part of Kerbal Operating System mod.

## Installation
This package should like be installed globally using 

      npm install -g kos-language-server

the server can then be started by

      kls

## Arguments

- `-v` `--version`            output the version number
- `--node-ipc`                Connect with node inter process communication
- `--stdio`                   Connect with standard io
- `--clientProcessId`         Id of the attached client process
- `--harmony_async_iteration` Must be enabled if using node.js pre 10.0
- `-h` `--help`               output usage information


## Features
Currently the kos-language-server 1.1.5 implements the follow features
- Code completion
    - Built in symbols and keywords
    - local in scope symbols
    - suffixes where the type can be resolved
    - can be manually triggered
- Document Symbols for quick navigation to properties in the document.
- Workspace Symbols 
- Diagnostics (Validation) are pushed for all documents
  - syntax errors
  - semantic errors such as:
    - invalid parameter order
    - lazy global position
    - return and break outside of function or loop body
  - semantic warnings such as:
    - potentially undefined symbols
    - symbols that are shadowed by other symbols
    - potentially unused symbols
    - unreachable code
- Go to definition for symbols and run statements. Currently for clashing globals the first found will be shown
- Refactoring
  - Rename symbol
- Type Checking
  - type checker for identifying wrong types
  - can in certain scenarios correctly identify the types of symbols and expressions
- On hover symbol information with type info
- Signature help for functions that can be correctly resolved
- Caching of all documents in the workspace
- Directives
  - Foldable regions using `// #region` and `// #endregion`
  - Include symbols using `// #include <file-path>`
- Linting configuration with `ksconfig.json`

## Configuration
The workspace can be configured with a file called `ksconfig.json`. The following is an example

```json
{
  "archive": "..",
  "bodies": ["earth", "moon", "sun"],
  "linting": {
    "control-flow-break": "off"
  }
}
```

This will set the archive folder to correspond to the folder above, the valid bodes to be `earth`, `moon` and `sun` and to turn off linting related to invalid break statements. More info can be found [here](https://github.com/jonnyboyC/kos-language-server/tree/master/server/ksconfig.md).

---
_Source: https://npm.io/package/kos-language-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
