You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Autoimport keep throwing exception when delete a line #307
--- Send (notification): textDocument/didChange
--- Send (58706): textDocument/completion
2022-11-28 22:45:51,446 CST - WARNING - pylsp.config.config - Failed to load hook pylsp_completions: 'NoneType' object has no attribute 'value'
Traceback (most recent call last):
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pylsp/config/config.py", line 33, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 327, in traced_hookexec
return outcome.get_result()
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pluggy/_result.py", line 33, in from_call
result = func()
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 324, in <lambda>
lambda: oldcall(hook_name, hook_impls, kwargs, firstresult)
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "▒▒▒▒▒▒▒▒/venv/lib/python3.10/site-packages/pylsp/plugins/rope_autoimport.py", line 159, in pylsp_completions
word = word_node.value
AttributeError: 'NoneType' object has no attribute 'value'
After I digging in code, I found the var line is alway a empty string when I delete a line
Activity
ccordoba12 commentedon Nov 28, 2022
Hey @douo, thanks for reporting. It seems that we need to add a validation to avoid this bug. Is it ok for you to submit a pull request to do that?
ccordoba12 commentedon Nov 28, 2022
Also, pinging @bagel897 about this, just in case.
Fix python-lsp#307 autoimport raise AttributeError in some case.