GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Quick fixes and autoformat do not work from emacs · Issue #110 · python-lsp/python-lsp-ruff

Quick fixes and autoformat do not work from emacs #110

New issue
Copy link
New issue
Copy link
Open
Open
Quick fixes and autoformat do not work from emacs#110
Copy link

Description

@rjekker
rjekker
opened on Dec 11, 2025
Issue body actions

When using python-lsp-ruff from emacs with eglot, most things work fine, including autocomplete, linting, jump to definition. Two things do not work at all, though: auto-formatting and quick fixes. Those do work when I use the ruff server, so they are supported by eglot/emacs.

I use the following config in emacs:

  (with-eval-after-load 'eglot
    (add-to-list 'eglot-server-programs
                 '(python-base-mode . ("pylsp" :initializationOptions
  (:pylsp (:plugins (:ruff
                     (:enabled t
                      :formatEnabled t))))))))

Below is a log of a short session where I try to format and ask for fixes.

----- Start log ----
[jsonrpc] D[00:18:10.925] Running language server: pylsp
[jsonrpc] e[00:18:10.925] --> initialize[1] {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"processId":83283,"clientInfo":{"name":"Eglot","version":"1.17.30"},"rootPath":"/tmp/test/","rootUri":"file:///private/tmp/test","initializationOptions":{"pylsp":{"plugins":{"ruff":{"enabled":true,"formatEnabled":true}}}},"capabilities":{"workspace":{"applyEdit":true,"executeCommand":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":false},"configuration":true,"workspaceFolders":true},"textDocument":{"synchronization":{"dynamicRegistration":false,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":false,"completionItem":{"snippetSupport":true,"deprecatedSupport":true,"resolveSupport":{"properties":["documentation","details","additionalTextEdits"]},"tagSupport":{"valueSet":[1]}},"contextSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true},"documentationFormat":["markdown","plaintext"],"activeParameterSupport":true}},"references":{"dynamicRegistration":false},"definition":{"dynamicRegistration":false,"linkSupport":true},"declaration":{"dynamicRegistration":false,"linkSupport":true},"implementation":{"dynamicRegistration":false,"linkSupport":true},"typeDefinition":{"dynamicRegistration":false,"linkSupport":true},"documentSymbol":{"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"documentHighlight":{"dynamicRegistration":false},"codeAction":{"dynamicRegistration":false,"resolveSupport":{"properties":["edit","command"]},"dataSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"isPreferredSupport":true},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false,"codeDescriptionSupport":false,"tagSupport":{"valueSet":[1,2]}}},"window":{"showDocument":{"support":true},"workDoneProgress":true},"general":{"positionEncodings":["utf-32","utf-8","utf-16"]},"experimental":{}},"workspaceFolders":[{"uri":"file:///private/tmp/test","name":"/tmp/test/"}]}}
[jsonrpc] e[00:18:11.430] <-- initialize[1] {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"codeActionProvider":true,"codeLensProvider":{"resolveProvider":false},"completionProvider":{"resolveProvider":true,"triggerCharacters":["."]},"documentFormattingProvider":true,"documentHighlightProvider":true,"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"definitionProvider":true,"typeDefinitionProvider":true,"executeCommandProvider":{"commands":[]},"hoverProvider":true,"referencesProvider":true,"renameProvider":true,"foldingRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",",","="]},"textDocumentSync":{"change":2,"save":{"includeText":true},"openClose":true},"notebookDocumentSync":{"notebookSelector":[{"cells":[{"language":"python"}]}]},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}},"experimental":{}},"serverInfo":{"name":"pylsp","version":"1.14.0"}}}
[jsonrpc] e[00:18:11.430] --> initialized {"jsonrpc":"2.0","method":"initialized","params":{}}
[jsonrpc] e[00:18:11.431] --> textDocument/didOpen {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///private/tmp/test/test.py","version":0,"languageId":"python-base","text":"import sys\n\nprint(sys.argv )\n"}}}
[jsonrpc] e[00:18:11.431] --> workspace/didChangeConfiguration {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
[jsonrpc] e[00:18:11.943] <-- textDocument/publishDiagnostics {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///private/tmp/test/test.py","diagnostics":[]}}
[jsonrpc] e[00:18:16.700] --> textDocument/hover[2] {"jsonrpc":"2.0","id":2,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///private/tmp/test/test.py"},"position":{"line":1,"character":0}}}
[jsonrpc] e[00:18:16.700] --> textDocument/documentHighlight[3] {"jsonrpc":"2.0","id":3,"method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///private/tmp/test/test.py"},"position":{"line":1,"character":0}}}
[jsonrpc] e[00:18:16.700] --> textDocument/signatureHelp[4] {"jsonrpc":"2.0","id":4,"method":"textDocument/signatureHelp","params":{"textDocument":{"uri":"file:///private/tmp/test/test.py"},"position":{"line":1,"character":0}}}
[jsonrpc] e[00:18:16.795] <-- textDocument/hover[2] {"jsonrpc":"2.0","id":2,"result":{"contents":""}}
[jsonrpc] e[00:18:16.820] <-- textDocument/documentHighlight[3] {"jsonrpc":"2.0","id":3,"result":null}
[jsonrpc] e[00:18:16.820] <-- textDocument/signatureHelp[4] {"jsonrpc":"2.0","id":4,"result":{"signatures":[]}}
[jsonrpc] e[00:18:19.194] --> textDocument/formatting[5] {"jsonrpc":"2.0","id":5,"method":"textDocument/formatting","params":{"textDocument":{"uri":"file:///private/tmp/test/test.py"},"options":{"tabSize":8,"insertSpaces":true,"insertFinalNewline":true,"trimFinalNewlines":true}}}
[jsonrpc] e[00:18:19.195] <-- textDocument/formatting[5] {"jsonrpc":"2.0","id":5,"result":null}
[jsonrpc] e[00:18:44.840] --> textDocument/codeAction[6] {"jsonrpc":"2.0","id":6,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///private/tmp/test/test.py"},"range":{"start":{"line":1,"character":0},"end":{"line":1,"character":0}},"context":{"diagnostics":[]}}}
[jsonrpc] e[00:18:44.841] <-- textDocument/codeAction[6] {"jsonrpc":"2.0","id":6,"result":[]}

Activity

  1. jhossbach commented on Dec 26, 2025

    @jhossbach
    jhossbach
    on Dec 26, 2025
    Member
    More actions

    Hey, can you provide also provide the pylsp logs? I am not sure how to achieve this with eglot but the README shows how to achieve this in vim:
    https://github.com/python-lsp/python-lsp-ruff?tab=readme-ov-file#debugging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.