jsonnet-language-server icon indicating copy to clipboard operation
jsonnet-language-server copied to clipboard

A Language Server Protocol (LSP) server for Jsonnet (https://jsonnet.org).

#+TITLE: 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 [[https://langserver.org][Language Server Protocol (LSP)]] server for [[https://jsonnet.org][Jsonnet]].

** Demonstration [[https://user-images.githubusercontent.com/4599384/138060166-6ef56086-80c7-4d1a-9bcd-8de59e200b5e.mp4][LSP server demonstration]]

** 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 [[file:example.jsonnet][example.jsonnet]] for a documented walkthrough.

** Installation To install the LSP server with Go into "${GOPATH}"/bin: #+NAME: Installation with Go #+BEGIN_SRC shell go get -u github.com/jdbaldry/jsonnet-language-server #+END_SRC

To download the latest release binary from GitHub: #+NAME: Download from GitHub #+BEGIN_SRC shell curl -Lo jsonnet-language-server https://github.com/jdbaldry/jsonnet-language-server/releases/latest/download/jsonnet-language-server #+END_SRC

#+RESULTS: Download from GitHub

** 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 [[https://chris.beams.io/posts/git-commit/][How to write a commit message]]. Contributions will be rebased before merge to ensure a fast-forward merge.

*** [[https://github.com/probot/dco#how-it-works][Developer Certificate of Origin (DCO)]] Contributors must sign the DCO for their contributions to be accepted.

*** Code style Go code should be formatted with ~gofmt~ and linted with [[https://golangci-lint.run/][golangci-lint]].

** Editor integration

*** Emacs Refer to [[file:editor/jsonnet-language-server.el][editor/jsonnet-language-server.el]] for an example of enabling the LSP server with lsp-mode.

*** [[https://github.com/VSCodium/vscodium][VSCodium]] / VSCode Use the [[https://github.com/julienduchesne/vscode-jsonnet][vscode-jsonnet extension]]