Skip to content

Commit

Permalink
Merge branch 'master' into add-jq-lsp
Browse files Browse the repository at this point in the history
* master: (27 commits)
  Rename blacklist to blocklist (emacs-lsp#4173)
  Introduce a function to disable a call for particular method for a server (emacs-lsp#4171)
  Fix `lsp-completion--company-match` freezing emacs-lsp#4192 (emacs-lsp#4193)
  Bump the magik language server to 0.8.1 (emacs-lsp#4195)
  Add configuration to use new experimental ondisk cache for lsp-kotlin (emacs-lsp#4138)
  lsp-erlang: add setting for types on hover (emacs-lsp#4188)
  Make it possible to override lsp-cmake server command (emacs-lsp#4182)
  lsp-erlang: update erlang-language-platform download file names (emacs-lsp#4187)
  clojure: add paredit refactorings
  Fix typo in php-guide.md (emacs-lsp#4183)
  Bump magik language server to 0.8.0 (emacs-lsp#4176)
  Bump elixir-ls version (emacs-lsp#4178)
  Remove unbalanced parenthesis and double-quote in comments (emacs-lsp#4177)
  MDX support (emacs-lsp#4141)
  lsp-erlang: Add semantic token support for erlang-language-platform (emacs-lsp#4166)
  lsp-mode: Fix sending shutdown message (emacs-lsp#4167)
  lsp-erlang: update ELP download file names (emacs-lsp#4165)
  Add Move language client (emacs-lsp#4155)
  Add support for python-lsp-server pyls-isort plugin. (emacs-lsp#4163)
  Updating Crystal LSP (emacs-lsp#4156)
  ...
  • Loading branch information
nverno committed Oct 16, 2023
2 parents 07841f9 + 7c48025 commit ce67db4
Show file tree
Hide file tree
Showing 25 changed files with 539 additions and 77 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
* Changelog
** Unreleased 8.0.1
* Add [[https://github.com/wader/jq-lsp][jq-lsp]]
* Add architecture triples for [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] file downloads, to support macos on ARM and X86.
* Add semantic token support for [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] in lsp-erlang client.
* Update [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] download file names to match new upstream names.
* Add [[https://github.com/WhatsApp/erlang-language-platform][erlang-language-platform]] support in lsp-erlang client.
* Add [[https://github.com/elixir-tools/credo-language-server][credo-language-server]]
* Add support for clojure-ts-mode in clojure-lsp client
Expand Down Expand Up @@ -85,6 +87,9 @@
* Add AWK language server support.
* Add support for ~scala-ts-mode~.
* Drop support for emacs 26.3
* Add [https://github.com/rubocop/rubocop][RuboCop built-in language server]] for linting and formatting Ruby code.
* Add Move language server support.
* Add mdx support using [[https://github.com/mdx-js/mdx-analyzer/tree/main/packages/language-server][mdx-language-server]]
** Release 8.0.0
* Add ~lsp-clients-angular-node-get-prefix-command~ to get the Angular server from another location which is still has ~/lib/node_modules~ in it.
* Set ~lsp-clients-angular-language-server-command~ after the first connection to speed up subsequent connections.
Expand Down Expand Up @@ -342,7 +347,7 @@
- introduced new command ~lsp-describe-session~ which replaces the existing one ~lsp-capabilities~. The command lists the folders that are part of the workspace and the servers that are associated with the corresponding folder.
- ~lsp-mode~ displays information about the running server and it's status in the modeline.
- ~lsp-define-stdio-client~ and ~lsp-define-tcp-client~ are replaced with ~lsp-register-client~
- ~lsp~ rely on ~projectile~ or ~project.el~ now only for suggesting project root. Once you open new file in a project and start ~lsp~ it will provide several options(import project, blacklist project, select other directory root). Once you select a root it will be persisted and used for the next sessions.
- ~lsp~ rely on ~projectile~ or ~project.el~ now only for suggesting project root. Once you open new file in a project and start ~lsp~ it will provide several options(import project, blocklist project, select other directory root). Once you select a root it will be persisted and used for the next sessions.
- support for multiple language servers per single file and workspace.
- changed ~lsp-mode~ settings to more sensible defaults.
- Removed all synchronous calls from the server startup.
Expand Down
21 changes: 7 additions & 14 deletions clients/lsp-beancount.el
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,17 @@
:link '(url-link "https://github.com/polarmutex/beancount-language-server")
:package-version '(lsp-mode . "8.0.0"))

(defcustom lsp-beancount-langserver-executable "beancount-langserver"
(defcustom lsp-beancount-langserver-executable "beancount-language-server"
"Command to start Beancount language server."
:type 'string
:group 'lsp-beancount
:package-version '(lsp-mode . "8.0.0"))

(defcustom lsp-beancount-python-interpreter nil
"Path to Python executable."
:type 'string
:group 'lsp-beancount
:package-version '(lsp-mode . "8.0.0"))

(defcustom lsp-beancount-journal-file nil
"Pathg to Beancount journal file."
"Path to Beancount journal file.
The path can be absolute, or relative to the currently opened file.
Use nil (the default) to use the current beancount buffer as the journal file."
:type 'string
:group 'lsp-beancount
:package-version '(lsp-mode . "8.0.0"))
Expand All @@ -55,14 +52,10 @@
:new-connection
(lsp-stdio-connection
(lambda ()
(when (null lsp-beancount-python-interpreter)
(setq lsp-beancount-python-interpreter (or (executable-find "python3")
(executable-find "python"))))
`(,lsp-beancount-langserver-executable "--stdio")))
`(,lsp-beancount-langserver-executable "--stdio")))
:major-modes '(beancount-mode)
:initialization-options
`((journalFile . ,lsp-beancount-journal-file)
(pythonPath . ,lsp-beancount-python-interpreter))
`((journalFile . ,lsp-beancount-journal-file))
:server-id 'beancount-ls))

(lsp-consistency-check lsp-beancount)
Expand Down
3 changes: 3 additions & 0 deletions clients/lsp-clangd.el
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ number of newlines."
"Show clang-tidy documentation about ERROR-ID.
Information comes from the clang.llvm.org website."
;; Example error-id: modernize-loop-convert
;; Example url: https://clang.llvm.org/extra/clang-tidy/checks/modernize/loop-convert.html
(setq error-id (s-join "/" (s-split-up-to "-" error-id 1 t)))
(url-retrieve (format
"https://clang.llvm.org/extra/clang-tidy/checks/%s.html" error-id)
(lambda (status)
Expand Down
20 changes: 20 additions & 0 deletions clients/lsp-clojure.el
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,26 @@ If there are more arguments expected after the line and column numbers."
(interactive)
(lsp-clojure--refactoring-call "move-coll-entry-down"))

(defun lsp-clojure-forward-slurp ()
"Apply forward slurp refactoring at point."
(interactive)
(lsp-clojure--refactoring-call "forward-slurp"))

(defun lsp-clojure-forward-barf ()
"Apply forward barf refactoring at point."
(interactive)
(lsp-clojure--refactoring-call "forward-barf"))

(defun lsp-clojure-backward-slurp ()
"Apply backward slurp refactoring at point."
(interactive)
(lsp-clojure--refactoring-call "backward-slurp"))

(defun lsp-clojure-backward-barf ()
"Apply backward slurp refactoring at point."
(interactive)
(lsp-clojure--refactoring-call "backward-barf"))

(defun lsp-clojure-move-form (dest-filename)
"Apply move-form refactoring at point to DEST-FILENAME."
(interactive
Expand Down
10 changes: 9 additions & 1 deletion clients/lsp-cmake.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,16 @@
:group 'lsp-mode
:link '(url-link "https://github.com/regen100/cmake-language-server"))

(defcustom lsp-cmake-server-command "cmake-language-server"
"The binary (or full path to binary) which executes the server."
:type 'string
:group 'lsp-cmake
:package-version '(lsp-mode . "8.0.1"))

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "cmake-language-server")
(make-lsp-client :new-connection (lsp-stdio-connection
(lambda ()
lsp-cmake-server-command))
:activation-fn (lsp-activate-on "cmake")
:priority -1
:server-id 'cmakels))
Expand Down
14 changes: 7 additions & 7 deletions clients/lsp-crystal.el
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@

(require 'lsp-mode)

(defgroup lsp-scry nil
"LSP support for Crystal via scry."
(defgroup lsp-crystalline nil
"LSP support for Crystal via crystalline."
:group 'lsp-mode
:link '(url-link "https://github.com/crystal-lang-tools/scry"))
:link '(url-link "https://github.com/elbywan/crystalline"))

(defcustom lsp-clients-crystal-executable '("scry" "--stdio")
"Command to start the scry language server."
:group 'lsp-scry
(defcustom lsp-clients-crystal-executable '("crystalline" "--stdio")
"Command to start the crystalline language server."
:group 'lsp-crystalline
:risky t
:type 'file)

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection lsp-clients-crystal-executable)
:major-modes '(crystal-mode)
:server-id 'scry))
:server-id 'crystalline))

(lsp-consistency-check lsp-crystal)

Expand Down
4 changes: 2 additions & 2 deletions clients/lsp-elixir.el
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Leave as default to let `executable-find' search for it."
:type '(repeat string)
:package-version '(lsp-mode . "8.0.0"))

(defcustom lsp-elixir-ls-version "v0.14.6"
(defcustom lsp-elixir-ls-version "v0.16.0"
"Elixir-Ls version to download.
It has to be set before `lsp-elixir.el' is loaded and it has to
be available here: https://github.com/elixir-lsp/elixir-ls/releases/"
Expand All @@ -114,7 +114,7 @@ be available here: https://github.com/elixir-lsp/elixir-ls/releases/"
:package-version '(lsp-mode . "8.0.1"))

(defcustom lsp-elixir-ls-download-url
(format "https://github.com/elixir-lsp/elixir-ls/releases/download/%s/elixir-ls.zip"
(format "https://github.com/elixir-lsp/elixir-ls/releases/download/%1$s/elixir-ls-%1$s.zip"
lsp-elixir-ls-version)
"Automatic download url for elixir-ls"
:type 'string
Expand Down
79 changes: 76 additions & 3 deletions clients/lsp-erlang.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
;;; Code:

(require 'lsp-mode)
(require 'lsp-semantic-tokens)

(defgroup lsp-erlang nil
"LSP support for the Erlang programming language.
Expand All @@ -41,6 +42,12 @@ It can use erlang-ls or erlang-language-platform (ELP)."
:group 'lsp-mode
:link '(url-link "https://github.com/WhatsApp/erlang-language-platform"))

(defgroup lsp-erlang-elp-semantic-tokens nil
"LSP semantic tokens support for ELP."
:group 'lsp-erlang-elp
:link '(url-link "https://github.com/WhatsApp/erlang-language-platform")
:package-version '(lsp-mode . "8.0.1"))

(defcustom lsp-erlang-server 'erlang-ls
"Choose LSP server."
:type '(choice (const :tag "erlang-ls" erlang-ls)
Expand Down Expand Up @@ -85,6 +92,13 @@ It can use erlang-ls or erlang-language-platform (ELP)."

;; erlang-language-platform

(lsp-defcustom lsp-erlang-elp-types-on-hover t
"Show eqWAlizer types on hover."
:type 'boolean
:group 'lsp-erlang-elp
:package-version '(lsp-mode . "8.0.1")
:lsp-path "elp.typesOnHover.enable")

(defcustom lsp-erlang-elp-server-command '("elp" "server")
"Command to start erlang-language-platform."
:type '(repeat string)
Expand All @@ -94,8 +108,11 @@ It can use erlang-ls or erlang-language-platform (ELP)."
(defcustom lsp-erlang-elp-download-url
(format "https://github.com/WhatsApp/erlang-language-platform/releases/latest/download/%s"
(pcase system-type
('gnu/linux "elp-linux.tar.gz")
('darwin "elp-macos.tar.gz")))
('gnu/linux "elp-linux-x86_64-unknown-linux-gnu-otp-26.tar.gz")
('darwin
(if (string-match "^aarch64-.*" system-configuration)
"elp-macos-aarch64-apple-darwin-otp-25.3.tar.gz"
"elp-macos-x86_64-apple-darwin-otp-25.3.tar.gz"))))
"Automatic download url for erlang-language-platform."
:type 'string
:group 'lsp-erlang-elp
Expand All @@ -119,6 +136,59 @@ It can use erlang-ls or erlang-language-platform (ELP)."
:set-executable? t)
'(:system "elp"))

;; Semantic tokens

;; Modifier faces

(defface lsp-erlang-elp-bound-modifier-face
'((t :underline t))
"The face modification to use for bound variables in patterns."
:group 'lsp-erlang-elp-semantic-tokens)

(defface lsp-erlang-elp-exported-function-modifier-face
'((t :underline t))
"The face modification to use for exported functions."
:group 'lsp-erlang-elp-semantic-tokens)

(defface lsp-erlang-elp-deprecated-function-modifier-face
'((t :strike-through t))
"The face modification to use for deprecated functions."
:group 'lsp-erlang-elp-semantic-tokens)


;; ---------------------------------------------------------------------
;; Semantic token modifier face customization

(defcustom lsp-erlang-elp-bound-modifier 'lsp-erlang-elp-bound-modifier-face
"Face for semantic token modifier for `bound' attribute."
:type 'face
:group 'lsp-erlang-elp-semantic-tokens
:package-version '(lsp-mode . "8.0.1"))

(defcustom lsp-erlang-elp-exported-function-modifier 'lsp-erlang-elp-exported-function-modifier-face
"Face for semantic token modifier for `exported_function' attribute."
:type 'face
:group 'lsp-erlang-elp-semantic-tokens
:package-version '(lsp-mode . "8.0.1"))

(defcustom lsp-erlang-elp-deprecated-function-modifier 'lsp-erlang-elp-deprecated-function-modifier-face
"Face for semantic token modifier for `deprecated_function' attribute."
:type 'face
:group 'lsp-erlang-elp-semantic-tokens
:package-version '(lsp-mode . "8.0.1"))

;; ---------------------------------------------------------------------

(defun lsp-erlang-elp--semantic-modifiers ()
"Mapping between rust-analyzer keywords and fonts to apply.
The keywords are sent in the initialize response, in the semantic
tokens legend."
`(
("bound" . ,lsp-erlang-elp-bound-modifier)
("exported_function" . ,lsp-erlang-elp-exported-function-modifier)
("deprecated_function" . ,lsp-erlang-elp-deprecated-function-modifier)))

;; ---------------------------------------------------------------------
;; Client

(lsp-register-client
Expand All @@ -131,7 +201,10 @@ It can use erlang-ls or erlang-language-platform (ELP)."
"elp")
,@(cl-rest lsp-erlang-elp-server-command))))
:activation-fn (lsp-activate-on "erlang")
:priority (if (eq lsp-erlang-server 'erlang-language-platform) 1 -1)
:priority (if (eq lsp-erlang-server 'erlang-language-platform) 1 -2)
:semantic-tokens-faces-overrides `(:discard-default-modifiers t
:modifiers
,(lsp-erlang-elp--semantic-modifiers))
:server-id 'elp
:custom-capabilities `((experimental . ((snippetTextEdit . ,(and lsp-enable-snippet (featurep 'yasnippet))))))
:download-server-fn (lambda (_client callback error-callback _update?)
Expand Down
4 changes: 2 additions & 2 deletions clients/lsp-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

(defun lsp-typescript-javascript-tsx-jsx-activate-p (filename &optional _)
"Check if the js-ts lsp server should be enabled based on FILENAME."
(or (string-match-p "\\.mjs\\|\\.[jt]sx?\\'" filename)
(and (derived-mode-p 'js-mode 'typescript-mode 'typescript-ts-mode)
(or (string-match-p "\\.[cm]js\\|\\.[jt]sx?\\'" filename)
(and (derived-mode-p 'js-mode 'js-ts-mode 'typescript-mode 'typescript-ts-mode)
(not (derived-mode-p 'json-mode)))))

;; Unmaintained sourcegraph server
Expand Down
15 changes: 15 additions & 0 deletions clients/lsp-kotlin.el
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ to Kotlin."
:group 'lsp-kotlin
:package-version '(lsp-mode . "8.0.1"))

;; cache in this case is the dependency cache. Given as an initialization option.
(defcustom lsp-kotlin-ondisk-cache-path nil
"Path to the ondisk cache if used. If lsp-kotlin-ondisk-cache-enabled is t, but path is nil, then the project root is used as a default."
:type 'string
:group 'lsp-kotlin)

(defcustom lsp-kotlin-ondisk-cache-enabled nil
"Specifies whether to enable ondisk cache or not. If nil, in-memory cache will be used."
:type 'boolean
:group 'lsp-kotlin)

(lsp-register-custom-settings
'(("kotlin.externalSources.autoConvertToKotlin" lsp-kotlin-external-sources-auto-convert-to-kotlin t)
("kotlin.externalSources.useKlsScheme" lsp-kotlin-external-sources-use-kls-scheme t)
Expand Down Expand Up @@ -260,6 +271,10 @@ to Kotlin."
:initialized-fn (lambda (workspace)
(with-lsp-workspace workspace
(lsp--set-configuration (lsp-configuration-section "kotlin"))))
:initialization-options (lambda ()
(when lsp-kotlin-ondisk-cache-enabled
(list :storagePath (or lsp-kotlin-ondisk-cache-path
(lsp-workspace-root)))))
:download-server-fn (lambda (_client callback error-callback _update?)
(lsp-package-ensure 'kotlin-language-server callback error-callback))))

Expand Down
11 changes: 7 additions & 4 deletions clients/lsp-magik.el
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
:tag "Lsp Magik"
:package-version '(lsp-mode . "8.0.1"))

(defcustom lsp-magik-version "0.7.1"
(defcustom lsp-magik-version "0.8.1"
"Version of LSP server."
:type `string
:group `lsp-magik
Expand Down Expand Up @@ -88,8 +88,11 @@
:group `lsp-magik
:package-version '(lsp-mode . "8.0.1"))

(defcustom lsp-magik-java-path (cond ((eq system-type 'windows-nt) "$JAVA_HOME/bin/java")
(t "java"))
(defcustom lsp-magik-java-path (lambda ()
(cond ((eq system-type 'windows-nt)
(or (lsp-resolve-value (executable-find (expand-file-name "bin/java" (getenv "JAVA_HOME"))))
(lsp-resolve-value (executable-find "java"))))
(t "java")))
"Path of the java executable."
:type 'string
:group `lsp-magik
Expand All @@ -108,7 +111,7 @@
:new-connection (lsp-stdio-connection
(lambda ()
(list
(substitute-in-file-name lsp-magik-java-path)
(substitute-in-file-name (lsp-resolve-value lsp-magik-java-path))
"-jar"
(substitute-in-file-name lsp-magik-ls-path)
"--debug")))
Expand Down
Loading

0 comments on commit ce67db4

Please sign in to comment.