From bf754304ac972db4599b50c0ff1c8a2945b9ea61 Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Mon, 16 Nov 2020 20:56:17 +0100 Subject: [PATCH 1/8] try to implement galaxyls --- clients/lsp-galaxy.el | 86 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 clients/lsp-galaxy.el diff --git a/clients/lsp-galaxy.el b/clients/lsp-galaxy.el new file mode 100644 index 00000000000..8fd3886d3d9 --- /dev/null +++ b/clients/lsp-galaxy.el @@ -0,0 +1,86 @@ +;;; lsp-galaxy.el --- description -*- lexical-binding: t; -*- + +;; Copyright (C) 2020 emacs-lsp maintainers + +;; Author: emacs-lsp maintainers +;; Keywords: lsp, php + +;; 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 Clients for the GalaxyProject + +;;; Code: +(require 'lsp-mode) + +(defgroup lsp-galaxy nil + "LSP support for Galaxy" + :group 'lsp-mode + :link '(url-link "https://github.com/galaxyproject/galaxy-language-server/") + :package-version '(lsp-mode . "6.3")) + +(defcustom lsp-galaxy-galaxy-cmd '["python" "-m" "galaxyls"] + "Path to binary used in Galaxy Language Server. Defaults to `python -m galaxyls' if nil." + :type 'lsp-string-vector + :group 'lsp-galaxy + :package-version '(lsp-mode . "7.0.1")) + +(defcustom lsp-galaxy-language-server-host "127.0.0.1" + "Choose host address." + :type 'string + :group 'lsp-galaxy + :package-version '(lsp-mode . "6.3")) + +(defcustom lsp-galaxy-language-server-port 2087 + "Choose listen port." + :type 'integer + :group 'lsp-galaxy + :package-version '(lsp-mode . "6.3")) + +(defcustom lsp-galaxy-language-server-client-version "2.1.0" + "Choose client version." + :type 'string + :group 'lsp-galaxy + :package-version '(lsp-mode . "6.3")) + +(defcustom lsp-galaxy-file-filter '[".xml"] + "A vector of directories filtering galaxy file." + :type 'lsp-string-vector + :group 'lsp-galaxy + :package-version '(lsp-mode . "7.0.1")) + + +(lsp-register-custom-settings + '(("galaxy.galaxyCmd" lsp-galaxy-galaxy-cmd) + ("galaxy.fileFilter" lsp-galaxy-file-filter))) + +(lsp-register-client + (make-lsp-client + :new-connection (lsp-stdio-connection + (lambda () + (list lsp-galaxy-galaxy-cmd "--tcp" + (format "--host %s --port %d" + lsp-galaxy-language-server-host + lsp-galaxy-language-server-port)))) + :major-modes '(galaxy-mode cgalaxy-mode) + :initialized-fn (lambda (workspace) + (with-lsp-workspace workspace + (lsp--set-configuration + (lsp-configuration-section "galaxy")))) + :priority -1 + :server-id 'galaxy-language-server)) + +(provide 'lsp-galaxy) +;;; lsp-galaxy.el ends here From 03485b390e5d8f837b7ac219de3a8bb9750dfcb6 Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Mon, 16 Nov 2020 20:56:29 +0100 Subject: [PATCH 2/8] add to imports --- lsp-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lsp-mode.el b/lsp-mode.el index 7d29bd33ac3..85345e5654c 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -355,6 +355,7 @@ unless overridden by a more specific face association." lsp-kotlin lsp-lua lsp-nim lsp-nix lsp-metals lsp-ocaml lsp-perl lsp-php lsp-pwsh lsp-pyls lsp-python-ms lsp-purescript lsp-r lsp-rf lsp-rust lsp-solargraph lsp-tex lsp-terraform lsp-vala lsp-verilog lsp-vetur lsp-vhdl lsp-vimscript lsp-xml + lsp-galaxy lsp-yaml lsp-sqls lsp-svelte) "List of the clients to be automatically required." :group 'lsp-mode @@ -809,7 +810,7 @@ Changes take effect only when a new session is started." (".*\\.tsx$" . "typescriptreact") (".*\\.ts$" . "typescript") (".*\\.jsx$" . "javascriptreact") - (".*\\.xml$" . "xml") + (".*\\.xml$" . "galaxy") (".*\\.hx$" . "haxe") (".*\\.lua$" . "lua") (".*\\.sql$" . "sql") From 11f934614beda30d9c7b594d468db6cd92b476f4 Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Tue, 17 Nov 2020 23:05:31 +0100 Subject: [PATCH 3/8] keywords changed --- clients/lsp-galaxy.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/lsp-galaxy.el b/clients/lsp-galaxy.el index 8fd3886d3d9..4eeecb077d2 100644 --- a/clients/lsp-galaxy.el +++ b/clients/lsp-galaxy.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2020 emacs-lsp maintainers ;; Author: emacs-lsp maintainers -;; Keywords: lsp, php +;; Keywords: lsp, galaxy ;; 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 From 49509ebad7b4b1ef95771e4d7f0c44013297cc29 Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Tue, 17 Nov 2020 23:08:12 +0100 Subject: [PATCH 4/8] versions changed to 7.1.0 --- clients/lsp-galaxy.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clients/lsp-galaxy.el b/clients/lsp-galaxy.el index 4eeecb077d2..f87116fb286 100644 --- a/clients/lsp-galaxy.el +++ b/clients/lsp-galaxy.el @@ -29,37 +29,37 @@ "LSP support for Galaxy" :group 'lsp-mode :link '(url-link "https://github.com/galaxyproject/galaxy-language-server/") - :package-version '(lsp-mode . "6.3")) + :package-version '(lsp-mode . "7.1.0")) (defcustom lsp-galaxy-galaxy-cmd '["python" "-m" "galaxyls"] "Path to binary used in Galaxy Language Server. Defaults to `python -m galaxyls' if nil." :type 'lsp-string-vector :group 'lsp-galaxy - :package-version '(lsp-mode . "7.0.1")) + :package-version '(lsp-mode . "7.1.0")) (defcustom lsp-galaxy-language-server-host "127.0.0.1" "Choose host address." :type 'string :group 'lsp-galaxy - :package-version '(lsp-mode . "6.3")) + :package-version '(lsp-mode . "7.1.0")) (defcustom lsp-galaxy-language-server-port 2087 "Choose listen port." :type 'integer :group 'lsp-galaxy - :package-version '(lsp-mode . "6.3")) + :package-version '(lsp-mode . "7.1.0")) (defcustom lsp-galaxy-language-server-client-version "2.1.0" "Choose client version." :type 'string :group 'lsp-galaxy - :package-version '(lsp-mode . "6.3")) + :package-version '(lsp-mode . "7.1.0")) (defcustom lsp-galaxy-file-filter '[".xml"] "A vector of directories filtering galaxy file." :type 'lsp-string-vector :group 'lsp-galaxy - :package-version '(lsp-mode . "7.0.1")) + :package-version '(lsp-mode . "7.1.0")) (lsp-register-custom-settings From 05553b82ec7d1a48eec2aaf8cacd3c56847a1104 Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Tue, 17 Nov 2020 23:12:20 +0100 Subject: [PATCH 5/8] alphabetical sort of modules --- lsp-mode.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lsp-mode.el b/lsp-mode.el index 85345e5654c..77333ab3c27 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -351,11 +351,10 @@ unless overridden by a more specific face association." '(ccls lsp-ada lsp-angular lsp-bash lsp-clangd lsp-clojure lsp-cmake lsp-crystal lsp-csharp lsp-css lsp-dart lsp-dhall lsp-dockerfile lsp-elm lsp-elixir lsp-erlang lsp-eslint lsp-fortran lsp-fsharp lsp-gdscript lsp-go - lsp-hack lsp-groovy lsp-haskell lsp-haxe lsp-java lsp-javascript lsp-json + lsp-hack lsp-galaxy lsp-groovy lsp-haskell lsp-haxe lsp-java lsp-javascript lsp-json lsp-kotlin lsp-lua lsp-nim lsp-nix lsp-metals lsp-ocaml lsp-perl lsp-php lsp-pwsh lsp-pyls lsp-python-ms lsp-purescript lsp-r lsp-rf lsp-rust lsp-solargraph lsp-tex lsp-terraform lsp-vala lsp-verilog lsp-vetur lsp-vhdl lsp-vimscript lsp-xml - lsp-galaxy lsp-yaml lsp-sqls lsp-svelte) "List of the clients to be automatically required." :group 'lsp-mode From a6f046ee2731bb3b1e86cb48ffb214f25e36b42e Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Tue, 17 Nov 2020 23:12:36 +0100 Subject: [PATCH 6/8] restore previous xml default --- lsp-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lsp-mode.el b/lsp-mode.el index 77333ab3c27..7a5c2867703 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -809,7 +809,7 @@ Changes take effect only when a new session is started." (".*\\.tsx$" . "typescriptreact") (".*\\.ts$" . "typescript") (".*\\.jsx$" . "javascriptreact") - (".*\\.xml$" . "galaxy") + (".*\\.xml$" . "xml") (".*\\.hx$" . "haxe") (".*\\.lua$" . "lua") (".*\\.sql$" . "sql") From 363c4eb0454c7e91675b16dab84db3ce4fba7a20 Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Tue, 17 Nov 2020 23:19:29 +0100 Subject: [PATCH 7/8] changed major mode hook XML files normally load ``nxml-mode'' so this should be the main trigger. The ``galaxyxml-mode'' does not yet exist, but could be easily implemented to help signal ``lsp-galaxy'' instead of ``lsp-xml'' --- clients/lsp-galaxy.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/lsp-galaxy.el b/clients/lsp-galaxy.el index f87116fb286..9dd5306a0fc 100644 --- a/clients/lsp-galaxy.el +++ b/clients/lsp-galaxy.el @@ -74,7 +74,7 @@ (format "--host %s --port %d" lsp-galaxy-language-server-host lsp-galaxy-language-server-port)))) - :major-modes '(galaxy-mode cgalaxy-mode) + :major-modes '(nxml-mode galaxyxml-mode) :initialized-fn (lambda (workspace) (with-lsp-workspace workspace (lsp--set-configuration From ace7be1f56207b0c227e3a584adb587426eb1c53 Mon Sep 17 00:00:00 2001 From: Mehmet Tekman Date: Sat, 5 Dec 2020 16:53:49 +0100 Subject: [PATCH 8/8] changes the mode was renamed, the major mode was bound to a planemo-mode and this was added to the language id variable --- clients/lsp-galaxy.el | 4 ++-- docs/lsp-clients.json | 8 ++++++++ lsp-mode.el | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/clients/lsp-galaxy.el b/clients/lsp-galaxy.el index 9dd5306a0fc..f429357176a 100644 --- a/clients/lsp-galaxy.el +++ b/clients/lsp-galaxy.el @@ -74,13 +74,13 @@ (format "--host %s --port %d" lsp-galaxy-language-server-host lsp-galaxy-language-server-port)))) - :major-modes '(nxml-mode galaxyxml-mode) + :major-modes '(planemo-mode) :initialized-fn (lambda (workspace) (with-lsp-workspace workspace (lsp--set-configuration (lsp-configuration-section "galaxy")))) :priority -1 - :server-id 'galaxy-language-server)) + :server-id 'galaxyls)) (provide 'lsp-galaxy) ;;; lsp-galaxy.el ends here diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index 2cd07429f93..4bec92533a1 100644 --- a/docs/lsp-clients.json +++ b/docs/lsp-clients.json @@ -147,6 +147,14 @@ "installation": "pip install fortran-language-server", "debugger": "Yes" }, + { + "name": "galaxyls", + "full-name": "Galaxy Language Server", + "server-name": "galaxyls", + "server-url": "https://github.com/galaxyproject/galaxy-language-server", + "installation": "pip install galaxy-language-server", + "debugger": "Not available" + }, { "name": "gdscript", "full-name": "GDScript", diff --git a/lsp-mode.el b/lsp-mode.el index 7a5c2867703..2f6dcff4e3e 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -893,6 +893,7 @@ Changes take effect only when a new session is started." (racket-mode . "racket") (nix-mode . "nix") (prolog-mode . "prolog") + (planemo-mode . "galaxyls") (vala-mode . "vala")) "Language id configuration.")