Home

Awesome

jq-lsp

jq language server.

You probably want to use this via one of these:

It can currently do:

Install

# install latest release
go install github.com/wader/jq-lsp@latest
# install master
go install github.com/wader/jq-lsp@master

# copy binary to $PATH
cp "$(go env GOPATH)/bin/jq-lsp" /usr/local/bin

# build binary from cloned repo
go build -o jq-lsp .

Additional builtins using .jq-lsp.jq

To make jq-lsp aware of additional builtin function and variables you can use a .jq-lsp.jq file. The file is a normal jq file that is included automatically in each file.

This .jq-lsp.jq file add a function fetch and the variable $OPTIONS:

# function body is ignored but has to be valid jq
def fetch: empty;    # adds function fetch/0
def $OPTIONS: empty; # adds variable $OPTIONS

Development

# run all tests
go test -v ./...
# run tests and update responses
go test -v ./... -update

Thanks

jq-lsp uses a modified version of itchyny's gojq parser.

builtins documentation is based on https://github.com/stedolan/jq/blob/master/docs/content/manual/manual.yml and is licensed under https://github.com/stedolan/jq/blob/master/COPYING

TODO and ideas