Closed jfcherng closed 5 months ago
I just did a fresh install of sublime text and installed LSP-ruff (v1.1) from April 19, 2024 - and ruff is not working for me :(
These are the versions of the libraries installed: Name: ruff-lsp - Version: 0.0.54 Name: ruff - Version: 0.5.0
How do I fix this directly? Do I have to wait for the merge? Thanks!
Name: ruff-lsp - Version: 0.0.54 Name: ruff - Version: 0.5.0
Your combination should work. I don't know why yours is 0.0.54 though. LSP-ruff pins ruff-lsp==0.0.52
at this moment.
Thanks for the reply!
I see this in the console:
LSP: LSP-ruff: Supported execute commands: ['ruff.applyAutofix', 'ruff.applyOrganizeImports', 'ruff.applyFormat']
LSP: LSP-ruff: supported code action kinds: ['quickfix', 'source.fixAll', 'source.organizeImports', 'source.fixAll.ruff', 'source.organizeImports.ruff', 'notebook.source.fixAll', 'notebook.source.organizeImports', 'notebook.source.fixAll.ruff', 'notebook.source.organizeImports.ruff']
LSP-ruff: LOG: Using interpreter executable: /Users/vgoklani/Library/Caches/Sublime Text/Package Storage/LSP-ruff/bin/ruff
LSP-ruff: LOG: Inferred version 0.5.0 for: /Users/vgoklani/Library/Caches/Sublime Text/Package Storage/LSP-ruff/bin/ruff
LSP-ruff: LOG: Found ruff 0.5.0 at /Users/vgoklani/Library/Caches/Sublime Text/Package Storage/LSP-ruff/bin/ruff
LSP-ruff: LOG: Running Ruff with: /Users/vgoklani/Library/Caches/Sublime Text/Package Storage/LSP-ruff/bin/ruff ['--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--config', '/Users/vgoklani/ruff.toml', '--stdin-filename', '/Users/vgoklani/scratch/scratch.py']
LSP-ruff: LOG: error: `ruff <path>` has been removed. Use `ruff check <path>` instead.
I removed the cache folder and also uninstalled and re-installed lsp-ruff, but it keeps install 0.5.0
Is there any way of not having it reference the cache, and forcing it to update to a different version
It looks like you don't know how to override a plugin file with your own. You basically use the same filesystem struct but in Packages/
. You have to create Packages/LSP-ruff/requirements.txt
with the content like what it is in this PR. An issue of doing so is that now ST will always use the override file you've created even if the plugin updates in the future.
Thanks for the reply!
To clarify, I should add a requirements.txt file here:
$HOME/Library/Application Support/Sublime Text/Packages/LSP-ruff/requirements.txt
ruff-lsp==0.0.54
inside the fileHow does this get installed? And how will the LSP-ruff
know to use this version going forward?
It's currently loading ruff from the cache:
$HOME/Library/Caches/Sublime Text/Package Storage/LSP-ruff/bin/ruff
Thanks!
You can delete the whole Package Storage/LSP-ruff
and restart ST. LSP-ruff should install ruff-lsp==0.0.54
since then.
$HOME/Library/Application Support/Sublime Text/Packages/LSP-ruff/requirements.txt
I've never used MacOS. The Packages/
I mean is the directory when you click on "Browse Packages..."
Description
LSP-ruff at this moment just doesn't do any diagnosis for people who install LSP-ruff now because for a new user, LSP-ruff will install
ruff-lsp==0.0.52
andruff==0.5.0
but they don't work together.The
ruff <path>
usage has been removed in ruff 0.5.0: https://github.com/astral-sh/ruff/releases/tag/0.5.0Reproduction
You can remove LSP-ruff and reinstall it. Then supposedly the installed
ruff
will be bumped up to0.5.0
(andruff-lsp
will hit`ruff <path>` has been removed.
).