python-lsp / python-lsp-ruff

Linter plugin for pylsp based on ruff.
MIT License
162 stars 23 forks source link

Error while trying to format buffer #99

Closed scmanjarrez closed 4 days ago

scmanjarrez commented 4 days ago

Hi, I've noticed that on start, the pylsp::sterr is showing this error. I'm not sure if it's related to this problem

2024-10-15 18:22:45,784 CEST - WARNING - pylsp.config.config - Failed to load hook pylsp_code_actions: While structuring Fix (3 sub-exceptions)
  + Exception Group Traceback (most recent call last):
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp/config/config.py", line 39, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 480, in traced_hookexec
  |     return outcome.get_result()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 62, in from_call
  |     result = func()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 477, in <lambda>
  |     lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp_ruff/plugin.py", line 289, in pylsp_code_actions
  |     fix = converter.structure(diagnostic.data, RuffFix)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/converters.py", line 558, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 19, in structure_Fix
  |     if errors: raise __c_cve('While structuring ' + 'Fix', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring Fix (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 5, in structure_Fix
    |     res['edits'] = __c_structure_edits(o['edits'], __c_type_edits)
    |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 143, in structure_list
    |     raise IterableValidationError(
    | cattrs.errors.IterableValidationError: While structuring typing.List[pylsp_ruff.ruff.Edit] (1 sub-exception)
    | Structuring class Fix @ attribute edits
    +-+---------------- 1 ----------------
      | Exception Group Traceback (most recent call last):
      |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 133, in structure_list
      |     res.append(handler(e, _elem_type))
      |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 19, in structure_Edit
      |     if errors: raise __c_cve('While structuring ' + 'Edit', errors, __cl)
      | cattrs.errors.ClassValidationError: While structuring Edit (3 sub-exceptions)
      | Structuring typing.List[pylsp_ruff.ruff.Edit] @ index 0
      +-+---------------- 1 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 5, in structure_Edit
        |     res['content'] = __c_structure_content(o['content'])
        | KeyError: 'content'
        | Structuring class Edit @ attribute content
        +---------------- 2 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 10, in structure_Edit
        |     res['location'] = __c_structure_location(o['location'], __c_type_location)
        | KeyError: 'location'
        | Structuring class Edit @ attribute location
        +---------------- 3 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 15, in structure_Edit
        |     res['end_location'] = __c_structure_end_location(o['end_location'], __c_type_end_location)
        | KeyError: 'end_location'
        | Structuring class Edit @ attribute end_location
        +------------------------------------
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 10, in structure_Fix
    |     res['message'] = __c_structure_message(o['message'])
    | KeyError: 'message'
    | Structuring class Fix @ attribute message
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 15, in structure_Fix
    |     res['applicability'] = __c_structure_applicability(o['applicability'])
    | KeyError: 'applicability'
    | Structuring class Fix @ attribute applicability
    +------------------------------------
2024-10-15 18:22:45,785 CEST - WARNING - pylsp_jsonrpc.endpoint - Received cancel notification for unknown message id 6

Running lsp-format-buffer fails, and this is the trace in pylsp::stderr

2024-10-16 09:34:56,157 CEST - WARNING - pylsp.config.config - Failed to load hook pylsp_code_actions: While structuring Fix (3 sub-exceptions)
  + Exception Group Traceback (most recent call last):
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp/config/config.py", line 39, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 480, in traced_hookexec
  |     return outcome.get_result()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 62, in from_call
  |     result = func()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 477, in <lambda>
  |     lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp_ruff/plugin.py", line 289, in pylsp_code_actions
  |     fix = converter.structure(diagnostic.data, RuffFix)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/converters.py", line 558, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 19, in structure_Fix
  |     if errors: raise __c_cve('While structuring ' + 'Fix', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring Fix (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 5, in structure_Fix
    |     res['edits'] = __c_structure_edits(o['edits'], __c_type_edits)
    |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 143, in structure_list
    |     raise IterableValidationError(
    | cattrs.errors.IterableValidationError: While structuring typing.List[pylsp_ruff.ruff.Edit] (1 sub-exception)
    | Structuring class Fix @ attribute edits
    +-+---------------- 1 ----------------
      | Exception Group Traceback (most recent call last):
      |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 133, in structure_list
      |     res.append(handler(e, _elem_type))
      |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 19, in structure_Edit
      |     if errors: raise __c_cve('While structuring ' + 'Edit', errors, __cl)
      | cattrs.errors.ClassValidationError: While structuring Edit (3 sub-exceptions)
      | Structuring typing.List[pylsp_ruff.ruff.Edit] @ index 0
      +-+---------------- 1 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 5, in structure_Edit
        |     res['content'] = __c_structure_content(o['content'])
        | KeyError: 'content'
        | Structuring class Edit @ attribute content
        +---------------- 2 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 10, in structure_Edit
        |     res['location'] = __c_structure_location(o['location'], __c_type_location)
        | KeyError: 'location'
        | Structuring class Edit @ attribute location
        +---------------- 3 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 15, in structure_Edit
        |     res['end_location'] = __c_structure_end_location(o['end_location'], __c_type_end_location)
        | KeyError: 'end_location'
        | Structuring class Edit @ attribute end_location
        +------------------------------------
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 10, in structure_Fix
    |     res['message'] = __c_structure_message(o['message'])
    | KeyError: 'message'
    | Structuring class Fix @ attribute message
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 15, in structure_Fix
    |     res['applicability'] = __c_structure_applicability(o['applicability'])
    | KeyError: 'applicability'
    | Structuring class Fix @ attribute applicability
    +------------------------------------
2024-10-16 09:34:58,282 CEST - WARNING - pylsp.config.config - Failed to load hook pylsp_code_actions: While structuring Fix (3 sub-exceptions)
  + Exception Group Traceback (most recent call last):
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp/config/config.py", line 39, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 480, in traced_hookexec
  |     return outcome.get_result()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 62, in from_call
  |     result = func()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 477, in <lambda>
  |     lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp_ruff/plugin.py", line 289, in pylsp_code_actions
  |     fix = converter.structure(diagnostic.data, RuffFix)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/converters.py", line 558, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 19, in structure_Fix
  |     if errors: raise __c_cve('While structuring ' + 'Fix', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring Fix (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 5, in structure_Fix
    |     res['edits'] = __c_structure_edits(o['edits'], __c_type_edits)
    |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 143, in structure_list
    |     raise IterableValidationError(
    | cattrs.errors.IterableValidationError: While structuring typing.List[pylsp_ruff.ruff.Edit] (1 sub-exception)
    | Structuring class Fix @ attribute edits
    +-+---------------- 1 ----------------
      | Exception Group Traceback (most recent call last):
      |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 133, in structure_list
      |     res.append(handler(e, _elem_type))
      |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 19, in structure_Edit
      |     if errors: raise __c_cve('While structuring ' + 'Edit', errors, __cl)
      | cattrs.errors.ClassValidationError: While structuring Edit (3 sub-exceptions)
      | Structuring typing.List[pylsp_ruff.ruff.Edit] @ index 0
      +-+---------------- 1 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 5, in structure_Edit
        |     res['content'] = __c_structure_content(o['content'])
        | KeyError: 'content'
        | Structuring class Edit @ attribute content
        +---------------- 2 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 10, in structure_Edit
        |     res['location'] = __c_structure_location(o['location'], __c_type_location)
        | KeyError: 'location'
        | Structuring class Edit @ attribute location
        +---------------- 3 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 15, in structure_Edit
        |     res['end_location'] = __c_structure_end_location(o['end_location'], __c_type_end_location)
        | KeyError: 'end_location'
        | Structuring class Edit @ attribute end_location
        +------------------------------------
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 10, in structure_Fix
    |     res['message'] = __c_structure_message(o['message'])
    | KeyError: 'message'
    | Structuring class Fix @ attribute message
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 15, in structure_Fix
    |     res['applicability'] = __c_structure_applicability(o['applicability'])
    | KeyError: 'applicability'
    | Structuring class Fix @ attribute applicability
    +------------------------------------
2024-10-16 09:34:58,985 CEST - WARNING - pylsp.config.config - Failed to load hook pylsp_code_actions: While structuring Fix (3 sub-exceptions)
  + Exception Group Traceback (most recent call last):
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp/config/config.py", line 39, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 480, in traced_hookexec
  |     return outcome.get_result()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 62, in from_call
  |     result = func()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 477, in <lambda>
  |     lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp_ruff/plugin.py", line 289, in pylsp_code_actions
  |     fix = converter.structure(diagnostic.data, RuffFix)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/converters.py", line 558, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 19, in structure_Fix
  |     if errors: raise __c_cve('While structuring ' + 'Fix', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring Fix (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 5, in structure_Fix
    |     res['edits'] = __c_structure_edits(o['edits'], __c_type_edits)
    |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 143, in structure_list
    |     raise IterableValidationError(
    | cattrs.errors.IterableValidationError: While structuring typing.List[pylsp_ruff.ruff.Edit] (1 sub-exception)
    | Structuring class Fix @ attribute edits
    +-+---------------- 1 ----------------
      | Exception Group Traceback (most recent call last):
      |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 133, in structure_list
      |     res.append(handler(e, _elem_type))
      |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 19, in structure_Edit
      |     if errors: raise __c_cve('While structuring ' + 'Edit', errors, __cl)
      | cattrs.errors.ClassValidationError: While structuring Edit (3 sub-exceptions)
      | Structuring typing.List[pylsp_ruff.ruff.Edit] @ index 0
      +-+---------------- 1 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 5, in structure_Edit
        |     res['content'] = __c_structure_content(o['content'])
        | KeyError: 'content'
        | Structuring class Edit @ attribute content
        +---------------- 2 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 10, in structure_Edit
        |     res['location'] = __c_structure_location(o['location'], __c_type_location)
        | KeyError: 'location'
        | Structuring class Edit @ attribute location
        +---------------- 3 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 15, in structure_Edit
        |     res['end_location'] = __c_structure_end_location(o['end_location'], __c_type_end_location)
        | KeyError: 'end_location'
        | Structuring class Edit @ attribute end_location
        +------------------------------------
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 10, in structure_Fix
    |     res['message'] = __c_structure_message(o['message'])
    | KeyError: 'message'
    | Structuring class Fix @ attribute message
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 15, in structure_Fix
    |     res['applicability'] = __c_structure_applicability(o['applicability'])
    | KeyError: 'applicability'
    | Structuring class Fix @ attribute applicability
    +------------------------------------
2024-10-16 09:35:03,078 CEST - WARNING - pylsp.config.config - Failed to load hook pylsp_code_actions: While structuring Fix (3 sub-exceptions)
  + Exception Group Traceback (most recent call last):
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp/config/config.py", line 39, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 480, in traced_hookexec
  |     return outcome.get_result()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 100, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_result.py", line 62, in from_call
  |     result = func()
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_manager.py", line 477, in <lambda>
  |     lambda: oldcall(hook_name, hook_impls, caller_kwargs, firstresult)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
  |     res = hook_impl.function(*args)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/pylsp_ruff/plugin.py", line 289, in pylsp_code_actions
  |     fix = converter.structure(diagnostic.data, RuffFix)
  |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/converters.py", line 558, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 19, in structure_Fix
  |     if errors: raise __c_cve('While structuring ' + 'Fix', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring Fix (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 5, in structure_Fix
    |     res['edits'] = __c_structure_edits(o['edits'], __c_type_edits)
    |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 143, in structure_list
    |     raise IterableValidationError(
    | cattrs.errors.IterableValidationError: While structuring typing.List[pylsp_ruff.ruff.Edit] (1 sub-exception)
    | Structuring class Fix @ attribute edits
    +-+---------------- 1 ----------------
      | Exception Group Traceback (most recent call last):
      |   File "/home/schica/.local/pipx/venvs/python-lsp-server/lib/python3.10/site-packages/cattrs/cols.py", line 133, in structure_list
      |     res.append(handler(e, _elem_type))
      |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 19, in structure_Edit
      |     if errors: raise __c_cve('While structuring ' + 'Edit', errors, __cl)
      | cattrs.errors.ClassValidationError: While structuring Edit (3 sub-exceptions)
      | Structuring typing.List[pylsp_ruff.ruff.Edit] @ index 0
      +-+---------------- 1 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 5, in structure_Edit
        |     res['content'] = __c_structure_content(o['content'])
        | KeyError: 'content'
        | Structuring class Edit @ attribute content
        +---------------- 2 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 10, in structure_Edit
        |     res['location'] = __c_structure_location(o['location'], __c_type_location)
        | KeyError: 'location'
        | Structuring class Edit @ attribute location
        +---------------- 3 ----------------
        | Traceback (most recent call last):
        |   File "<cattrs generated structure pylsp_ruff.ruff.Edit>", line 15, in structure_Edit
        |     res['end_location'] = __c_structure_end_location(o['end_location'], __c_type_end_location)
        | KeyError: 'end_location'
        | Structuring class Edit @ attribute end_location
        +------------------------------------
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 10, in structure_Fix
    |     res['message'] = __c_structure_message(o['message'])
    | KeyError: 'message'
    | Structuring class Fix @ attribute message
    +---------------- 3 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure pylsp_ruff.ruff.Fix>", line 15, in structure_Fix
    |     res['applicability'] = __c_structure_applicability(o['applicability'])
    | KeyError: 'applicability'
    | Structuring class Fix @ attribute applicability
    +------------------------------------

I'm using latest pylsp version and python-lsp-ruff in emacs-lsp.

❯ bin/python -m pip list
Package               Version
--------------------- --------
attrs                 24.2.0
cattrs                24.1.2
docstring-to-markdown 0.15
exceptiongroup        1.2.2
jedi                  0.19.1
lsprotocol            2023.0.1
mypy                  1.12.0
mypy-extensions       1.0.0
parso                 0.8.4
pip                   24.2
pluggy                1.5.0
pylsp-mypy            0.6.9
python-lsp-jsonrpc    1.1.2
python-lsp-ruff       2.2.2
python-lsp-server     1.12.0
ruff                  0.6.9
setuptools            75.1.0
tomli                 2.0.2
typing_extensions     4.12.2
ujson                 5.10.0
wheel                 0.44.0

ruff/ruff::stderr buffers are empty.

Edit: The message "Ruff encountered a problem. Check the logs for more details" seems to appear when hovering the mouse in the first "error" shown by ruff image

This is the log of ruff server

[Trace - 10:01:00 am] Sending request 'initialize - (2)'.
Params: {
  "processId": 95853,
  "rootPath": "/home/schica/csic/groupsig/libgroupsig",
  "clientInfo": {
    "name": "emacs",
    "version": "GNU Emacs 29.4 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)\n of 2024-07-05"
  },
  "rootUri": "file:///home/schica/csic/groupsig/libgroupsig",
  "capabilities": {
    "general": {
      "positionEncodings": [
        "utf-32",
        "utf-16"
      ]
    },
    "workspace": {
      "workspaceEdit": {
        "documentChanges": true,
        "resourceOperations": [
          "create",
          "rename",
          "delete"
        ]
      },
      "applyEdit": true,
      "symbol": {
        "symbolKind": {
          "valueSet": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26
          ]
        }
      },
      "executeCommand": {
        "dynamicRegistration": false
      },
      "didChangeWatchedFiles": {
        "dynamicRegistration": true
      },
      "workspaceFolders": true,
      "configuration": true,
      "codeLens": {
        "refreshSupport": true
      },
      "fileOperations": {
        "didCreate": false,
        "willCreate": false,
        "didRename": true,
        "willRename": true,
        "didDelete": false,
        "willDelete": false
      }
    },
    "textDocument": {
      "declaration": {
        "dynamicRegistration": true,
        "linkSupport": true
      },
      "definition": {
        "dynamicRegistration": true,
        "linkSupport": true
      },
      "references": {
        "dynamicRegistration": true
      },
      "implementation": {
        "dynamicRegistration": true,
        "linkSupport": true
      },
      "typeDefinition": {
        "dynamicRegistration": true,
        "linkSupport": true
      },
      "synchronization": {
        "willSave": true,
        "didSave": true,
        "willSaveWaitUntil": true
      },
      "documentSymbol": {
        "symbolKind": {
          "valueSet": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26
          ]
        },
        "hierarchicalDocumentSymbolSupport": true
      },
      "formatting": {
        "dynamicRegistration": true
      },
      "rangeFormatting": {
        "dynamicRegistration": true
      },
      "onTypeFormatting": {
        "dynamicRegistration": true
      },
      "rename": {
        "dynamicRegistration": true,
        "prepareSupport": true
      },
      "codeAction": {
        "dynamicRegistration": true,
        "isPreferredSupport": true,
        "codeActionLiteralSupport": {
          "codeActionKind": {
            "valueSet": [
              "",
              "quickfix",
              "refactor",
              "refactor.extract",
              "refactor.inline",
              "refactor.rewrite",
              "source",
              "source.organizeImports"
            ]
          }
        },
        "resolveSupport": {
          "properties": [
            "edit",
            "command"
          ]
        },
        "dataSupport": true
      },
      "completion": {
        "completionItem": {
          "snippetSupport": true,
          "documentationFormat": [
            "markdown",
            "plaintext"
          ],
          "resolveAdditionalTextEditsSupport": true,
          "insertReplaceSupport": true,
          "deprecatedSupport": true,
          "resolveSupport": {
            "properties": [
              "documentation",
              "detail",
              "additionalTextEdits",
              "command"
            ]
          },
          "insertTextModeSupport": {
            "valueSet": [
              1,
              2
            ]
          }
        },
        "contextSupport": true,
        "dynamicRegistration": true
      },
      "signatureHelp": {
        "signatureInformation": {
          "parameterInformation": {
            "labelOffsetSupport": true
          }
        },
        "dynamicRegistration": true
      },
      "documentLink": {
        "dynamicRegistration": true,
        "tooltipSupport": true
      },
      "hover": {
        "contentFormat": [
          "markdown",
          "plaintext"
        ],
        "dynamicRegistration": true
      },
      "foldingRange": {
        "dynamicRegistration": true
      },
      "selectionRange": {
        "dynamicRegistration": true
      },
      "callHierarchy": {
        "dynamicRegistration": false
      },
      "typeHierarchy": {
        "dynamicRegistration": true
      },
      "publishDiagnostics": {
        "relatedInformation": true,
        "tagSupport": {
          "valueSet": [
            1,
            2
          ]
        },
        "versionSupport": true
      },
      "diagnostic": {
        "dynamicRegistration": false,
        "relatedDocumentSupport": false
      },
      "linkedEditingRange": {
        "dynamicRegistration": true
      }
    },
    "window": {
      "workDoneProgress": true,
      "showDocument": {
        "support": true
      }
    }
  },
  "initializationOptions": {
    "settings": {
      "logLevel": "error",
      "showNotifications": "off",
      "organizeImports": true,
      "fixAll": true,
      "importStrategy": "fromEnvironment"
    }
  },
  "workDoneToken": "1"
}

[Trace - 10:01:00 am] Received response 'initialize - (2)' in 26ms.
Result: {
  "capabilities": {
    "codeActionProvider": {
      "codeActionKinds": [
        "quickfix",
        "source.fixAll.ruff",
        "source.organizeImports.ruff",
        "notebook.source.fixAll.ruff",
        "notebook.source.organizeImports.ruff"
      ],
      "resolveProvider": true,
      "workDoneProgress": true
    },
    "diagnosticProvider": {
      "identifier": "Ruff",
      "interFileDependencies": null,
      "workDoneProgress": true,
      "workspaceDiagnostics": null
    },
    "documentFormattingProvider": true,
    "documentRangeFormattingProvider": true,
    "executeCommandProvider": {
      "commands": [
        "ruff.applyFormat",
        "ruff.applyAutofix",
        "ruff.applyOrganizeImports",
        "ruff.printDebugInformation"
      ],
      "workDoneProgress": null
    },
    "hoverProvider": true,
    "notebookDocumentSync": {
      "notebookSelector": [
        {
          "cells": [
            {
              "language": "python"
            }
          ]
        }
      ],
      "save": null
    },
    "positionEncoding": "utf-32",
    "textDocumentSync": {
      "change": 2,
      "openClose": true,
      "willSave": null,
      "willSaveWaitUntil": null
    },
    "workspace": {
      "workspaceFolders": {
        "changeNotifications": true,
        "supported": true
      }
    }
  },
  "serverInfo": {
    "name": "ruff",
    "version": "0.6.9"
  }
}

[Trace - 10:01:00 am] Sending notification 'initialized'.
Params: {}

[Trace - 10:01:00 am] Sending notification 'textDocument/didOpen'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "languageId": "python",
    "version": 0,
    "text": "import os\nimport ctypes\n\n\n# src/bn_c384_256.cpp\nMCLBN_FP_UNIT_SIZE = 6\nMCLBN_FR_UNIT_SIZE = 4\n\n# include/lib/bls12_381.hpp\nMCL_MAX_FP_BIT_SIZE = 384\nMCL_MAX_FR_BIT_SIZE = 256\n\n# include/lib/curve_type.h\nMCL_BLS12_381 = 5\n\n# include/lib/bn.h\nMCLBN_COMPILED_TIME_VAR = MCLBN_FR_UNIT_SIZE * 10 + MCLBN_FP_UNIT_SIZE\n\n# src/shim/pbc_ext.h (libgroupsig)\nBLS12_381_P = \"1 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 1339506544944476473020471379941921221584933875938349620426543736416511423956333506472724655353366534992391756441569\"\nBLS12_381_Q = \"1 352701069587466618187139116011060144890029952792775240219908644239793785735715026873347600343865175952761926303160 3059144344244213709971259814753781636986470325476647558659373206291635324768958432433509563104347017837885763365758 1985150602287291935568054521177171638300868978215655730859378665066344726373823718423869104263333984641494340347905 927553665492332455747201965776037880757740193453592970025027978793976877002675564980949289727957565575433344219582\"\n\nLIB_PATH = os.environ.get(\"MCL_LIB_PATH\")\nMCL_LIB = \"libmcl.so\"\nMCL384_LIB = \"libmclbn384_256.so\"\nlib = None\n\n\ndef load_library():\n    global lib\n    if LIB_PATH is None:\n        raise RuntimeError(\"Environment variable MCL_LIB_PATH missing.\")\n    ctypes.CDLL(f\"{LIB_PATH}/{MCL_LIB}\")\n    lib = ctypes.CDLL(f\"{LIB_PATH}/{MCL384_LIB}\")\n    ret = lib.mclBn_init(MCL_BLS12_381, MCLBN_COMPILED_TIME_VAR)\n    if ret:\n        raise RuntimeError(\"mcl library could not be initialized\")\n"
  }
}

[Trace - 10:01:00 am] Sending request 'textDocument/diagnostic - (3)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  }
}

[Trace - 10:01:00 am] Sending request 'textDocument/codeAction - (4)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}

[Trace - 10:01:00 am] Received request 'client/registerCapability - (1).
Params: {
  "registrations": [
    {
      "id": "ruff-server-watch",
      "method": "workspace/didChangeWatchedFiles",
      "registerOptions": {
        "watchers": [
          {
            "globPattern": "**/.ruff.toml"
          },
          {
            "globPattern": "**/ruff.toml"
          },
          {
            "globPattern": "**/pyproject.toml"
          }
        ]
      }
    }
  ]
}

[Trace - 10:01:00 am] Sending response 'client/registerCapability - (1)'. Processing request took 71ms
Params: {
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}

[Trace - 10:01:00 am] Received response 'textDocument/diagnostic - (3)' in 88ms.
Result: {
  "items": [
    {
      "code": "I001",
      "codeDescription": {
        "href": "https://docs.astral.sh/ruff/rules/unsorted-imports"
      },
      "data": {
        "code": "I001",
        "edits": [
          {
            "newText": "import ctypes\nimport os\n\n",
            "range": {
              "end": {
                "character": 0,
                "line": 4
              },
              "start": {
                "character": 0,
                "line": 0
              }
            }
          }
        ],
        "kind": {
          "body": "Import block is un-sorted or un-formatted",
          "name": "UnsortedImports",
          "suggestion": "Organize imports"
        },
        "noqa_edit": {
          "newText": "  # noqa: I001\n",
          "range": {
            "end": {
              "character": 0,
              "line": 1
            },
            "start": {
              "character": 9,
              "line": 0
            }
          }
        }
      },
      "message": "Import block is un-sorted or un-formatted",
      "range": {
        "end": {
          "character": 0,
          "line": 4
        },
        "start": {
          "character": 0,
          "line": 0
        }
      },
      "severity": 2,
      "source": "Ruff"
    }
  ],
  "kind": "full"
}

[Trace - 10:01:00 am] Received response 'textDocument/codeAction - (4)' in 81ms.
Result: [
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.fixAll.ruff",
    "title": "Ruff: Fix all auto-fixable problems"
  },
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.organizeImports.ruff",
    "title": "Ruff: Organize imports"
  }
]

[Trace - 10:01:00 am] Sending request 'textDocument/hover - (5)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}

[Trace - 10:01:00 am] Received response 'textDocument/hover - (5)' in 1ms.
Result: null

[Trace - 10:01:00 am] Sending request 'textDocument/codeAction - (9)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": [
      {
        "code": "I001",
        "codeDescription": {
          "href": "https://docs.astral.sh/ruff/rules/unsorted-imports"
        },
        "data": {
          "code": "I001",
          "edits": [
            {
              "newText": "import ctypes\nimport os\n\n",
              "range": {
                "end": {
                  "character": 0,
                  "line": 4
                },
                "start": {
                  "character": 0,
                  "line": 0
                }
              }
            }
          ],
          "kind": {
            "body": "Import block is un-sorted or un-formatted",
            "name": "UnsortedImports",
            "suggestion": "Organize imports"
          },
          "noqa_edit": {
            "newText": "  # noqa: I001\n",
            "range": {
              "end": {
                "character": 0,
                "line": 1
              },
              "start": {
                "character": 9,
                "line": 0
              }
            }
          }
        },
        "message": "Import block is un-sorted or un-formatted",
        "range": {
          "end": {
            "character": 0,
            "line": 4
          },
          "start": {
            "character": 0,
            "line": 0
          }
        },
        "severity": 2,
        "source": "Ruff"
      }
    ]
  }
}

[Trace - 10:01:00 am] Received response 'textDocument/codeAction - (9)' in 4ms.
Result: [
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "diagnostics": [
      {
        "code": "I001",
        "codeDescription": {
          "href": "https://docs.astral.sh/ruff/rules/unsorted-imports"
        },
        "message": "Import block is un-sorted or un-formatted",
        "range": {
          "end": {
            "character": 0,
            "line": 4
          },
          "start": {
            "character": 0,
            "line": 0
          }
        },
        "severity": 2,
        "source": "Ruff"
      }
    ],
    "edit": {
      "documentChanges": [
        {
          "edits": [
            {
              "newText": "import ctypes\nimport os\n\n",
              "range": {
                "end": {
                  "character": 0,
                  "line": 4
                },
                "start": {
                  "character": 0,
                  "line": 0
                }
              }
            }
          ],
          "textDocument": {
            "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
            "version": null
          }
        }
      ]
    },
    "kind": "quickfix",
    "title": "Ruff (I001): Organize imports"
  },
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "diagnostics": [
      {
        "code": "I001",
        "codeDescription": {
          "href": "https://docs.astral.sh/ruff/rules/unsorted-imports"
        },
        "message": "Import block is un-sorted or un-formatted",
        "range": {
          "end": {
            "character": 0,
            "line": 4
          },
          "start": {
            "character": 0,
            "line": 0
          }
        },
        "severity": 2,
        "source": "Ruff"
      }
    ],
    "edit": {
      "documentChanges": [
        {
          "edits": [
            {
              "newText": "  # noqa: I001\n",
              "range": {
                "end": {
                  "character": 0,
                  "line": 1
                },
                "start": {
                  "character": 9,
                  "line": 0
                }
              }
            }
          ],
          "textDocument": {
            "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
            "version": null
          }
        }
      ]
    },
    "kind": "quickfix",
    "title": "Ruff (I001): Disable for this line"
  },
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.fixAll.ruff",
    "title": "Ruff: Fix all auto-fixable problems"
  },
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.organizeImports.ruff",
    "title": "Ruff: Organize imports"
  }
]

[Trace - 10:01:06 am] Sending request 'textDocument/codeAction - (12)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": [
      {
        "range": {
          "start": {
            "line": 0,
            "character": 0
          },
          "end": {
            "line": 4,
            "character": 0
          }
        },
        "message": "Import block is un-sorted or un-formatted",
        "severity": 2,
        "code": "I001",
        "source": "ruff",
        "tags": [],
        "data": {
          "edits": [
            {
              "content": "import ctypes\nimport os\n\n",
              "location": {
                "row": 1,
                "column": 1
              },
              "end_location": {
                "row": 5,
                "column": 1
              }
            }
          ],
          "message": "Organize imports",
          "applicability": "safe"
        }
      },
      {
        "code": "I001",
        "codeDescription": {
          "href": "https://docs.astral.sh/ruff/rules/unsorted-imports"
        },
        "data": {
          "code": "I001",
          "edits": [
            {
              "newText": "import ctypes\nimport os\n\n",
              "range": {
                "end": {
                  "character": 0,
                  "line": 4
                },
                "start": {
                  "character": 0,
                  "line": 0
                }
              }
            }
          ],
          "kind": {
            "body": "Import block is un-sorted or un-formatted",
            "name": "UnsortedImports",
            "suggestion": "Organize imports"
          },
          "noqa_edit": {
            "newText": "  # noqa: I001\n",
            "range": {
              "end": {
                "character": 0,
                "line": 1
              },
              "start": {
                "character": 9,
                "line": 0
              }
            }
          }
        },
        "message": "Import block is un-sorted or un-formatted",
        "range": {
          "end": {
            "character": 0,
            "line": 4
          },
          "start": {
            "character": 0,
            "line": 0
          }
        },
        "severity": 2,
        "source": "Ruff"
      }
    ]
  }
}

[Trace - 10:01:06 am] Received notification 'window/showMessage'.
Params: {
  "message": "Ruff encountered a problem. Check the logs for more details.",
  "type": 1
}

[Trace - 10:01:06 am] Received response 'textDocument/codeAction - (12)' in 8ms.
Result: {
  "code": -32603,
  "message": "failed to deserialize diagnostic data: missing field `range`"
}

[Trace - 10:02:46 am] Sending request 'textDocument/codeAction - (13)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "range": {
    "start": {
      "line": 11,
      "character": 0
    },
    "end": {
      "line": 11,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}

[Trace - 10:02:46 am] Received response 'textDocument/codeAction - (13)' in 10ms.
Result: [
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.fixAll.ruff",
    "title": "Ruff: Fix all auto-fixable problems"
  },
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.organizeImports.ruff",
    "title": "Ruff: Organize imports"
  }
]

[Trace - 10:03:04 am] Sending request 'textDocument/codeAction - (14)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "range": {
    "start": {
      "line": 6,
      "character": 22
    },
    "end": {
      "line": 6,
      "character": 22
    }
  },
  "context": {
    "diagnostics": []
  }
}

[Trace - 10:03:04 am] Received response 'textDocument/codeAction - (14)' in 10ms.
Result: [
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.fixAll.ruff",
    "title": "Ruff: Fix all auto-fixable problems"
  },
  {
    "data": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py",
    "kind": "source.organizeImports.ruff",
    "title": "Ruff: Organize imports"
  }
]

[Trace - 10:03:08 am] Sending request 'textDocument/codeAction - (16)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 1
    },
    "end": {
      "line": 1,
      "character": 1
    }
  },
  "context": {
    "diagnostics": [
      {
        "range": {
          "start": {
            "line": 0,
            "character": 0
          },
          "end": {
            "line": 4,
            "character": 0
          }
        },
        "message": "Import block is un-sorted or un-formatted",
        "severity": 2,
        "code": "I001",
        "source": "ruff",
        "tags": [],
        "data": {
          "edits": [
            {
              "content": "import ctypes\nimport os\n\n",
              "location": {
                "row": 1,
                "column": 1
              },
              "end_location": {
                "row": 5,
                "column": 1
              }
            }
          ],
          "message": "Organize imports",
          "applicability": "safe"
        }
      },
      {
        "code": "I001",
        "codeDescription": {
          "href": "https://docs.astral.sh/ruff/rules/unsorted-imports"
        },
        "data": {
          "code": "I001",
          "edits": [
            {
              "newText": "import ctypes\nimport os\n\n",
              "range": {
                "end": {
                  "character": 0,
                  "line": 4
                },
                "start": {
                  "character": 0,
                  "line": 0
                }
              }
            }
          ],
          "kind": {
            "body": "Import block is un-sorted or un-formatted",
            "name": "UnsortedImports",
            "suggestion": "Organize imports"
          },
          "noqa_edit": {
            "newText": "  # noqa: I001\n",
            "range": {
              "end": {
                "character": 0,
                "line": 1
              },
              "start": {
                "character": 9,
                "line": 0
              }
            }
          }
        },
        "message": "Import block is un-sorted or un-formatted",
        "range": {
          "end": {
            "character": 0,
            "line": 4
          },
          "start": {
            "character": 0,
            "line": 0
          }
        },
        "severity": 2,
        "source": "Ruff"
      }
    ]
  }
}

[Trace - 10:03:08 am] Sending request 'textDocument/hover - (17)'.
Params: {
  "textDocument": {
    "uri": "file:///home/schica/csic/groupsig/libgroupsig/pygroupsig/pygroupsig/pygroupsig/pairings/utils.py"
  },
  "position": {
    "line": 1,
    "character": 1
  }
}

[Trace - 10:03:08 am] Received notification 'window/showMessage'.
Params: {
  "message": "Ruff encountered a problem. Check the logs for more details.",
  "type": 1
}

[Trace - 10:03:08 am] Received response 'textDocument/codeAction - (16)' in 18ms.
Result: {
  "code": -32603,
  "message": "failed to deserialize diagnostic data: missing field `range`"
}

[Trace - 10:03:08 am] Received response 'textDocument/hover - (17)' in 14ms.
Result: null
jhossbach commented 4 days ago

python-lsp-ruff is different from ruff server (or ruff-lsp), running both at the same time leads to these problems. Please check that you are running either only pylsp with python-lsp-ruff or ruff-lsp/ruff server.

jhossbach commented 4 days ago

This issue should give you more insight: https://github.com/python-lsp/python-lsp-ruff/issues/98

scmanjarrez commented 4 days ago

I'll check it, thank you!

Edit: I'll leave my fix here for future readers. Instead of removing completely the package python-lsp-ruff (which I think is a bit drastic), I just disabled the ruff lsp server from starting in the first place.

(use-package lsp-mode
...
  :config
  (add-to-list 'lsp-disabled-clients 'ruff)
...
)