From e9900a3203125d0b773220cba6b4ebd57ce931fe Mon Sep 17 00:00:00 2001 From: ccQpein Date: Wed, 11 Sep 2024 00:02:41 -0400 Subject: [PATCH 1/5] update ruff-lsp to ruff --- clients/lsp-ruff-lsp.el | 5 +++-- docs/lsp-clients.json | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/clients/lsp-ruff-lsp.el b/clients/lsp-ruff-lsp.el index c95359d5c1..c31cfcb424 100644 --- a/clients/lsp-ruff-lsp.el +++ b/clients/lsp-ruff-lsp.el @@ -31,8 +31,9 @@ :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." +(defcustom lsp-ruff-lsp-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) 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" }, { From 20c67a38395f827bd55606d9e06e34e536092168 Mon Sep 17 00:00:00 2001 From: ccQpein Date: Sat, 14 Sep 2024 01:33:09 -0400 Subject: [PATCH 2/5] rename lsp-ruff-lsp to ruff-lsp --- clients/{lsp-ruff-lsp.el => lsp-ruff.el} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename clients/{lsp-ruff-lsp.el => lsp-ruff.el} (100%) diff --git a/clients/lsp-ruff-lsp.el b/clients/lsp-ruff.el similarity index 100% rename from clients/lsp-ruff-lsp.el rename to clients/lsp-ruff.el From 4d66452d437ab706be80187bf20f2af2c79e7d08 Mon Sep 17 00:00:00 2001 From: ccQpein Date: Sat, 14 Sep 2024 01:45:02 -0400 Subject: [PATCH 3/5] change custom var and some crumbs of ruff-lsp to ruff --- clients/lsp-ruff.el | 78 ++++++++++++++++++++++----------------------- mkdocs.yml | 2 +- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/clients/lsp-ruff.el b/clients/lsp-ruff.el index c31cfcb424..96ddddba21 100644 --- a/clients/lsp-ruff.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,97 +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" "server") +(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/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 6195e592f1dbac51c017465ae34aa639dac1231a Mon Sep 17 00:00:00 2001 From: ccQpein Date: Sat, 14 Sep 2024 01:57:52 -0400 Subject: [PATCH 4/5] change log --- CHANGELOG.org | 1 + 1 file changed, 1 insertion(+) 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. From f336d23ba714867c930b13a1af113ed6777234f6 Mon Sep 17 00:00:00 2001 From: ccQpein Date: Sat, 14 Sep 2024 02:17:02 -0400 Subject: [PATCH 5/5] tiny change --- lsp-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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