Git Product home page Git Product logo

kos-language-server's Introduction

kOS Language Server

Build Status Azure DevOps tests Azure DevOps coverage (branch)

A language server for Kerboscript within the KOS mod for Kerbal Space Program. A language server can provide features typical to an IDE language for the supported target language, in this case Kerboscript.

The project currently supports the following clients

For additional client support such as sublime text, emacs, notepad++ or others please post an issue with the requested editor.

Features

Currently the vscode client 1.1.5 implements the follow features

  • syntax highlighting
  • brace detection
  • code snippets
  • diagnostics on parsing errors
  • go to definition for symbols and run statements
  • symbol auto complete
  • suffix auto complete
  • manual completion triggering
  • rename symbol
  • unreachable code detection
  • function signature help
  • file symbol lookup
  • workspace symbol lookup
  • identify symbols that don't exist
  • identify unused symbols
  • identify symbols that shadow (hide) an existing variable
  • identify symbols that may not exist at runtime
  • on hover type definitions (experimental)
  • full workspace loading and change propagation
  • documentation searching

Directives

The language server includes several comment directives that can be included extra functionality

  • \\ #include <file path>: Include a script file in the current files scope even if no run is present
  • \\ #region: Foldable region start
  • \\ #endRegion: Foldable region end

Commands

All commands can be launched with ctrl+shift+p

  • launch kerbal space program kOS: Start Kerbal Space Program
  • launch telnet client using kOS: Connect Telnet Client
  • Route server logging to LSP inspector kOS: Route Logging to LSP inspector
  • Route server logging to Vscode kOS: Route Logging to Vscode
  • Search kOS Documentation kOS: Search Documentation

Workspace Configuration

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

{
  "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.

Global Configuration

These settings are currently included with the tool

  • kos-vscode.kerbalSpaceProgramPath Path to kerbal space program
  • kos-vscode.completionCase Indicate the preferred completion case for built in symbols
  • kos-vscode.telnetHost Host name of the telnet server
  • kos-vscode.telnetPort Host port of the telnet server
  • kos-vscode.lspPort Port to send lsp message to for the LSP Inspector
  • kos-vscode.trace.server
    • verbosity Detail level of the logs
    • format Log format
    • level Message level

Influence

This project is heavily inspired by the crafting interpreters series. Definitely check it out if your interested in creating your own language, or language tooling.

kos-language-server's People

Contributors

jonnyboyc avatar dependabot[bot] avatar kaufman-bryce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.