koxudaxi / ruff-pycharm-plugin

PyCharm plugin for ruff. This plugin provides reformat code using ruff.
MIT License
173 stars 6 forks source link

Support for new integrated ruff language server #447

Closed raayu83 closed 1 week ago

raayu83 commented 1 month ago

Is your feature request related to a problem? Please describe. Currently this plugin uses ruff-lsp, which has been superseded by the integrated ruff lsp server the day before yesterday, see https://astral.sh/blog/ruff-v0.4.5

Describe the solution you'd like Would be great if this plugin supported the new integrated server.

Additional context Thanks for providing this really useful plugin!

Mogost commented 1 month ago

@koxudaxi First of all, thanks for the awesome plugin! How big changes to the plugin are needed for this? Can we expect a new version soon?

koxudaxi commented 1 month ago

Thank you for creating the issue. I expected to release the PR https://github.com/koxudaxi/ruff-pycharm-plugin/pull/437 to support the LSP for the non-pro version of the IDE before picking up this PR. But we have to wait for the release of the next LSP4IJ version.

OK, I will support the new integrated ruff lsp first.

raayu83 commented 1 month ago

That’s great! Looking forward to it!

raayu83 commented 1 week ago

Thanks for the implementation! Looking forward to the release!

koxudaxi commented 1 week ago

@raayu83 I'm sorry for my late action. You can install the plugin from the page.

https://github.com/koxudaxi/ruff-pycharm-plugin/releases/tag/v0.0.34

raayu83 commented 1 week ago

Nothing to be sorry about, I'm grateful you found some time to implement this feature at all!

raayu83 commented 4 days ago

Hi @koxudaxi , just installed the new version and the configuration screen still looks the same. What should I enter into to "ruff-lsp executable" field in order to use ruff server? Nothing at all or the ruff executable?

koxudaxi commented 3 days ago

@raayu83 The new version has a new option to enable ruff server

new option:

image

Full screen:

image

you can check the ruff server in the process list after open the your project.

ps ax |grep "ruff server"
 7039   ??  S      0:00.07 /Users/koudai/PycharmProjects/pythonProject1/.venv/bin/ruff server --preview
20806   ??  S      0:00.01 /Users/koudai/PycharmProjects/pythonProject1/.venv/bin/ruff server --preview
20857 s008  S+     0:00.00 grep ruff server
image
raayu83 commented 3 days ago

Thanks, that worked!