diff --git a/CHANGELOG.org b/CHANGELOG.org index ac3b5fe39fb..b847e60a561 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -8,8 +8,13 @@ * 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. + * 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 * Optimize overlay creation by checking window visibility first + ** 9.0.0 * Add language server config for QML (Qt Modeling Language) using qmlls. * Add new configuration options for lsp-html. Now able to toggle documentation hovers. Custom data is no longer experimental, and is now a vector. diff --git a/clients/lsp-futhark.el b/clients/lsp-futhark.el new file mode 100644 index 00000000000..85d8aee0936 --- /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/clients/lsp-magik.el b/clients/lsp-magik.el index 77c9c7e9855..fb2edb663f9 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.1" "Version of LSP server." :type `string :group `lsp-magik @@ -58,53 +58,89 @@ :group `lsp-magik :package-version '(lsp-mode . "9.0.0")) -(defcustom lsp-magik-smallworld-gis nil - "Path to Smallworld Core." +(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-libs-dirs [] - "Paths to libs dirs of Smallworld products." +(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-atom-inlay-hints nil - "Show atom type inlay hints." +(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-usages t - "Enable indexing of usages of globals/methods/slots/conditions by methods." +(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") + +(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.1") + :lsp-path "magik.typing.indexMethodUsages") + +(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.1") + :lsp-path "magik.typing.indexSlotUsages") + +(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.1") + :lsp-path "magik.typing.indexConditionUsages") + +(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.1") + :lsp-path "magik.typing.cacheIndexedDefinitions") (defcustom lsp-magik-java-path (lambda () (cond ((eq system-type 'windows-nt) @@ -114,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 @@ -133,16 +169,6 @@ (lsp--set-configuration (lsp-configuration-section "magik")))) :server-id 'magik)) -(lsp-register-custom-settings - `(("magik.smallworldGis" lsp-magik-smallworld-gis) - ("magik.libsDirs" lsp-magik-libs-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.showArgumentInlayHints" lsp-magik-typing-show-argument-inlay-hints) - ("magik.typing.enableChecks" lsp-magik-typing-enable-checks) - ("magik.typing.indexUsages" lsp-magik-typing-index-usages))) - (lsp-consistency-check lsp-magik) (provide 'lsp-magik) diff --git a/clients/lsp-nix.el b/clients/lsp-nix.el index 19d847f5c6e..b50b40c6595 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/clients/lsp-roslyn.el b/clients/lsp-roslyn.el index d849755536c..59bc4717315 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)))) diff --git a/clients/lsp-ruby-lsp.el b/clients/lsp-ruby-lsp.el index e6039dafd76..3127169fe56 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) diff --git a/clients/lsp-ruff-lsp.el b/clients/lsp-ruff-lsp.el deleted file mode 100644 index c95359d5c18..00000000000 --- a/clients/lsp-ruff-lsp.el +++ /dev/null @@ -1,115 +0,0 @@ -;;; lsp-ruff-lsp.el --- ruff-lsp support -*- lexical-binding: t; -*- - -;; Copyright (C) 2023 Freja Nordsiek -;; -;; Author: Freja Nordsiek . - -;;; Commentary: - -;; 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." - :group 'lsp-mode - :link '(url-link "https://github.com/charliermarsh/ruff-lsp")) - -(defcustom lsp-ruff-lsp-server-command '("ruff-lsp") - "Command to start ruff-lsp." - :risky t - :type '(repeat string) - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-ruff-path ["ruff"] - "Paths to ruff to try, in order." - :risky t - :type 'lsp-string-vector - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-ruff-args [] - "Arguments, passed to ruff." - :risky t - :type 'lsp-string-vector - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-log-level "error" - "Tracing level." - :type '(choice (const "debug") - (const "error") - (const "info") - (const "off") - (const "warn")) - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-python-path "python3" - "Path to the Python interpreter." - :risky t - :type 'string - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-show-notifications "off" - "When notifications are shown." - :type '(choice (const "off") - (const "onError") - (const "onWarning") - (const "always")) - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-advertize-organize-imports t - "Whether to report ability to handle source.organizeImports actions." - :type 'boolean - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-advertize-fix-all t - "Whether to report ability to handle source.fixAll actions." - :type 'boolean - :group 'lsp-ruff-lsp) - -(defcustom lsp-ruff-lsp-import-strategy "fromEnvironment" - "Where ruff is imported from if lsp-ruff-lsp-ruff-path is not set." - :type '(choice (const "fromEnvironment") - (const "useBundled")) - :group 'lsp-ruff-lsp) - - -(lsp-register-client - (make-lsp-client - :new-connection (lsp-stdio-connection - (lambda () lsp-ruff-lsp-server-command)) - :activation-fn (lsp-activate-on "python") - :server-id 'ruff-lsp - :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 diff --git a/clients/lsp-ruff.el b/clients/lsp-ruff.el new file mode 100644 index 00000000000..41122563b99 --- /dev/null +++ b/clients/lsp-ruff.el @@ -0,0 +1,107 @@ +;;; lsp-ruff.el --- ruff lsp support -*- lexical-binding: t; -*- + +;; Copyright (C) 2023 Freja Nordsiek +;; +;; Author: Freja Nordsiek . + +;;; Commentary: + +;; ruff LSP Client for the Python programming language + +;;; Code: + +(require 'lsp-mode) + +(defgroup lsp-ruff nil + "LSP support for Python, using ruff's Python Language Server." + :group 'lsp-mode + :link '(url-link "https://github.com/astral-sh/ruff")) + +(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) + +(defcustom lsp-ruff-ruff-args '() + "Arguments, passed to ruff." + :risky t + :type '(repeat string) + :group 'lsp-ruff) + +(defcustom lsp-ruff-log-level "error" + "Tracing level." + :type '(choice (const "debug") + (const "error") + (const "info") + (const "off") + (const "warn")) + :group 'lsp-ruff) + +(defcustom lsp-ruff-python-path "python3" + "Path to the Python interpreter." + :risky t + :type 'string + :group 'lsp-ruff) + +(defcustom lsp-ruff-show-notifications "off" + "When notifications are shown." + :type '(choice (const "off") + (const "onError") + (const "onWarning") + (const "always")) + :group 'lsp-ruff) + +(defcustom lsp-ruff-advertize-organize-imports t + "Whether to report ability to handle source.organizeImports actions." + :type 'boolean + :group 'lsp-ruff) + +(defcustom lsp-ruff-advertize-fix-all t + "Whether to report ability to handle source.fixAll actions." + :type 'boolean + :group 'lsp-ruff) + +(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-register-client + (make-lsp-client + :new-connection (lsp-stdio-connection + (lambda () (append lsp-ruff-server-command lsp-ruff-ruff-args))) + :activation-fn (lsp-activate-on "python") + :server-id 'ruff + :priority -2 + :add-on? t + :initialization-options + (lambda () + (list :settings + (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) + :importStrategy lsp-ruff-import-strategy))))) + +(lsp-consistency-check lsp-ruff) + +(provide 'lsp-ruff) +;;; lsp-ruff.el ends here diff --git a/clients/lsp-rust.el b/clients/lsp-rust.el index 5b003747474..48c17181fd1 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)) @@ -1761,7 +1779,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)))) diff --git a/clients/lsp-sqls.el b/clients/lsp-sqls.el index e60f69b7b4d..7ea5ae6f5d1 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/clients/lsp-tex.el b/clients/lsp-tex.el index ca6f475837e..31c47016862 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)) diff --git a/clients/lsp-yaml.el b/clients/lsp-yaml.el index 24db7e511eb..376cac7bae8 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." diff --git a/docs/lsp-clients.json b/docs/lsp-clients.json index b87170014bd..2800cf53601 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", @@ -941,11 +949,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" }, { @@ -1029,8 +1037,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" }, { diff --git a/docs/manual-language-docs/lsp-sqls.md b/docs/manual-language-docs/lsp-sqls.md index b8b2b6c410d..54f7f5474a1 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`). diff --git a/lsp-mode.el b/lsp-mode.el index 5b75421dbb9..19600a78a3a 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 @@ -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 @@ -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") @@ -892,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") @@ -938,7 +940,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") @@ -6743,13 +6745,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)) diff --git a/mkdocs.yml b/mkdocs.yml index 6d6ba6ce60a..6a80cea7040 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 @@ -138,7 +139,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