astral-sh / ruff-lsp

A Language Server Protocol implementation for Ruff.
Other
1.31k stars 46 forks source link

Neovim log location #493

Closed sbushmanov closed 1 month ago

sbushmanov commented 1 month ago

I'm trying to organize imports in Python, neovim client

image

However, I'm getting:

LSP[ruff] Ruff encountered a problem. Check the logs for details

So, my question is what is the location of the logs [on Ubuntu 22.04 machine]

dhruvmanila commented 1 month ago

If you haven't specified the ruff.logFile setting then, I think, it should be at the path given by vim.lsp.get_log_path().

sbushmanov commented 1 month ago

@dhruvmanila image

dhruvmanila commented 1 month ago

I'm not sure what command are you using but you would press : (colon) and then write lua vim.print(vim.lsp.get_log_path()) which should print the path.

Screenshot 2024-09-13 at 15 12 42
sbushmanov commented 1 month ago

This definitely works.

What I'm getting in the logs now is:

[START][2024-09-13 22:26:03] LSP logging initiated
[ERROR][2024-09-13 22:26:03] .../vim/lsp/rpc.lua:770    "rpc"   "/home/sergey/.local/share/nvim/mason/bin/ruff" "stderr"    "warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `.local/share/JetBrains/Toolbox/apps/pycharm-professional/plugins/python-ce/helpers/typeshed/pyproject.toml`:\n  - 'select' -> 'lint.select'\n"
[ERROR][2024-09-13 22:26:03] .../vim/lsp/rpc.lua:770    "rpc"   "/home/sergey/.local/share/nvim/mason/bin/ruff" "stderr"    "warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `.local/share/JetBrains/IntelliJIdea2024.2/python/helpers/typeshed/pyproject.toml`:\n  - 'select' -> 'lint.select'\n"
[ERROR][2024-09-13 22:26:03] .../vim/lsp/rpc.lua:770    "rpc"   "/home/sergey/.local/share/nvim/mason/bin/ruff" "stderr"    "warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `.local/share/JetBrains/IntelliJIdea2023.3/python/helpers/typeshed/pyproject.toml`:\n  - 'select' -> 'lint.select'\n"
[ERROR][2024-09-13 22:26:03] .../vim/lsp/rpc.lua:770    "rpc"   "/home/sergey/.local/share/nvim/mason/bin/ruff" "stderr"    "warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `anaconda3/pkgs/pyzmq-26.1.1-py311h759c1eb_0/info/test/pyproject.toml`:\n  - 'isort' -> 'lint.isort'\nwarning: The `ignore-init-module-imports` option is deprecated and will be removed in a future release. Ruff's handling of imports in `__init__.py` files has been improved (in preview) and unused imports will always be flagged.\n"
[ERROR][2024-09-13 22:26:04] .../vim/lsp/rpc.lua:770    "rpc"   "/home/sergey/.local/share/nvim/mason/bin/ruff" "stderr"    "warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `anaconda3/pkgs/cryptography-42.0.8-py311h4a61cc7_0/info/test/pyproject.toml`:\n  - 'ignore' -> 'lint.ignore'\n  - 'select' -> 'lint.select'\n  - 'isort' -> 'lint.isort'\n"
[ERROR][2024-09-13 22:26:04] .../vim/lsp/rpc.lua:770    "rpc"   "/home/sergey/.local/share/nvim/mason/bin/ruff" "stderr"    "warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `anaconda3/pkgs/pyzmq-26.1.0-py311h759c1eb_0/info/test/pyproject.toml`:\n  - 'isort' -> 'lint.isort'\n"
[ERROR][2024-09-13 22:26:06] ...lsp/handlers.lua:623    'File or directory "/<default workspace root>" does not exist.'

Any guidance on what I should do now?

sbushmanov commented 1 month ago

@dhruvmanila

Thank you very much for your response, everything is fixed now.