Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin looks for the ruff binaries in the wrong directory or misconfig? #452

Open
ar4hc opened this issue Jun 7, 2024 · 1 comment
Open

Comments

@ar4hc
Copy link

ar4hc commented Jun 7, 2024

Describe the bug

i see log entries like this:

INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;6): window/logMessage Log: Interpreter executable (/opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff) not found

running on a mac with brew installed ruff.

The error seems valid as /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff isn't there and i suspect it should be
/opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff-lsp (with -lsp at the end) which exists, and is the only binary in this dir.

Autodetect in the plugin config finds '/opt/homebrew/bin/ruff' and ...'-lsp', both links to the existing binaries.

It still seems to work though...

i created a link in the ruff-lsp dir to the ruff bin, like
ln -s ../../../../ruff/0.4.8/bin/ruff
and then see logs like

INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;6): window/logMessage Log: Using interpreter executable: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;6): window/logMessage Log: Found ruff 0.4.8 at /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;6): window/logMessage Log: Running Ruff with: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--stdin-filename', '/Users/...py']

Which means the plugin is still using cli ruff to format...?

To Reproduce
Steps to reproduce the behavior:

  1. Configure ruff plugin with everything checked.
  2. open logs
  3. wait...

Expected behavior
plugin should find the correct binary for rust-lsp.

Environments (please complete the following information):

  • IDE: Ultimate
  • OS: macOS Version 14.5 (23F79)
  • Ruff Version 0.4.8
  • ruff-lsp 0.0.53
  • Plugin version 0.0.33

Additional context
Probably a misconfig here... not sure...

@ar4hc
Copy link
Author

ar4hc commented Jun 10, 2024

today i get an infinit loop of those log entries:

INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: []
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Using interpreter executable: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Found ruff 0.4.8 at /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Running Ruff with: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--fix', '--stdin-filename', 'foo.py']
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Using interpreter executable: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Found ruff 0.4.8 at /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Running Ruff with: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--fix', '--select', 'I001', '--select', 'I002', '--stdin-filename', 'foo.py']
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Using interpreter executable: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Found ruff 0.4.8 at /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: Running Ruff with: /opt/homebrew/Cellar/ruff-lsp/0.0.53/libexec/bin/ruff ['check', '--force-exclude', '--no-cache', '--no-fix', '--quiet', '--output-format', 'json', '-', '--fix', '--select', 'I001', '--select', 'I002', '--stdin-filename', 'foo.py']
INFO - #c.i.p.l.i.LspServerImpl - RuffLspServerDescriptor@classifier-api(Running;9): window/logMessage Log: []

foo.py was a real absolute path...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant