Add support for ruff extension option to enable jupyterlab-lsp#59
Add support for ruff extension option to enable jupyterlab-lsp#59jhossbach merged 4 commits intopython-lsp:mainfrom
extension option to enable jupyterlab-lsp#59Conversation
|
Thanks for opening this PR and taking it forward. Do you think it would be better to add it directly as a CLI argument when invoking Ruff in We might want to confirm with the maintainers if this is the correct approach as this extension is probably being used with integrations other than |
|
I hadn't put the dots together that making it an option makes the flag public, so sorry for not realising that. The only reason for making the CLI flag opt-in here is because I'm unfamiliar with the other integrations and use cases, so I was worried about possible unintended side effects. I don't think there will be any, since it looks like this plugin only receives plain python anyway, but can't say for sure. I'll update this PR to remove the public option and add the CLI flag. |
|
I need this for jupyter-lsp to work as well! |
|
Hey @krassowski, can you confirm that this will resolve the issues with |
|
I have tested this locally and it looks like it works, LGTM. |
|
Thank you all! Sorry I was away last week but I did confirm now that all works great! |
|
Thank you all! |
EDIT: Following the comment below #59 (comment), removed the option for the
--extension ipynb:pythonflag and enabled it in all cases.Since ruff version 0.0.285, python-lsp-ruff no longer works with
jupyterlab-lsp. I previously raised the issue on the ruff project here: astral-sh/ruff#6847. Another user had the same issue and raised it in the jupyterlab-lsp project here: jupyter-lsp/jupyterlab-lsp#1003.As of ruff version 0.1.5 there is a way to override this. Namely add
--extension ipynb:python, to the CLI options which causes ruff to treat the content as python code.I am not familiar with the integrations other than jupyterlab-lsp, so I'm not certain whether adding this cli option to the ruff call will have unwanted effects on the other integrations, so please let me know if this is the wrong approach
Changes in this PR
--extension ipynb:pythonto the call to ruffAddedextensionto configuration which allows mapping file extensions to languagesOther approaches
--extensionto the CLI callAdd--extension ipynb:pythonregardless of configuration