From 461d2da9ef195625a6e0ca367d43a02ff658d962 Mon Sep 17 00:00:00 2001 From: Chris Leary Date: Fri, 23 Aug 2024 17:17:03 -0700 Subject: [PATCH] Add support for inlay hint objects in LSP generation. --- common/lsp/lsp-protocol-enums.h | 7 +++++++ common/lsp/lsp-protocol.yaml | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/common/lsp/lsp-protocol-enums.h b/common/lsp/lsp-protocol-enums.h index 6d80bf716..f51117cb1 100644 --- a/common/lsp/lsp-protocol-enums.h +++ b/common/lsp/lsp-protocol-enums.h @@ -63,6 +63,13 @@ enum SymbolKind { kOperator = 25, kTypeParameter = 26, }; + +// These are the InlayHintKinds defined by the LSP specification. +// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#inlayHintKind +enum InlayHintKind { + kType = 1, + kParameter = 2, +}; } // namespace lsp } // namespace verible #endif // COMMON_LSP_LSP_PROTOCOL_ENUMS_H diff --git a/common/lsp/lsp-protocol.yaml b/common/lsp/lsp-protocol.yaml index 24735bca4..3210ea95e 100644 --- a/common/lsp/lsp-protocol.yaml +++ b/common/lsp/lsp-protocol.yaml @@ -216,3 +216,16 @@ RenameParams: # Response: Range[] +# -- textDocument/inlayHint +InlayHintParams: + textDocument: TextDocumentIdentifier + range: Range + +InlayHint: + position: Position + label: string + kind?: integer # InlayHintKind enum + tooltip?: string + paddingLeft?: boolean + paddingRight?: boolean +