LSP
LSP copied to clipboard
Client exceptions related to code actions
Describe the bug The console shows exceptions when using LSP-jdtls related to code actions.
Error handling None
Traceback (most recent call last):
File "/home/lucas/.config/sublime-text/Packages/LSP/plugin/core/sessions.py", line 1977, in on_payload
handler(result)
File "/home/lucas/.config/sublime-text/Packages/LSP/plugin/code_actions.py", line 56, in <lambda>
return lambda actions: self._collect_response(config_name, actions)
File "/home/lucas/.config/sublime-text/Packages/LSP/plugin/code_actions.py", line 60, in _collect_response
self._commands_by_config[config_name] = self._get_enabled_actions(actions or [])
File "/home/lucas/.config/sublime-text/Packages/LSP/plugin/code_actions.py", line 64, in _get_enabled_actions
return [action for action in actions if not action.get('disabled')]
File "/home/lucas/.config/sublime-text/Packages/LSP/plugin/code_actions.py", line 64, in <listcomp>
return [action for action in actions if not action.get('disabled')]
AttributeError: 'NoneType' object has no attribute 'get
To Reproduce Steps to reproduce the behavior:
- Open a Java file with LSP-jdtls
Expected behavior No exceptions are logged
Environment (please complete the following information):
- OS: Arch Linux
- Sublime Text version: 4136
- LSP version: 1.16.2
- Language servers used: jdtls
That means the server returned a null value as one of the code actions which according to spec is not allowed.
The result type is supposed to be (Command | CodeAction)[] | null
@LDAP in other words, it is a language server issue.
Feel free to open the issue in the jdtls repo.
Should we can keep this issue open until it is resolved on the server or should we close this?
@LDAP will close this issue for reasons being specified in the comments above.