Skip to content

Commit

Permalink
Add jq-lsp, client for Jq language (#4140)
Browse files Browse the repository at this point in the history
* Add jq-lsp, client for Jq language

* add lsp-jq
  • Loading branch information
nverno authored Oct 16, 2023
1 parent 7c48025 commit 6dcc225
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* Changelog
** Unreleased 8.0.1
* Add [[https://github.com/wader/jq-lsp][jq-lsp]]
* Add architecture triples for [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] file downloads, to support macos on ARM and X86.
* Add semantic token support for [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] in lsp-erlang client.
* Update [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] download file names to match new upstream names.
Expand Down
51 changes: 51 additions & 0 deletions clients/lsp-jq.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
;;; lsp-jq.el --- lsp client for jq -*- lexical-binding: t; -*-

;; Copyright (C) 2020 emacs-lsp maintainers

;; Author: emacs-lsp maintainers
;; Keywords: lsp, jq

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:
;;
;; LSP client for jq language.
;;
;;; Code:

(require 'lsp-mode)

(defgroup lsp-jq nil
"LSP support for Jq."
:group 'lsp-mode
:link '(url-link "https://github.com/wader/jq-lsp"))

(defcustom lsp-clients-jq-server-executable '("jq-lsp")
"The jq language server executable to use."
:group 'lsp-jq
:risky t
:type '(repeat string))

(lsp-register-client
(make-lsp-client
:new-connection (lsp-stdio-connection (lambda () lsp-clients-jq-server-executable))
:activation-fn (lsp-activate-on "jq")
:priority -1
:major-modes '(jq-mode jq-ts-mode)
:server-id 'jq-lsp))

(lsp-consistency-check lsp-jq)

(provide 'lsp-jq)
;;; lsp-jq.el ends here
9 changes: 9 additions & 0 deletions docs/lsp-clients.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,15 @@
"installation-url": "https://github.com/JuliaEditorSupport/LanguageServer.jl",
"debugger": "Not available"
},
{
"name": "jq",
"full-name": "Jq (jq-lsp)",
"server-name": "jq-lsp",
"server-url": "https://github.com/wader/jq-lsp",
"installation": "go install github.com/wader/jq-lsp@master",
"installation-url": "https://github.com/wader/jq-lsp#install",
"debugger": "Not available"
},
{
"name": "kotlin",
"full-name": "Kotlin",
Expand Down
7 changes: 5 additions & 2 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ As defined by the Language Server Protocol 3.16."
lsp-solargraph lsp-sorbet lsp-sourcekit lsp-sonarlint lsp-tailwindcss lsp-tex lsp-terraform
lsp-toml lsp-ttcn3 lsp-typeprof lsp-v lsp-vala lsp-verilog lsp-vetur lsp-volar
lsp-vhdl lsp-vimscript lsp-xml lsp-yaml lsp-ruby-lsp lsp-ruby-syntax-tree
lsp-sqls lsp-svelte lsp-steep lsp-tilt lsp-zig)
lsp-sqls lsp-svelte lsp-steep lsp-tilt lsp-zig lsp-jq)
"List of the clients to be automatically required."
:group 'lsp-mode
:type '(repeat symbol))
Expand Down Expand Up @@ -770,6 +770,7 @@ Changes take effect only when a new session is started."
("\\.json$" . "json")
("\\.jsonc$" . "jsonc")
("\\.jsx$" . "javascriptreact")
("\\.jq$" . "jq")
("\\.lua$" . "lua")
("\\.mdx\\'" . "mdx")
("\\.php$" . "php")
Expand Down Expand Up @@ -927,7 +928,9 @@ Changes take effect only when a new session is started."
(bibtex-mode . "bibtex")
(rst-mode . "restructuredtext")
(glsl-mode . "glsl")
(shader-mode . "shaderlab"))
(shader-mode . "shaderlab")
(jq-mode . "jq")
(jq-ts-mode . "jq"))
"Language id configuration.")

(defvar lsp--last-active-workspaces nil
Expand Down

0 comments on commit 6dcc225

Please sign in to comment.