diff --git a/CHANGELOG.org b/CHANGELOG.org index 021e3f1ef0..eef1415f6b 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -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. diff --git a/clients/lsp-jq.el b/clients/lsp-jq.el new file mode 100644 index 0000000000..a452744c2f --- /dev/null +++ b/clients/lsp-jq.el @@ -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 . + +;;; 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 diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index 5b65644008..6d163cfd5a 100644 --- a/docs/lsp-clients.json +++ b/docs/lsp-clients.json @@ -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", diff --git a/lsp-mode.el b/lsp-mode.el index ea08d129ed..df40db28e6 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -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)) @@ -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") @@ -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