From 564b526704c44443d6cff5a589bbe6ad021e46ca Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:21:52 +0200 Subject: [PATCH 01/17] Bump the magik language server to 0.10.0 (#4514) * [lsp-magik] Add extra settings, re-order and remove obsolete setting * Update lsp-magik.el * Update lsp-magik.el --- clients/lsp-magik.el | 54 +++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/clients/lsp-magik.el b/clients/lsp-magik.el index 77c9c7e985..306cd45916 100644 --- a/clients/lsp-magik.el +++ b/clients/lsp-magik.el @@ -34,7 +34,7 @@ :tag "Lsp Magik" :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-version "0.9.0" +(defcustom lsp-magik-version "0.10.0" "Version of LSP server." :type `string :group `lsp-magik @@ -58,14 +58,14 @@ :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-smallworld-gis nil - "Path to Smallworld Core." +(defcustom lsp-magik-java-home nil + "Path to Java Runtime, Java 17 minimum." :type `string :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-libs-dirs [] - "Paths to libs dirs of Smallworld products." +(defcustom lsp-magik-product-dirs [] + "Paths to (compiled, containing a libs/ directory) products." :type `lsp-string-vector :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) @@ -82,8 +82,8 @@ :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-typing-show-atom-inlay-hints nil - "Show atom type inlay hints." +(defcustom lsp-magik-typing-show-typing-inlay-hints nil + "Show typing inlay hints." :type `boolean :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) @@ -100,8 +100,32 @@ :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-typing-index-usages t - "Enable indexing of usages of globals/methods/slots/conditions by methods." +(defcustom lsp-magik-typing-index-global-usages t + "Enable indexing of usages of globals by methods." + :type `boolean + :group `lsp-magik + :package-version '(lsp-mode . "9.0.0")) + +(defcustom lsp-magik-typing-index-method-usages nil + "Enable indexing of usages of methods by methods." + :type `boolean + :group `lsp-magik + :package-version '(lsp-mode . "9.0.0")) + +(defcustom lsp-magik-typing-index-slot-usages t + "Enable indexing of usages of slots by methods." + :type `boolean + :group `lsp-magik + :package-version '(lsp-mode . "9.0.0")) + +(defcustom lsp-magik-typing-index-condition-usages t + "Enable indexing of usages of conditions by methods." + :type `boolean + :group `lsp-magik + :package-version '(lsp-mode . "9.0.0")) + +(defcustom lsp-magik-typing-cache-indexed-definitions-method-usages t + "Store and load the indexed definitions in the workspace folders." :type `boolean :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) @@ -134,14 +158,18 @@ :server-id 'magik)) (lsp-register-custom-settings - `(("magik.smallworldGis" lsp-magik-smallworld-gis) - ("magik.libsDirs" lsp-magik-libs-dirs) + `(("magik.javaHome" lsp-magik-java-home) + ("magik.productDirs" lsp-magik-product-dirs) ("magik.lint.overrideConfigFile" lsp-magik-lint-override-config-file) ("magik.typing.typeDatabasePaths" lsp-magik-typing-type-database-paths) - ("magik.typing.showAtomInlayHints" lsp-magik-typing-show-atom-inlay-hints) + ("magik.typing.showTypingInlayHints" lsp-magik-typing-show-typing-inlay-hints) ("magik.typing.showArgumentInlayHints" lsp-magik-typing-show-argument-inlay-hints) ("magik.typing.enableChecks" lsp-magik-typing-enable-checks) - ("magik.typing.indexUsages" lsp-magik-typing-index-usages))) + ("magik.typing.indexGlobalUsages" lsp-magik-typing-index-global-usages) + ("magik.typing.indexMethodUsages" lsp-magik-typing-index-method-usages) + ("magik.typing.indexSlotUsages" lsp-magik-typing-index-slot-usages) + ("magik.typing.indexConditionUsages" lsp-magik-typing-index-condition-usages) + ("magik.typing.cacheIndexedDefinitions" lsp-magik-typing-cache-indexed-definitions))) (lsp-consistency-check lsp-magik) From c8d8bd0f5c40123821bf7c90afa5b6abb05074cb Mon Sep 17 00:00:00 2001 From: Arseniy Zaostrovnykh Date: Fri, 2 Aug 2024 01:41:20 +0200 Subject: [PATCH 02/17] Add lsp-flush-delayed-changes-before-next-message option (#4512) Some LSP clients spam the server with message, such as "textDocument/codeAction" requests on every keystroke, so if we require synchronizing the delayed changes before the next LSP message, it looses its meaning: In most cases the next cursor movement comes right after a change, so `lsp--send-no-wait` forces the change notification out before it sends the codeAction request. Let the users of the slow LSP servers that depend on this change notification throttling customize this behavior to choose their own tradeoff. --- CHANGELOG.org | 1 + lsp-mode.el | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index 29e859c92e..aa75377d85 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -8,6 +8,7 @@ * Added a new optional ~:action-filter~ argument when defining LSP clients that allows code action requests to be modified before they are sent to the server. This is used by the Haskell language server client to work around an ~lsp-mode~ parsing quirk that incorrectly sends ~null~ values instead of ~false~ in code action requests. * Add support for C# via the [[https://github.com/dotnet/roslyn/tree/main/src/LanguageServer][Roslyn language server]]. * Add basic support for [[https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics][pull diagnostics]] requests. + * Add ~lsp-flush-delayed-changes-before-next-message~ customization point to enforce throttling document change notifications. ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. diff --git a/lsp-mode.el b/lsp-mode.el index 05cac9b3c2..2c4b1827e8 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -6743,13 +6743,24 @@ textDocument/didOpen for the new file." (advice-add 'set-visited-file-name :around #'lsp--on-set-visited-file-name) -(defvar lsp--flushing-delayed-changes nil) +(defcustom lsp-flush-delayed-changes-before-next-message t + "If non-nil send the document changes update before sending other messages. + +If nil, and `lsp-debounce-full-sync-notifications' is non-nil, + change notifications will be throttled by + `lsp-debounce-full-sync-notifications-interval' regardless of + other messages." + :group 'lsp-mode + :type 'boolean) + +(defvar lsp--not-flushing-delayed-changes t) (defun lsp--send-no-wait (message proc) "Send MESSAGE to PROC without waiting for further output." - (unless lsp--flushing-delayed-changes - (let ((lsp--flushing-delayed-changes t)) + (when (and lsp--not-flushing-delayed-changes + lsp-flush-delayed-changes-before-next-message) + (let ((lsp--not-flushing-delayed-changes nil)) (lsp--flush-delayed-changes))) (lsp-process-send proc message)) From 99e4c302d009c172479e7aef32f2e4edd5a11210 Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Date: Thu, 15 Aug 2024 01:56:52 +0200 Subject: [PATCH 03/17] Bump the magik language server to 0.10.1 (#4528) --- clients/lsp-magik.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/lsp-magik.el b/clients/lsp-magik.el index 306cd45916..970c4b132b 100644 --- a/clients/lsp-magik.el +++ b/clients/lsp-magik.el @@ -34,7 +34,7 @@ :tag "Lsp Magik" :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-version "0.10.0" +(defcustom lsp-magik-version "0.10.1" "Version of LSP server." :type `string :group `lsp-magik From 168bf2178b4955d3c4c9b2e66f5dd5bdf1518113 Mon Sep 17 00:00:00 2001 From: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Date: Thu, 15 Aug 2024 08:44:54 +0200 Subject: [PATCH 04/17] feat: use `lsp-defcustom` to declare settings for `lsp-magik` (#4525) * [lsp-magik] Use lsp-defcustom to declare settings * [lsp-magik] Mark new settings for the next-release --------- Co-authored-by: Sebastiaan Speck --- clients/lsp-magik.el | 76 +++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/clients/lsp-magik.el b/clients/lsp-magik.el index 970c4b132b..fb2edb663f 100644 --- a/clients/lsp-magik.el +++ b/clients/lsp-magik.el @@ -58,77 +58,89 @@ :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-java-home nil +(lsp-defcustom lsp-magik-java-home nil "Path to Java Runtime, Java 17 minimum." :type `string :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.0") + :lsp-path "magik.javaHome") -(defcustom lsp-magik-product-dirs [] +(lsp-defcustom lsp-magik-product-dirs [] "Paths to (compiled, containing a libs/ directory) products." :type `lsp-string-vector :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.productDirs") -(defcustom lsp-magik-lint-override-config-file nil +(lsp-defcustom lsp-magik-lint-override-config-file nil "Override path to magiklintrc.properties." :type 'string :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.0") + :lsp-path "magik.lint.overrideConfigFile") -(defcustom lsp-magik-typing-type-database-paths [] +(lsp-defcustom lsp-magik-typing-type-database-paths [] "Paths to type databases." :type `lsp-string-vector :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.0") + :lsp-path "magik.typing.typeDatabasePaths") -(defcustom lsp-magik-typing-show-typing-inlay-hints nil +(lsp-defcustom lsp-magik-typing-show-typing-inlay-hints nil "Show typing inlay hints." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.typing.showTypingInlayHints") -(defcustom lsp-magik-typing-show-argument-inlay-hints nil +(lsp-defcustom lsp-magik-typing-show-argument-inlay-hints nil "Show (certain) argument name inlay hints." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.typing.showArgumentInlayHints") -(defcustom lsp-magik-typing-enable-checks nil +(lsp-defcustom lsp-magik-typing-enable-checks nil "Enable typing checks." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.0") + :lsp-path "magik.typing.enableChecks") -(defcustom lsp-magik-typing-index-global-usages t +(lsp-defcustom lsp-magik-typing-index-global-usages t "Enable indexing of usages of globals by methods." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.typing.indexGlobalUsages") -(defcustom lsp-magik-typing-index-method-usages nil +(lsp-defcustom lsp-magik-typing-index-method-usages nil "Enable indexing of usages of methods by methods." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.typing.indexMethodUsages") -(defcustom lsp-magik-typing-index-slot-usages t +(lsp-defcustom lsp-magik-typing-index-slot-usages t "Enable indexing of usages of slots by methods." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.typing.indexSlotUsages") -(defcustom lsp-magik-typing-index-condition-usages t +(lsp-defcustom lsp-magik-typing-index-condition-usages t "Enable indexing of usages of conditions by methods." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.typing.indexConditionUsages") -(defcustom lsp-magik-typing-cache-indexed-definitions-method-usages t +(lsp-defcustom lsp-magik-typing-cache-indexed-definitions-method-usages t "Store and load the indexed definitions in the workspace folders." :type `boolean :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1") + :lsp-path "magik.typing.cacheIndexedDefinitions") (defcustom lsp-magik-java-path (lambda () (cond ((eq system-type 'windows-nt) @@ -138,7 +150,7 @@ "Path to Java Runtime, Java 11 minimum." :type 'string :group `lsp-magik - :package-version '(lsp-mode . "9.0.0")) + :package-version '(lsp-mode . "9.0.1")) (lsp-register-client (make-lsp-client @@ -157,20 +169,6 @@ (lsp--set-configuration (lsp-configuration-section "magik")))) :server-id 'magik)) -(lsp-register-custom-settings - `(("magik.javaHome" lsp-magik-java-home) - ("magik.productDirs" lsp-magik-product-dirs) - ("magik.lint.overrideConfigFile" lsp-magik-lint-override-config-file) - ("magik.typing.typeDatabasePaths" lsp-magik-typing-type-database-paths) - ("magik.typing.showTypingInlayHints" lsp-magik-typing-show-typing-inlay-hints) - ("magik.typing.showArgumentInlayHints" lsp-magik-typing-show-argument-inlay-hints) - ("magik.typing.enableChecks" lsp-magik-typing-enable-checks) - ("magik.typing.indexGlobalUsages" lsp-magik-typing-index-global-usages) - ("magik.typing.indexMethodUsages" lsp-magik-typing-index-method-usages) - ("magik.typing.indexSlotUsages" lsp-magik-typing-index-slot-usages) - ("magik.typing.indexConditionUsages" lsp-magik-typing-index-condition-usages) - ("magik.typing.cacheIndexedDefinitions" lsp-magik-typing-cache-indexed-definitions))) - (lsp-consistency-check lsp-magik) (provide 'lsp-magik) From fa8932742202dea664959135f9a44340849139f6 Mon Sep 17 00:00:00 2001 From: Aaron Gonzales Date: Thu, 15 Aug 2024 21:23:00 +0800 Subject: [PATCH 05/17] feat: add `lsp-yaml-schema-extensions` (#4527) * feat: add `lsp-yaml-schema-extensions` This commit replaces defconst `lsp-yaml--built-in-kubernetes-schema` with defcustom `lsp-yaml-schema-extensions` to enable users to extend the dropdown options provided by `lsp-yaml--get-supported-schemas`. This is helpful since users are no longer locked into the yaml-language-server's version of the Kubernetes schema. This also enables users to provide more schemas and multiple versions of schemas if need be i.e. multiple versions of the Kubernetes schema, if you work across multiple clusters. * fix: replace current Kubernetes schema with v1.30.3 The current schema provided `yaml-language-server` does not exist any longer so is causing a bug when loading the schema. * fix: docstring for `lsp-yaml-schema-extensions` --- clients/lsp-yaml.el | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/clients/lsp-yaml.el b/clients/lsp-yaml.el index 24db7e511e..376cac7bae 100644 --- a/clients/lsp-yaml.el +++ b/clients/lsp-yaml.el @@ -172,11 +172,16 @@ Limited for performance reasons." (lsp-package-ensure 'yaml-language-server callback error-callback)))) -(defconst lsp-yaml--built-in-kubernetes-schema - '((name . "Kubernetes") - (description . "Built-in kubernetes manifest schema definition") - (url . "kubernetes") - (fileMatch . ["*-k8s.yaml" "*-k8s.yml"]))) +(defcustom lsp-yaml-schema-extensions '(((name . "Kubernetes v1.30.3") + (description . "Kubernetes v1.30.3 manifest schema definition") + (url . "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.30.3-standalone-strict/all.json") + (fileMatch . ["*-k8s.yaml" "*-k8s.yml"]))) + "User defined schemas that extend default schema store. +Used in `lsp-yaml--get-supported-schemas' to supplement schemas provided by +`lsp-yaml-schema-store-uri'." + :type 'list + :group 'lsp-yaml + :package-version '(lsp-mode . "9.0.1")) (defun lsp-yaml-download-schema-store-db (&optional force-downloading) "Download remote schema store at `lsp-yaml-schema-store-uri' into local cache. @@ -194,7 +199,7 @@ Set FORCE-DOWNLOADING to non-nil to force re-download the database." (lsp-yaml-download-schema-store-db) (setq lsp-yaml--schema-store-schemas-alist (alist-get 'schemas (json-read-file lsp-yaml-schema-store-local-db)))) - (seq-concatenate 'list (list lsp-yaml--built-in-kubernetes-schema) lsp-yaml--schema-store-schemas-alist)) + (seq-concatenate 'list lsp-yaml-schema-extensions lsp-yaml--schema-store-schemas-alist)) (defun lsp-yaml-set-buffer-schema (uri-string) "Set yaml schema for the current buffer to URI-STRING." From 12befaabe4a1bf8a548bc820faa192be8ee89533 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Sat, 17 Aug 2024 15:00:26 +0100 Subject: [PATCH 06/17] lsp-rust: report command capabilities (#4529) Since https://github.com/rust-lang/rust-analyzer/commit/49184a138cb4df11279e81a6233a2b5014715771 rust-analyzer no longer assumes clients implement all remote commands. Since it gates the lenses it returns based on the known commands in the client, it no longer returns many useful ones. This PR explicitly lists the available commands, as mapped in the code a few lines above. --- clients/lsp-rust.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/clients/lsp-rust.el b/clients/lsp-rust.el index 5b00374747..6a6a4ae82b 100644 --- a/clients/lsp-rust.el +++ b/clients/lsp-rust.el @@ -1761,7 +1761,17 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m :semantic-tokens-faces-overrides `( :discard-default-modifiers t :modifiers ,(lsp-rust-analyzer--semantic-modifiers)) :server-id 'rust-analyzer - :custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode)))))) + :custom-capabilities `((experimental . + ((snippetTextEdit . ,(and lsp-enable-snippet (fboundp 'yas-minor-mode))) + (commands . ((commands . + [ + "rust-analyzer.runSingle" + "rust-analyzer.debugSingle" + "rust-analyzer.showReferences" + ;; "rust-analyzer.gotoLocation" + "rust-analyzer.triggerParameterHints" + ;; "rust-analyzer.rename" + ])))))) :download-server-fn (lambda (_client callback error-callback _update?) (lsp-package-ensure 'rust-analyzer callback error-callback)))) From 854ff72d917318716b1ced6a4eab654dd8e8472c Mon Sep 17 00:00:00 2001 From: Norio Suzuki Date: Thu, 22 Aug 2024 09:28:44 +0900 Subject: [PATCH 07/17] docs: Change URL of sqls (#4530) --- clients/lsp-sqls.el | 2 +- docs/lsp-clients.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/lsp-sqls.el b/clients/lsp-sqls.el index e60f69b7b4..7ea5ae6f5d 100644 --- a/clients/lsp-sqls.el +++ b/clients/lsp-sqls.el @@ -29,7 +29,7 @@ (defgroup lsp-sqls nil "LSP support for SQL, using sqls." :group 'lsp-mode - :link '(url-link "https://github.com/lighttiger2505/sqls") + :link '(url-link "https://github.com/sqls-server/sqls") :package-version `(lsp-mode . "7.0")) (defcustom lsp-sqls-server "sqls" diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index b87170014b..b3d88fef39 100644 --- a/docs/lsp-clients.json +++ b/docs/lsp-clients.json @@ -1029,8 +1029,8 @@ "name": "sqls", "full-name": "SQL (sqls)", "server-name": "sqls", - "server-url": "https://github.com/lighttiger2505/sqls", - "installation": "go install github.com/lighttiger2505/sqls@latest", + "server-url": "https://github.com/sqls-server/sqls", + "installation": "go install github.com/sqls-server/sqls@latest", "debugger": "Not available" }, { From b8dc0798b5867b4cc78234930eb819b39afb25fd Mon Sep 17 00:00:00 2001 From: eggc Date: Fri, 23 Aug 2024 16:42:10 +0900 Subject: [PATCH 08/17] feat: Add action-handlers for code-lens provided ruby-lsp-rails (#4522) --- clients/lsp-ruby-lsp.el | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/clients/lsp-ruby-lsp.el b/clients/lsp-ruby-lsp.el index e6039dafd7..3127169fe5 100644 --- a/clients/lsp-ruby-lsp.el +++ b/clients/lsp-ruby-lsp.el @@ -43,11 +43,35 @@ (if lsp-ruby-lsp-use-bundler '("bundle" "exec")) '("ruby-lsp"))) +(defun lsp-ruby-lsp--open-file (arg_hash) + "Open a file. This function is for code-lens provided by ruby-lsp-rails." + (let* ((arguments (gethash "arguments" arg_hash)) + (uri (aref (aref arguments 0) 0)) + (path-with-line-number (split-string (lsp--uri-to-path uri) "#L")) + (path (car path-with-line-number)) + (line-number (cadr path-with-line-number))) + (find-file path) + (when line-number (forward-line (1- (string-to-number line-number)))))) + +(defun lsp-ruby-lsp--run-test (arg_hash) + "Run a test file. This function is for code-lens provided by ruby-lsp-rails." + (let* ((arguments (gethash "arguments" arg_hash)) + (command (aref arguments 2)) + (default-directory (lsp-workspace-root)) + (buffer-name "*run test results*") + (buffer (progn + (when (get-buffer buffer-name) (kill-buffer buffer-name)) + (generate-new-buffer buffer-name)))) + (async-shell-command command buffer))) + (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection #'lsp-ruby-lsp--build-command) :activation-fn (lsp-activate-on "ruby") :priority -2 + :action-handlers (ht ("rubyLsp.openFile" #'lsp-ruby-lsp--open-file) + ("rubyLsp.runTest" #'lsp-ruby-lsp--run-test) + ("rubyLsp.runTestInTerminal" #'lsp-ruby-lsp--run-test)) :server-id 'ruby-lsp-ls)) (lsp-consistency-check lsp-ruby-lsp) From c36b95be6625dac5a37d3874a1a738e0c84ac39f Mon Sep 17 00:00:00 2001 From: Samuel Kyletoft <45131343+SKyletoft@users.noreply.github.com> Date: Fri, 23 Aug 2024 09:46:09 +0200 Subject: [PATCH 09/17] Enable nixd in nix-ts-mode too (#4521) * fix: Make nix-ts-mode consistent with nix-mode * lsp-nix: Enable nixd in nix-ts-mode too --- clients/lsp-nix.el | 2 +- lsp-mode.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/lsp-nix.el b/clients/lsp-nix.el index 19d847f5c6..b50b40c659 100644 --- a/clients/lsp-nix.el +++ b/clients/lsp-nix.el @@ -56,7 +56,7 @@ (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection (lambda () lsp-nix-nixd-server-path)) - :major-modes '(nix-mode) + :major-modes '(nix-mode nix-ts-mode) :server-id 'nixd-lsp :priority -1)) diff --git a/lsp-mode.el b/lsp-mode.el index 2c4b1827e8..0ed4c219f4 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -938,7 +938,7 @@ Changes take effect only when a new session is started." (robot-mode . "robot") (racket-mode . "racket") (nix-mode . "nix") - (nix-ts-mode . "Nix") + (nix-ts-mode . "nix") (prolog-mode . "prolog") (vala-mode . "vala") (actionscript-mode . "actionscript") From dd61303b2dc989a58f7dddd4c754f828a3f52107 Mon Sep 17 00:00:00 2001 From: Luke Chen <3363954+LukeXuan@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:43:22 -0400 Subject: [PATCH 10/17] fix typo (#4540) --- clients/lsp-tex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/lsp-tex.el b/clients/lsp-tex.el index ca6f475837..31c4701686 100644 --- a/clients/lsp-tex.el +++ b/clients/lsp-tex.el @@ -46,7 +46,7 @@ (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection lsp-clients-digestif-executable) - :major-modes '(plain-tex-mode latex-mode context-mode texinfo-mode LaTex-mode) + :major-modes '(plain-tex-mode latex-mode context-mode texinfo-mode LaTeX-mode) :priority (if (eq lsp-tex-server 'digestif) 1 -1) :server-id 'digestif)) From edec6f670930cd6d56c797562d83e66552efdf79 Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Sat, 14 Sep 2024 13:24:39 +0800 Subject: [PATCH 11/17] Fix logic for rust-analyzer.checkOnSave.features setting inheritance (#4542) The rust-analyzer inherits the setting of `rust-analyzer.checkOnSve.features` from `rust-analyzer.cargo.features` by default, but the elisp code here was incorrectly defaulting the former to the empty list, regardless of the value of the latter. The effect was that `rust-analyzer.cargo.features` disabled warnings about "inactive code", without actually turning on type checking of that code! --- CHANGELOG.org | 1 + clients/lsp-rust.el | 24 +++++++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.org b/CHANGELOG.org index aa75377d85..c0d7336f0c 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -9,6 +9,7 @@ * Add support for C# via the [[https://github.com/dotnet/roslyn/tree/main/src/LanguageServer][Roslyn language server]]. * Add basic support for [[https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics][pull diagnostics]] requests. * Add ~lsp-flush-delayed-changes-before-next-message~ customization point to enforce throttling document change notifications. + * Fix bug in ~rust-analyzer.check.features~ configuration via ~lsp-rust-checkonsave-features~ Emacs setting: we were defaulting to ~[]~, but ~rust-analyzer~ defaults to inheriting the value from ~rust-analyzer.cargo.features~. The bug resulted in code hidden behind features not getting type checked when those features were enabled by setting ~rust-analyzer.cargo.features~ via the ~lsp-rust-features~ Emacs setting. ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. diff --git a/clients/lsp-rust.el b/clients/lsp-rust.el index 6a6a4ae82b..48c17181fd 100644 --- a/clients/lsp-rust.el +++ b/clients/lsp-rust.el @@ -187,6 +187,7 @@ the latest build duration." (defcustom lsp-rust-features [] "List of features to activate. +Corresponds to the `rust-analyzer` setting `rust-analyzer.cargo.features`. Set this to `\"all\"` to pass `--all-features` to cargo." :type 'lsp-string-vector :group 'lsp-rust-rls @@ -596,9 +597,15 @@ The command should include `--message=format=json` or similar option." :group 'lsp-rust-analyzer :package-version '(lsp-mode . "8.0.2")) -(defcustom lsp-rust-analyzer-checkonsave-features [] +(defcustom lsp-rust-analyzer-checkonsave-features nil "List of features to activate. -Set this to `\"all\"` to pass `--all-features` to cargo." +Corresponds to the `rust-analyzer` setting `rust-analyzer.check.features`. +When set to `nil` (default), the value of `lsp-rust-features' is inherited. +Set this to `\"all\"` to pass `--all-features` to cargo. +Note: setting this to `nil` means \"unset\", whereas setting this +to `[]` (empty vector) means \"set to empty list of features\", +which overrides any value that would otherwise be inherited from +`lsp-rust-features'." :type 'lsp-string-vector :group 'lsp-rust-rust-analyzer :package-version '(lsp-mode . "8.0.2")) @@ -1666,11 +1673,22 @@ https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.m :merge (:glob ,(lsp-json-bool lsp-rust-analyzer-imports-merge-glob)) :prefix ,lsp-rust-analyzer-import-prefix) :lruCapacity ,lsp-rust-analyzer-lru-capacity + ;; This `checkOnSave` is called `check` in the `rust-analyzer` docs, not + ;; `checkOnSave`, but the `rust-analyzer` source code shows that both names + ;; work. The `checkOnSave` name has been supported by `rust-analyzer` for a + ;; long time, whereas the `check` name was introduced here in 2023: + ;; https://github.com/rust-lang/rust-analyzer/commit/d2bb62b6a81d26f1e41712e04d4ac760f860d3b3 :checkOnSave ( :enable ,(lsp-json-bool lsp-rust-analyzer-cargo-watch-enable) :command ,lsp-rust-analyzer-cargo-watch-command :extraArgs ,lsp-rust-analyzer-cargo-watch-args :allTargets ,(lsp-json-bool lsp-rust-analyzer-check-all-targets) - :features ,lsp-rust-analyzer-checkonsave-features + ;; We need to distinguish between setting this to the empty + ;; vector, and not setting it at all, which `rust-analyzer` + ;; interprets as "inherit from + ;; `rust-analyzer.cargo.features`". We use `nil` to mean + ;; "unset". + ,@(when (vectorp lsp-rust-analyzer-checkonsave-features) + `(:features ,lsp-rust-analyzer-checkonsave-features)) :overrideCommand ,lsp-rust-analyzer-cargo-override-command) :highlightRelated ( :breakPoints (:enable ,(lsp-json-bool lsp-rust-analyzer-highlight-breakpoints)) :closureCaptures (:enable ,(lsp-json-bool lsp-rust-analyzer-highlight-closure-captures)) From 213f20793e67fefbc43fa652af1c64d990662a1c Mon Sep 17 00:00:00 2001 From: Norio Suzuki Date: Sat, 14 Sep 2024 14:25:08 +0900 Subject: [PATCH 12/17] docs: fix `lsp-sqls-workspace-config-path` behavior (#4535) --- docs/manual-language-docs/lsp-sqls.md | 32 +++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/docs/manual-language-docs/lsp-sqls.md b/docs/manual-language-docs/lsp-sqls.md index b8b2b6c410..54f7f5474a 100644 --- a/docs/manual-language-docs/lsp-sqls.md +++ b/docs/manual-language-docs/lsp-sqls.md @@ -14,7 +14,10 @@ root_file: docs/manual-language-docs/lsp-sqls.md ``` -Alternatively, you can leave `lsp-sqls-workspace-config-path` to the default "workspace" value, and put a json file in `/.sqls/config.json` containing +## Storing Configuration in `/.sqls/config.json` + +Alternatively, you can store your configuration in the project root at `/.sqls/config.json`: + ``` { "sqls": { @@ -29,4 +32,29 @@ Alternatively, you can leave `lsp-sqls-workspace-config-path` to the default "wo } ``` -Now lsp should start in sql-mode buffers, and you can pick a server connection with `M-x lsp-execute-code-action` and "Switch Connections" (or directly with `M-x lsp-sql-switch-connection`). You can change database with `M-x lsp-execute-code-action` and "Switch Database" (or `M-x lsp-sql-switch-database`). +In this case, you need to set `lsp-sqls-workspace-config-path` to "root": + +```emacs-lisp +(setq lsp-sqls-workspace-config-path "root") +``` + +## Storing Configuration in the Current Directory + +If you want to configure it for the current directory, you can create a `.sqls/config.json` file: + +``` +.sqls/config.json +target.sql +``` + +For this setup, ensure that `lsp-sqls-workspace-config-path` is set to "workspace": + +```emacs-lisp +(setq lsp-sqls-workspace-config-path "workspace") +``` + +# Switching Connections and Databases + +Now, lsp should start in sql-mode buffers. You can choose a server connection using `M-x lsp-execute-code-action` and then selecting "Switch Connections", or directly with `M-x lsp-sql-switch-connection`. + +To change the database, use `M-x lsp-execute-code-action` and select "Switch Database" (or `M-x lsp-sql-switch-database`). From 6447c32ac63766788d77178d49474ef06971878d Mon Sep 17 00:00:00 2001 From: ccQpein Date: Sat, 14 Sep 2024 02:51:56 -0400 Subject: [PATCH 13/17] Update ruff-lsp to ruff of Python (#4543) * update ruff-lsp to ruff * rename lsp-ruff-lsp to ruff-lsp * change custom var and some crumbs of ruff-lsp to ruff * change log * tiny change --- CHANGELOG.org | 1 + clients/{lsp-ruff-lsp.el => lsp-ruff.el} | 81 ++++++++++++------------ docs/lsp-clients.json | 8 +-- lsp-mode.el | 2 +- mkdocs.yml | 2 +- 5 files changed, 48 insertions(+), 46 deletions(-) rename clients/{lsp-ruff-lsp.el => lsp-ruff.el} (52%) diff --git a/CHANGELOG.org b/CHANGELOG.org index c0d7336f0c..202cfb4f60 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -10,6 +10,7 @@ * Add basic support for [[https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics][pull diagnostics]] requests. * Add ~lsp-flush-delayed-changes-before-next-message~ customization point to enforce throttling document change notifications. * Fix bug in ~rust-analyzer.check.features~ configuration via ~lsp-rust-checkonsave-features~ Emacs setting: we were defaulting to ~[]~, but ~rust-analyzer~ defaults to inheriting the value from ~rust-analyzer.cargo.features~. The bug resulted in code hidden behind features not getting type checked when those features were enabled by setting ~rust-analyzer.cargo.features~ via the ~lsp-rust-features~ Emacs setting. + * Change ~ruff-lsp~ to ~ruff~ for python lsp client. All ~ruff-lsp~ customizable variable change to ~ruff~. Lsp server command now is ~["ruff" "server"]~ instead of ~["ruff-lsp"]~. ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. diff --git a/clients/lsp-ruff-lsp.el b/clients/lsp-ruff.el similarity index 52% rename from clients/lsp-ruff-lsp.el rename to clients/lsp-ruff.el index c95359d5c1..96ddddba21 100644 --- a/clients/lsp-ruff-lsp.el +++ b/clients/lsp-ruff.el @@ -1,4 +1,4 @@ -;;; lsp-ruff-lsp.el --- ruff-lsp support -*- lexical-binding: t; -*- +;;; lsp-ruff.el --- ruff lsp support -*- lexical-binding: t; -*- ;; Copyright (C) 2023 Freja Nordsiek ;; @@ -20,96 +20,97 @@ ;;; Commentary: -;; ruff-lsp Client for the Python programming language +;; ruff LSP Client for the Python programming language ;;; Code: (require 'lsp-mode) -(defgroup lsp-ruff-lsp nil - "LSP support for Python, using ruff-lsp's Python Language Server." +(defgroup lsp-ruff nil + "LSP support for Python, using ruff's Python Language Server." :group 'lsp-mode - :link '(url-link "https://github.com/charliermarsh/ruff-lsp")) + :link '(url-link "https://github.com/astral-sh/ruff")) -(defcustom lsp-ruff-lsp-server-command '("ruff-lsp") - "Command to start ruff-lsp." +(defcustom lsp-ruff-server-command '("ruff" "server") + "Command to start ruff lsp. +Previous ruff-lsp should change this to (\"ruff-lsp\")" :risky t :type '(repeat string) - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-ruff-path ["ruff"] +(defcustom lsp-ruff-ruff-path ["ruff"] "Paths to ruff to try, in order." :risky t :type 'lsp-string-vector - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-ruff-args [] +(defcustom lsp-ruff-ruff-args [] "Arguments, passed to ruff." :risky t :type 'lsp-string-vector - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-log-level "error" +(defcustom lsp-ruff-log-level "error" "Tracing level." :type '(choice (const "debug") (const "error") (const "info") (const "off") (const "warn")) - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-python-path "python3" +(defcustom lsp-ruff-python-path "python3" "Path to the Python interpreter." :risky t :type 'string - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-show-notifications "off" +(defcustom lsp-ruff-show-notifications "off" "When notifications are shown." :type '(choice (const "off") (const "onError") (const "onWarning") (const "always")) - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-advertize-organize-imports t +(defcustom lsp-ruff-advertize-organize-imports t "Whether to report ability to handle source.organizeImports actions." :type 'boolean - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-advertize-fix-all t +(defcustom lsp-ruff-advertize-fix-all t "Whether to report ability to handle source.fixAll actions." :type 'boolean - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) -(defcustom lsp-ruff-lsp-import-strategy "fromEnvironment" - "Where ruff is imported from if lsp-ruff-lsp-ruff-path is not set." +(defcustom lsp-ruff-import-strategy "fromEnvironment" + "Where ruff is imported from if lsp-ruff-ruff-path is not set." :type '(choice (const "fromEnvironment") (const "useBundled")) - :group 'lsp-ruff-lsp) + :group 'lsp-ruff) (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection - (lambda () lsp-ruff-lsp-server-command)) + (lambda () lsp-ruff-server-command)) :activation-fn (lsp-activate-on "python") - :server-id 'ruff-lsp + :server-id 'ruff :priority -2 :add-on? t :initialization-options (lambda () (list :settings - (list :args lsp-ruff-lsp-ruff-args - :logLevel lsp-ruff-lsp-log-level - :path lsp-ruff-lsp-ruff-path - :interpreter (vector lsp-ruff-lsp-python-path) - :showNotifications lsp-ruff-lsp-show-notifications - :organizeImports (lsp-json-bool lsp-ruff-lsp-advertize-organize-imports) - :fixAll (lsp-json-bool lsp-ruff-lsp-advertize-fix-all) - :importStrategy lsp-ruff-lsp-import-strategy))))) - -(lsp-consistency-check lsp-ruff-lsp) - -(provide 'lsp-ruff-lsp) -;;; lsp-ruff-lsp.el ends here + (list :args lsp-ruff-ruff-args + :logLevel lsp-ruff-log-level + :path lsp-ruff-ruff-path + :interpreter (vector lsp-ruff-python-path) + :showNotifications lsp-ruff-show-notifications + :organizeImports (lsp-json-bool lsp-ruff-advertize-organize-imports) + :fixAll (lsp-json-bool lsp-ruff-advertize-fix-all) + :importStrategy lsp-ruff-import-strategy))))) + +(lsp-consistency-check lsp-ruff) + +(provide 'lsp-ruff) +;;; lsp-ruff.el ends here diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index b3d88fef39..c619ec15d9 100644 --- a/docs/lsp-clients.json +++ b/docs/lsp-clients.json @@ -941,11 +941,11 @@ "debugger": "Not available" }, { - "name": "ruff-lsp", + "name": "ruff", "full-name": "Python", - "server-name": "ruff-lsp", - "server-url": "https://github.com/charliermarsh/ruff-lsp", - "installation": "pip install ruff-lsp", + "server-name": "ruff", + "server-url": "https://github.com/astral-sh/ruff", + "installation": "pip install ruff (previous pip install ruff-lsp)", "debugger": "Not available" }, { diff --git a/lsp-mode.el b/lsp-mode.el index 0ed4c219f4..7c9c824eb4 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -186,7 +186,7 @@ As defined by the Language Server Protocol 3.16." lsp-openscad lsp-pascal lsp-perl lsp-perlnavigator lsp-php lsp-pls lsp-purescript lsp-pwsh lsp-pyls lsp-pylsp lsp-pyright lsp-python-ms lsp-qml lsp-r lsp-racket lsp-remark lsp-rf lsp-roslyn lsp-rubocop lsp-ruby-lsp - lsp-ruby-syntax-tree lsp-ruff-lsp lsp-rust lsp-semgrep lsp-shader + lsp-ruby-syntax-tree lsp-ruff lsp-rust lsp-semgrep lsp-shader lsp-solargraph lsp-solidity lsp-sonarlint lsp-sorbet lsp-sourcekit lsp-sql lsp-sqls lsp-steep lsp-svelte lsp-tailwindcss lsp-terraform lsp-tex lsp-tilt lsp-toml lsp-trunk lsp-ttcn3 lsp-typeprof lsp-v diff --git a/mkdocs.yml b/mkdocs.yml index 6d6ba6ce60..98241d90bf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -138,7 +138,7 @@ nav: - Python (Palantir deprecated): page/lsp-pyls.md - Python (Pyright): https://emacs-lsp.github.io/lsp-pyright - Python (Microsoft): https://emacs-lsp.github.io/lsp-python-ms - - Python (Ruff): page/lsp-ruff-lsp.md + - Python (Ruff): page/lsp-ruff.md - QML: page/lsp-qml.md - R: page/lsp-r.md - Racket (jeapostrophe): page/lsp-racket-langserver.md From 561788352cd566558d303f72821c160295089839 Mon Sep 17 00:00:00 2001 From: Daisuke Nakahara <68811957+Daisuke897@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:05:57 +0900 Subject: [PATCH 14/17] Remove unsupported settings in `ruff server` (#4546) --- clients/lsp-ruff.el | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/clients/lsp-ruff.el b/clients/lsp-ruff.el index 96ddddba21..41122563b9 100644 --- a/clients/lsp-ruff.el +++ b/clients/lsp-ruff.el @@ -38,16 +38,10 @@ Previous ruff-lsp should change this to (\"ruff-lsp\")" :type '(repeat string) :group 'lsp-ruff) -(defcustom lsp-ruff-ruff-path ["ruff"] - "Paths to ruff to try, in order." - :risky t - :type 'lsp-string-vector - :group 'lsp-ruff) - -(defcustom lsp-ruff-ruff-args [] +(defcustom lsp-ruff-ruff-args '() "Arguments, passed to ruff." :risky t - :type 'lsp-string-vector + :type '(repeat string) :group 'lsp-ruff) (defcustom lsp-ruff-log-level "error" @@ -93,7 +87,7 @@ Previous ruff-lsp should change this to (\"ruff-lsp\")" (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection - (lambda () lsp-ruff-server-command)) + (lambda () (append lsp-ruff-server-command lsp-ruff-ruff-args))) :activation-fn (lsp-activate-on "python") :server-id 'ruff :priority -2 @@ -101,10 +95,7 @@ Previous ruff-lsp should change this to (\"ruff-lsp\")" :initialization-options (lambda () (list :settings - (list :args lsp-ruff-ruff-args - :logLevel lsp-ruff-log-level - :path lsp-ruff-ruff-path - :interpreter (vector lsp-ruff-python-path) + (list :logLevel lsp-ruff-log-level :showNotifications lsp-ruff-show-notifications :organizeImports (lsp-json-bool lsp-ruff-advertize-organize-imports) :fixAll (lsp-json-bool lsp-ruff-advertize-fix-all) From 710f2a212258bee0768239e359716a5ae8650fb2 Mon Sep 17 00:00:00 2001 From: Samuel Kyletoft <45131343+SKyletoft@users.noreply.github.com> Date: Sun, 22 Sep 2024 01:44:50 +0200 Subject: [PATCH 15/17] Add support for haskell-ts-mode (#4555) --- lsp-mode.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lsp-mode.el b/lsp-mode.el index 7c9c824eb4..92f97453de 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -871,6 +871,7 @@ Changes take effect only when a new session is started." (go-ts-mode . "go") (graphql-mode . "graphql") (haskell-mode . "haskell") + (haskell-ts-mode . "haskell") (hack-mode . "hack") (php-mode . "php") (php-ts-mode . "php") From 9222365ca4d88e149c31063a800b932afa2dae8b Mon Sep 17 00:00:00 2001 From: Samuel Kyletoft <45131343+SKyletoft@users.noreply.github.com> Date: Mon, 23 Sep 2024 03:43:01 +0200 Subject: [PATCH 16/17] Add basic support for futhark mode (#4556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add basic support for futhark mode * Remove duplicate adding to lsp-language-id-configuration * Add futhark addition to changelog * Add futhark to list of client-packages * Add futhark to docs list * Add documentation group for futhark * Add server installation docs for futhark * N/A → Not available --- CHANGELOG.org | 1 + clients/lsp-futhark.el | 42 ++++++++++++++++++++++++++++++++++++++++++ docs/lsp-clients.json | 8 ++++++++ lsp-mode.el | 5 +++-- mkdocs.yml | 1 + 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 clients/lsp-futhark.el diff --git a/CHANGELOG.org b/CHANGELOG.org index 202cfb4f60..eaabc1d1b1 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -11,6 +11,7 @@ * Add ~lsp-flush-delayed-changes-before-next-message~ customization point to enforce throttling document change notifications. * Fix bug in ~rust-analyzer.check.features~ configuration via ~lsp-rust-checkonsave-features~ Emacs setting: we were defaulting to ~[]~, but ~rust-analyzer~ defaults to inheriting the value from ~rust-analyzer.cargo.features~. The bug resulted in code hidden behind features not getting type checked when those features were enabled by setting ~rust-analyzer.cargo.features~ via the ~lsp-rust-features~ Emacs setting. * Change ~ruff-lsp~ to ~ruff~ for python lsp client. All ~ruff-lsp~ customizable variable change to ~ruff~. Lsp server command now is ~["ruff" "server"]~ instead of ~["ruff-lsp"]~. + * Add futhark support ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. diff --git a/clients/lsp-futhark.el b/clients/lsp-futhark.el new file mode 100644 index 0000000000..85d8aee093 --- /dev/null +++ b/clients/lsp-futhark.el @@ -0,0 +1,42 @@ +;;; lsp-futhark.el --- lsp-mode futhark integration -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 lsp-mode maintainers + +;; Keywords: languages + +;; 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: + +;; Client for the futhark language server. + +;;; Code: + +(require 'lsp-mode) + +(defgroup lsp-futhark nil + "LSP support for Futhark, using futhark lsp" + :group 'lsp-mode + :link '(url-link "https://github.com/diku-dk/futhark/tree/master/src/Futhark/LSP") + :package-version `(lsp-mode . "9.0.1")) + +(lsp-register-client + (make-lsp-client :new-connection (lsp-stdio-connection '("futhark" "lsp")) + :activation-fn (lsp-activate-on "futhark") + :server-id 'futhark)) + +(lsp-consistency-check lsp-futhark) + +(provide 'lsp-futhark) +;;; lsp-futhark.el ends here diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index c619ec15d9..2800cf5360 100644 --- a/docs/lsp-clients.json +++ b/docs/lsp-clients.json @@ -334,6 +334,14 @@ "installation": "pip install fortls", "debugger": "Yes" }, + { + "name": "futhark", + "full-name": "Futhark", + "server-name": "futhark-lsp", + "server-url": "https://github.com/diku-dk/futhark" + "installation": "A part of the compiler since 0.21.9", + "debugger": "Not available" + }, { "name": "gdscript", "full-name": "GDScript", diff --git a/lsp-mode.el b/lsp-mode.el index 92f97453de..59de08a2d6 100644 --- a/lsp-mode.el +++ b/lsp-mode.el @@ -177,8 +177,8 @@ As defined by the Language Server Protocol 3.16." lsp-autotools lsp-awk lsp-bash lsp-beancount lsp-bufls lsp-clangd lsp-clojure lsp-cmake lsp-cobol lsp-credo lsp-crystal lsp-csharp lsp-css lsp-cucumber lsp-cypher lsp-d lsp-dart lsp-dhall lsp-docker lsp-dockerfile - lsp-earthly lsp-elixir lsp-elm lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-fsharp - lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly + lsp-earthly lsp-elixir lsp-elm lsp-emmet lsp-erlang lsp-eslint lsp-fortran lsp-futhark + lsp-fsharp lsp-gdscript lsp-gleam lsp-glsl lsp-go lsp-golangci-lint lsp-grammarly lsp-graphql lsp-groovy lsp-hack lsp-haskell lsp-haxe lsp-idris lsp-java lsp-javascript lsp-jq lsp-json lsp-kotlin lsp-latex lsp-lisp lsp-ltex lsp-lua lsp-magik lsp-markdown lsp-marksman lsp-mdx lsp-meson lsp-metals lsp-mint @@ -893,6 +893,7 @@ Changes take effect only when a new session is started." (reason-mode . "reason") (caml-mode . "ocaml") (tuareg-mode . "ocaml") + (futhark-mode . "futhark") (swift-mode . "swift") (elixir-mode . "elixir") (elixir-ts-mode . "elixir") diff --git a/mkdocs.yml b/mkdocs.yml index 98241d90bf..6a80cea704 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -80,6 +80,7 @@ nav: - ESLint: page/lsp-eslint.md - F#: page/lsp-fsharp.md - Fortran: page/lsp-fortran.md + - Futhark: page/lsp-futhark.md - GDScript: page/lsp-gdscript.md - Gleam: page/lsp-gleam.md - GLSL: page/lsp-glsl.md From 4abe804c73cf87ba719f6637accabcd34d601a8e Mon Sep 17 00:00:00 2001 From: kiennq Date: Sun, 22 Sep 2024 22:01:51 -0700 Subject: [PATCH 17/17] lsp-roslyn: update to 4.12.0-3.24470.11 and fix stdpipe-path in Windows (#4558) --- clients/lsp-roslyn.el | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/clients/lsp-roslyn.el b/clients/lsp-roslyn.el index d849755536..59bc471731 100644 --- a/clients/lsp-roslyn.el +++ b/clients/lsp-roslyn.el @@ -32,9 +32,9 @@ :group 'lsp-mode :package-version '(lsp-mode . "8.0.0")) -(defvar lsp-roslyn--stdpipe-path (expand-file-name - "lsp-roslyn-stdpipe.ps1" - (file-name-directory (file-truename load-file-name))) +(defconst lsp-roslyn--stdpipe-path (expand-file-name + "lsp-roslyn-stdpipe.ps1" + (file-name-directory (locate-library "lsp-roslyn"))) "Path to the `stdpipe' script. On Windows, this script is used as a proxy for the language server's named pipe. Unused on other platforms.") @@ -81,8 +81,9 @@ Unused on other platforms.") :package-version '(lsp-mode . "8.0.0") :group 'lsp-roslyn) -(defcustom lsp-roslyn-package-version "4.9.0-3.23604.10" - "Version of the Roslyn package to install." +(defcustom lsp-roslyn-package-version "4.12.0-3.24470.11" + "Version of the Roslyn package to install. +Gotten from https://dev.azure.com/azure-public/vside/_artifacts/feed/vs-impl/NuGet/Microsoft.CodeAnalysis.LanguageServer.win-x64" :type 'string :package-version '(lsp-mode . "8.0.0") :group 'lsp-roslyn) @@ -265,9 +266,9 @@ Assumes it was installed with the server install function." (defun lsp-roslyn--get-rid () "Retrieves the .NET Runtime Identifier (RID) for the current system." - (let* ((is-x64 (string-match-p "x86_64" system-configuration)) + (let* ((is-x64 (string-match-p (rx (or "x86_64" "aarch64")) system-configuration)) (is-x86 (and (string-match-p "x86" system-configuration) (not is-x64))) - (is-arm (string-match-p "arm" system-configuration))) + (is-arm (string-match-p (rx (or "arm" "aarch")) system-configuration))) (if-let ((platform-name (cond ((eq system-type 'gnu/linux) "linux") ((eq system-type 'darwin) "osx") @@ -284,12 +285,8 @@ Assumes it was installed with the server install function." " - - + - - - " "The nuget.config to use when downloading Roslyn.") @@ -333,7 +330,7 @@ FORCED if specified with prefix argument." (lsp-async-start-process callback error-callback - lsp-roslyn-dotnet-executable "restore" lsp-roslyn-install-path + lsp-roslyn-dotnet-executable "restore" "--interactive" lsp-roslyn-install-path (format "/p:PackageName=%s" pkg-name) (format "/p:PackageVersion=%s" lsp-roslyn-package-version))))