-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Describe the bug
When using the Intellij native lsp diagnostics are not shown in the editor.
To Reproduce
Steps to reproduce the behavior:
- Turn on Intellij`s lsp client and use "ruff server"
- Open a python file which contains code that triggers a warning when using ruff check
Expected behavior
When ruff check reports an error I expect the same error to be shown in the ide.
Environments (please complete the following information):
- IDE: PyCharm 2025.1.2 (unified with commercial license)
- OS: Arch linux
- Ruff Version: 0.12.0
- Plugin version: 0.0.47
Additional context
I attempted to debug the issue myself and discovered that ruff server only does diagnostic push notifications to lsp clients that don't support pulling diagnostics. IntelliJ reports that it supports this but does in fact never pull diagnostics unless you override a "shouldAskServerForDiagnostics" in the class RuffLspDiagnosticsSupport. See https://youtrack.jetbrains.com/issue/IJPL-172853. By adding this override I have built a version of the plugin that works for me. This pulling feature was introduced in version 2025.1.2. I checked in version 2025.1.1.1 and it works without the override there as IntelliJ lsp does not claim to support pulling diagnostics in that version. I built a version of the plugin with the override and tried running it in 2025.1.2 and 2025.1.1 and in both places it seems to work fine, but I have never worked with IntelliJ plugins before so take it with a grain of salt. https://github.com/NikolaiES/ruff-pycharm-plugin/blob/05883079251bea97fd652e4df398a92ce536efa8/src/com/koxudaxi/ruff/lsp/intellij/supports/RuffLspDiagnosticsSupport.kt#L10