Skip to content

Commit

Permalink
Support LSP Inlay Hints in protocol specification
Browse files Browse the repository at this point in the history
Acked-by: Per Nordlöw <[email protected]>
  • Loading branch information
nordlow committed Dec 3, 2024
1 parent 0339545 commit e35f488
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions protocol/source/served/lsp/protocol.d
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,7 @@ struct ServerCapabilities
@serdeOptional Variant!(void, bool, ReferenceOptions) referencesProvider;
@serdeOptional Variant!(void, bool, DocumentHighlightOptions) documentHighlightProvider;
@serdeOptional Variant!(void, bool, DocumentSymbolOptions) documentSymbolProvider;
@serdeOptional Variant!(void, bool, InlayHintOptions) inlayHintProvider;
@serdeOptional Variant!(void, bool, CodeActionOptions) codeActionProvider;
@serdeOptional Variant!(void, CodeLensOptions) codeLensProvider;
@serdeOptional Variant!(void, DocumentLinkOptions) documentLinkProvider;
Expand Down Expand Up @@ -3085,6 +3086,43 @@ struct ReferenceParams
ReferenceContext context;
}

@serdeFallbackStruct
@allowedMethods("textDocument/inlayHint")
struct InlayHintParams
{
TextDocumentIdentifier textDocument;
TextRange range;
}

@serdeFallbackStruct
struct InlayHint
{
Position position;
Variant!(string, InlayHintLabelPart[]) label;
@serdeOptional Optional!InlayHintKind kind;
@serdeOptional Optional!(TextEdit[]) textEdits;
@serdeOptional Variant!(void, string, MarkupContent) tooltip;
@serdeOptional Optional!(bool) paddingLeft;
@serdeOptional Optional!(bool) paddingRight;
OptionalJsonValue data;
}

@serdeEnumProxy!uint
enum InlayHintKind
{
type = 1,
parameter = 2,
}

@serdeFallbackStruct
struct InlayHintLabelPart
{
string value;
@serdeOptional Variant!(void, string, MarkupContent) tooltip;
@serdeOptional Optional!Location location;
@serdeOptional Optional!Command command;
}

@serdeFallbackStruct
struct ReferenceContext
{
Expand Down Expand Up @@ -3151,6 +3189,13 @@ struct DocumentSymbolOptions
@serdeOptional Optional!string label;
}

@serdeFallbackStruct
struct InlayHintOptions
{
mixin WorkDoneProgressOptions;
@serdeOptional Optional!bool resolveProvider;
}

@serdeFallbackStruct
struct DocumentSymbolRegistrationOptions
{
Expand Down

0 comments on commit e35f488

Please sign in to comment.