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

Support LSP Inlay Hints in protocol specification #381

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
@serdeOptional 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
Loading