sublimelsp / LSP-jdtls

Convenience package for the Eclipse JDT language server
https://packagecontrol.io/packages/LSP-jdtls
MIT License
30 stars 4 forks source link

Doesn't handle missing tests gracefully #53

Closed LDAP closed 3 months ago

LDAP commented 3 months ago
          Yes (tested on https://github.com/TheAlgorithms/Java):

https://github.com/sublimelsp/LSP-jdtls/assets/7210216/76121c5e-6c74-4aee-8d3c-e558d51fa0dd

That said, this plugin doesn't handle missing tests gracefully:

Error handling None
Traceback (most recent call last):
  File "C:\Users\Mataha\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/sessions.py", line 2412, in on_payload
    handler(result)
  File "C:\Users\Mataha\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/promise.py", line 144, in <lambda>
    executor_func(lambda resolve_value=None: self._do_resolve(resolve_value))
  File "C:\Users\Mataha\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/promise.py", line 205, in _do_resolve
    callback(new_value)
  File "C:\Users\Mataha\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/promise.py", line 169, in callback_wrapper
    result = onfullfilled(resolve_value)
  File "C:\Users\Mataha\AppData\Roaming\Sublime Text\Packages\LSP-jdtls\modules\test_extension_commands.py", line 151, in <lambda>
    else self.select_test_item(result, self.fetch_debug_args)
  File "C:\Users\Mataha\AppData\Roaming\Sublime Text\Packages\LSP-jdtls\modules\test_extension_commands.py", line 346, in select_test_item
    tests = flatten_test_items(test_items)
  File "C:\Users\Mataha\AppData\Roaming\Sublime Text\Packages\LSP-jdtls\modules\utils.py", line 47, in flatten_test_items
    for item in test_items:
TypeError: 'NoneType' object is not iterable

Originally posted by @mataha in https://github.com/sublimelsp/LSP-jdtls/issues/52#issuecomment-2211131324