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 1/4] 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 2/4] 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 3/4] 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 4/4] 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))))