A NWScript LSP.

Overview

README

NWScript: EE Language Server is a Visual Studio Code extension LSP for the NWScript language.

While it seems to work well, even in bigger and older code bases, it is still an early project and there might be some unintended behaviours.

Dependencies

Formatting

clang-format.

Usage

Simply open a project with nss files and the extension installed. The extension will index your files and you will be ready to go - it can currently take up to 10-15 seconds to index big projects.

Notes:

  • The files are indexed in background processes, which means it will not block other features of the LSP like formatting, and a file's local definitions generated on the fly will be available.
  • The files are indexed incrementally, which means a file's global definitions become available as soon as it has been indexed.

Formatting

{
    "files.associations": {
      "*.nss": "nwscript"
    },
    "[nwscript]": {
      "editor.defaultFormatter": "PhilippeChab.nwscript-ee-language-server"
    },
    "nwscript-ee-lsp.formatter": {
      "enabled": true,
      "executable": "clang-format",
      "ignoredGlobs": ["/folder/to/ignore/*.nss", "file/to/ignore/filename.nss"],
      "style": {
        "BasedOnStyle": "Google",
        "AlignTrailingComments": true,
        "AlignConsecutiveAssignments": true,
        "ColumnLimit": 250,
        "BreakBeforeBraces": "Allman",
        "AlignEscapedNewlinesLeft": true,
        "AlwaysBreakBeforeMultilineStrings": true,
        "MaxEmptyLinesToKeep": 1,
        "TabWidth": 4,
        "IndentWidth": 4,
        "UseTab": "Always"
      }
    }
}

Notes:

  • The executable setting must either bet set to you path executable's identifer, or its absolute path.
  • The style object must respect clang-format rules.

Features

Enhanced syntax highlighting:

Completion:

Hover information:

Goto definition:

Also:

  • Formatting
  • Range formatting
  • Signature help

Issues

Please report any issues on the github repository.

You might also like...
Comments
  • Organic scripts do not appear to be indexed

    Organic scripts do not appear to be indexed

    While nwscript.nss is indexed through a lib-def build, the organic scripts (such as nw_i0_spells and such) that are available via #include "<scriptname>" are not indexed, likely because they typically only exist in the game's .bif files unless there's a custom override in the module. Is there a way to index the organic scripts if they're included? These are the same .bif files that nwnsc uses for compilation of organic scripts.

    feature-request 
    opened by tinygiant98 9
A generalised LSP front-end, in the form of a vscode extension

Langoustine VS Code extension Langoustine VS Code extension Installation Configuration Passing arguments This is a simple VS code extension intended f

null 6 Nov 9, 2022
Marksman (Markdown LSP server) extension for coc.nvim

coc-marksman fork from a marksman-vscode Integrates Marksman language server into coc.nvim for delightful Markdown note taking experience. coc-marksma

yaegassy 17 Nov 18, 2022
A generalised LSP front-end, in the form of a vscode extension

Langoustine VS Code extension Langoustine VS Code extension Installation Configuration Passing arguments This is a simple VS code extension intended f

null 6 Nov 9, 2022