Open rukbotto opened 3 months ago
This is a no-op. After updating the libs installed in my system, the code actions started to work again.
Reopening. Although code actions now work for me when I want to extract variables or perform other common refactoring operations, when I try to import a library (using rope_autoimport
), the same error keeps triggering:
[ERROR][2024-07-31 10:55:39] .../vim/lsp/rpc.lua:770 "rpc" "/Users/rukbotto/.local/share/nvim/mason/bin/pylsp" "stderr" "2024-07-31 10:55:39,437 -05 - WARNING - pylsp.config.config - Failed to load hook pylsp_code_actions: Python version 3.12 is currently not supported.
Traceback (most recent call last):
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/parso/grammar.py\", line 246, in load_grammar
return _loaded_grammars[path]
~~~~~~~~~~~~~~~~^^^^^^
KeyError: '/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/parso/python/grammar312.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/parso/grammar.py\", line 249, in load_grammar
with open(path) as f:
^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/parso/python/grammar312.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pylsp/config/config.py\", line 39, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pluggy/_manager.py\", line 480, in traced_hookexec
return outcome.get_result()
^^^^^^^^^^^^^^^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pluggy/_result.py\", line 100, in get_result
raise exc.with_traceback(exc.__traceback__)
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pluggy/_result.py\", line 62, in from_call
result = func()
^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pluggy/_manager.py\", line 477, in <lambda>
lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pluggy/_callers.py\", line 139, in _multicall
raise exception.with_traceback(exception.__traceback__)
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pluggy/_callers.py\", line 103, in _multicall
res = hook_impl.function(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pylsp/plugins/rope_autoimport.py\", line 342, in pylsp_code_actions
word = get_name_or_module(document, diagnostic)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/pylsp/plugins/rope_autoimport.py\", line 295, in get_name_or_module
parso.parse(document.lines[start[\"line\"]])
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/parso/__init__.py\", line 57, in parse
grammar = load_grammar(version=version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/parso/grammar.py\", line 260, in load_grammar
return load_grammar(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File \"/Users/rukbotto/.local/share/nvim/mason/packages/python-lsp-server/venv/lib/python3.12/site-packages/parso/grammar.py\", line 256, in load_grammar
raise NotImplementedError(message)
NotImplementedError: Python version 3.12 is currently not supported.
"
Today, I tried to use code actions to insert a new import statement and got the following exception:
This happened after I updated the neovim plugins I have installed.
This is the output of
pip freeze
within the virtualenv used by the LSP server:And this is the LSP configuration I'm currently using:
Currently using nvim-lspconfig to configure my LSPs, on a Mac machine.