Skip to content

jdbaldry/jsonnet-language-server

Repository files navigation

Jsonnet Language Server

Warning: This project is no longer in active development Use the Grafana Labs maintained tool instead: https://github.com/grafana/jsonnet-language-server.

A Language Server Protocol (LSP) server for Jsonnet.

Demonstration

jsonnet-language-server-demo.mp4

Features

Jump to definition
For local variables, import and importstr files, and index targets.
Workspace symbols
Return a hierarchy of document symbols representing all desugared nodes of the Jsonnet AST.
Diagnostics
Static errors and warnings of runtime errors.
Formatting
Format document according to default options.

Refer to example.jsonnet for a documented walkthrough.

Installation

To install the LSP server with Go into “${GOPATH}”/bin:

go get -u github.com/jdbaldry/jsonnet-language-server

To download the latest release binary from GitHub:

curl -Lo jsonnet-language-server https://github.com/jdbaldry/jsonnet-language-server/releases/latest/download/jsonnet-language-server

Contributing

Contributions are more than welcome and I will try my best to be prompt with reviews.

Commits

Individual commits should be meaningful and have useful commit messages. For tips on writing commit messages, refer to How to write a commit message. Contributions will be rebased before merge to ensure a fast-forward merge.

Contributors must sign the DCO for their contributions to be accepted.

Code style

Go code should be formatted with gofmt and linted with golangci-lint.

Editor integration

Emacs

Refer to editor/jsonnet-language-server.el for an example of enabling the LSP server with lsp-mode.

VSCodium / VSCode

Use the vscode-jsonnet extension