From bfeea8534c982693117031c9056147a05d8ef216 Mon Sep 17 00:00:00 2001 From: nverno Date: Thu, 17 Aug 2023 15:27:33 -0700 Subject: [PATCH] Add jq-lsp, client for Jq language --- CHANGELOG.org | 1 + clients/lsp-jq.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++ lsp-mode.el | 3 ++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 clients/lsp-jq.el diff --git a/CHANGELOG.org b/CHANGELOG.org index 7e755f92786..ba1a318b9c1 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 [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] support in lsp-erlang client. * Add [[https://github.com/elixir-tools/credo-language-server][credo-language-server]] * Add support for clojure-ts-mode in clojure-lsp client diff --git a/clients/lsp-jq.el b/clients/lsp-jq.el new file mode 100644 index 00000000000..46e26e5dc57 --- /dev/null +++ b/clients/lsp-jq.el @@ -0,0 +1,46 @@ +;;; lsp-r.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-jq-executable '("jq-lsp") + "Command to run the Jq language server." + :group 'lsp-jq + :risky t + :type '(repeat string)) + +(lsp-register-client + (make-lsp-client + :new-connection (lsp-stdio-connection lsp-jq-executable) + :major-modes '(jq-mode) + :server-id 'jq-ls)) + +(provide 'lsp-jq) +;;; lsp-jq.el ends here diff --git a/lsp-mode.el b/lsp-mode.el index e4b518e8215..7a89c012cca 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -925,7 +925,8 @@ 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")) "Language id configuration.") (defvar lsp--last-active-workspaces nil