Skip to content

Commit b0ae690

Browse files
committed
Fix: LSP allows kind to be omitted, so support that
1 parent 930517f commit b0ae690

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/openapi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ definitions:
720720
kind:
721721
type: string
722722
enum:
723+
- Unknown
723724
- Type
724725
- Parameter
725726
- Enum

ycmd/completers/language_server/language_server_completer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,8 +1612,13 @@ def BuildLabel( label_or_labels ):
16121612
return label_or_labels
16131613

16141614
def BuildInlayHint( inlay_hint: dict ):
1615+
try:
1616+
kind = lsp.INLAY_HINT_KIND[ inlay_hint[ 'kind' ] ]
1617+
except KeyError:
1618+
kind = 'Unknown'
1619+
16151620
return {
1616-
'kind': lsp.INLAY_HINT_KIND[ inlay_hint[ 'kind' ] ],
1621+
'kind': kind,
16171622
'position': responses.BuildLocationData(
16181623
_BuildLocationAndDescription(
16191624
request_data[ 'filepath' ],

0 commit comments

Comments
 (0)