Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing structure hook for CompletionItem.documentation #102

Closed
alcarney opened this issue Oct 22, 2022 · 0 comments · Fixed by #107
Closed

Missing structure hook for CompletionItem.documentation #102

alcarney opened this issue Oct 22, 2022 · 0 comments · Fixed by #107
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug needs PR

Comments

@alcarney
Copy link
Contributor

alcarney commented Oct 22, 2022

I get the following error while trying to structure a CompletionItem that provides a documentation field

>>> converter.structure(dict(label='example', documentation='This is documented'), CompletionItem)
  + Exception Group Traceback (most recent call last):
  |   File "<stdin>", line 1, in <module>
  |   File "/.../site-packages/cattrs/converters.py", line 309, in structure
  |     return self._structure_func.dispatch(cl)(obj, cl)
  |   File "<cattrs generated structure lsprotocol.types.CompletionItem>", line 117, in structure_CompletionItem
  |     if errors: raise __c_cve('While structuring ' + 'CompletionItem', errors, __cl)
  | cattrs.errors.ClassValidationError: While structuring CompletionItem (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "<cattrs generated structure lsprotocol.types.CompletionItem>", line 35, in structure_CompletionItem
    |     res['documentation'] = __c_structure_documentation(o['documentation'], __c_type_documentation)
    |   File "/.../site-packages/cattrs/converters.py", line 377, in _structure_error
    |     raise StructureHandlerNotFoundError(msg, type_=cl)
    | cattrs.errors.StructureHandlerNotFoundError: Unsupported type: typing.Union[str, lsprotocol.types.MarkupContent, NoneType]. Register a structure hook for it.
    | Structuring class CompletionItem @ attribute documentation
    +------------------------------------
@karthiknadig karthiknadig self-assigned this Oct 24, 2022
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug needs PR and removed triage-needed labels Oct 24, 2022
karthiknadig added a commit that referenced this issue Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug needs PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants