diff --git a/internal/fourslash/baselineutil.go b/internal/fourslash/baselineutil.go index 051b97a9ee..b49fb6b28b 100644 --- a/internal/fourslash/baselineutil.go +++ b/internal/fourslash/baselineutil.go @@ -904,62 +904,5 @@ func codeFence(lang string, code string) string { } func symbolInformationToData(symbol *lsproto.SymbolInformation) string { - var symbolKindToString string - switch symbol.Kind { - case lsproto.SymbolKindFile: - symbolKindToString = "file" - case lsproto.SymbolKindModule: - symbolKindToString = "module" - case lsproto.SymbolKindNamespace: - symbolKindToString = "namespace" - case lsproto.SymbolKindPackage: - symbolKindToString = "package" - case lsproto.SymbolKindClass: - symbolKindToString = "class" - case lsproto.SymbolKindMethod: - symbolKindToString = "method" - case lsproto.SymbolKindProperty: - symbolKindToString = "property" - case lsproto.SymbolKindField: - symbolKindToString = "field" - case lsproto.SymbolKindConstructor: - symbolKindToString = "constructor" - case lsproto.SymbolKindEnum: - symbolKindToString = "enum" - case lsproto.SymbolKindInterface: - symbolKindToString = "interface" - case lsproto.SymbolKindFunction: - symbolKindToString = "function" - case lsproto.SymbolKindVariable: - symbolKindToString = "variable" - case lsproto.SymbolKindConstant: - symbolKindToString = "constant" - case lsproto.SymbolKindString: - symbolKindToString = "string" - case lsproto.SymbolKindNumber: - symbolKindToString = "number" - case lsproto.SymbolKindBoolean: - symbolKindToString = "boolean" - case lsproto.SymbolKindArray: - symbolKindToString = "array" - case lsproto.SymbolKindObject: - symbolKindToString = "object" - case lsproto.SymbolKindKey: - symbolKindToString = "key" - case lsproto.SymbolKindNull: - symbolKindToString = "null" - case lsproto.SymbolKindEnumMember: - symbolKindToString = "enumMember" - case lsproto.SymbolKindStruct: - symbolKindToString = "struct" - case lsproto.SymbolKindEvent: - symbolKindToString = "event" - case lsproto.SymbolKindOperator: - symbolKindToString = "operator" - case lsproto.SymbolKindTypeParameter: - symbolKindToString = "typeParameter" - default: - symbolKindToString = "unknown" - } - return fmt.Sprintf("{| name: %s, kind: %s |}", symbol.Name, symbolKindToString) + return fmt.Sprintf("{| name: %s, kind: %s |}", symbol.Name, symbol.Kind.String()) } diff --git a/internal/lsp/lsproto/_generate/generate.mts b/internal/lsp/lsproto/_generate/generate.mts index 0a488068af..43a78e3a29 100644 --- a/internal/lsp/lsproto/_generate/generate.mts +++ b/internal/lsp/lsproto/_generate/generate.mts @@ -1013,6 +1013,14 @@ function generateCode() { } } + // Helper function to detect if an enum is a bitflag enum + // Hardcoded list of bitflag enums + const bitflagEnums = new Set(["WatchKind"]); + + function isBitflagEnum(enumeration: any): boolean { + return bitflagEnums.has(enumeration.name); + } + // Generate enumerations writeLine("// Enumerations\n"); @@ -1041,6 +1049,8 @@ function generateCode() { const enumValues = enumeration.values.map(value => ({ value: String(value.value), + numericValue: Number(value.value), + name: value.name, identifier: `${enumeration.name}${value.name}`, documentation: value.documentation, deprecated: value.deprecated, @@ -1066,6 +1076,194 @@ function generateCode() { writeLine(")"); writeLine(""); + + // Generate String() method for non-string enums + if (enumeration.type.name !== "string") { + const isBitflag = isBitflagEnum(enumeration); + + if (isBitflag) { + // Generate bitflag-aware String() method using stringer-style efficiency + const sortedValues = [...enumValues].sort((a, b) => a.numericValue - b.numericValue); + const names = sortedValues.map(v => v.name); + const values = sortedValues.map(v => v.numericValue); + + const nameConst = `_${enumeration.name}_name`; + const indexVar = `_${enumeration.name}_index`; + const combinedNames = names.join(""); + + writeLine(`const ${nameConst} = "${combinedNames}"`); + write(`var ${indexVar} = [...]uint16{0`); + let offset = 0; + for (const name of names) { + offset += name.length; + write(`, ${offset}`); + } + writeLine(`}`); + writeLine(""); + + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\tif e == 0 {`); + writeLine(`\t\treturn "0"`); + writeLine(`\t}`); + writeLine(`\tvar parts []string`); + for (let i = 0; i < values.length; i++) { + writeLine(`\tif e&${values[i]} != 0 {`); + writeLine(`\t\tparts = append(parts, ${nameConst}[${indexVar}[${i}]:${indexVar}[${i + 1}]])`); + writeLine(`\t}`); + } + writeLine(`\tif len(parts) == 0 {`); + writeLine(`\t\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`\t}`); + writeLine(`\treturn strings.Join(parts, "|")`); + writeLine(`}`); + writeLine(""); + } + else { + // Generate regular String() method using stringer-style approach + // Split values into runs of contiguous values + const sortedValues = [...enumValues].sort((a, b) => a.numericValue - b.numericValue); + + // Split into runs + const runs: Array<{ names: string[]; values: number[]; }> = []; + let currentRun = { names: [sortedValues[0].name], values: [sortedValues[0].numericValue] }; + + for (let i = 1; i < sortedValues.length; i++) { + if (sortedValues[i].numericValue === sortedValues[i - 1].numericValue + 1) { + currentRun.names.push(sortedValues[i].name); + currentRun.values.push(sortedValues[i].numericValue); + } + else { + runs.push(currentRun); + currentRun = { names: [sortedValues[i].name], values: [sortedValues[i].numericValue] }; + } + } + runs.push(currentRun); + + const nameConst = `_${enumeration.name}_name`; + const indexVar = `_${enumeration.name}_index`; + + if (runs.length === 1) { + // Single contiguous run - simple case + const combinedNames = runs[0].names.join(""); + writeLine(`const ${nameConst} = "${combinedNames}"`); + write(`var ${indexVar} = [...]uint16{0`); + let offset = 0; + for (const name of runs[0].names) { + offset += name.length; + write(`, ${offset}`); + } + writeLine(`}`); + writeLine(""); + + const minVal = runs[0].values[0]; + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\ti := int(e) - ${minVal}`); + // For unsigned types, i can still be negative if e < minVal (due to underflow in conversion) + // So we always need to check both bounds + writeLine(`\tif i < 0 || i >= len(${indexVar})-1 {`); + writeLine(`\t\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`\t}`); + writeLine(`\treturn ${nameConst}[${indexVar}[i]:${indexVar}[i+1]]`); + writeLine(`}`); + writeLine(""); + } + else if (runs.length <= 10) { + // Multiple runs - use switch statement + let allNames = ""; + const runInfo: Array<{ startOffset: number; endOffset: number; minVal: number; maxVal: number; }> = []; + + for (const run of runs) { + const startOffset = allNames.length; + allNames += run.names.join(""); + const endOffset = allNames.length; + runInfo.push({ + startOffset, + endOffset, + minVal: run.values[0], + maxVal: run.values[run.values.length - 1], + }); + } + + writeLine(`const ${nameConst} = "${allNames}"`); + writeLine(""); + + // Generate index variables for each run + for (let i = 0; i < runs.length; i++) { + write(`var ${indexVar}_${i} = [...]uint16{0`); + let offset = 0; + for (const name of runs[i].names) { + offset += name.length; + write(`, ${offset}`); + } + writeLine(`}`); + } + writeLine(""); + + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\tswitch {`); + + for (let i = 0; i < runs.length; i++) { + const run = runs[i]; + const info = runInfo[i]; + + if (run.values.length === 1) { + writeLine(`\tcase e == ${run.values[0]}:`); + writeLine(`\t\treturn ${nameConst}[${info.startOffset}:${info.endOffset}]`); + } + else { + if (info.minVal === 0 && baseType.startsWith("uint")) { + writeLine(`\tcase e <= ${info.maxVal}:`); + } + else if (info.minVal === 0) { + writeLine(`\tcase 0 <= e && e <= ${info.maxVal}:`); + } + else { + writeLine(`\tcase ${info.minVal} <= e && e <= ${info.maxVal}:`); + } + writeLine(`\t\ti := int(e) - ${info.minVal}`); + writeLine(`\t\treturn ${nameConst}[${info.startOffset}+${indexVar}_${i}[i]:${info.startOffset}+${indexVar}_${i}[i+1]]`); + } + } + + writeLine(`\tdefault:`); + writeLine(`\t\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`\t}`); + writeLine(`}`); + writeLine(""); + } + else { + // Too many runs - use a map + let allNames = ""; + const valueMap: Array<{ value: number; startOffset: number; endOffset: number; }> = []; + + for (const run of runs) { + for (let i = 0; i < run.names.length; i++) { + const startOffset = allNames.length; + allNames += run.names[i]; + const endOffset = allNames.length; + valueMap.push({ value: run.values[i], startOffset, endOffset }); + } + } + + writeLine(`const ${nameConst} = "${allNames}"`); + writeLine(""); + writeLine(`var ${enumeration.name}_map = map[${enumeration.name}]string{`); + for (const entry of valueMap) { + writeLine(`\t${entry.value}: ${nameConst}[${entry.startOffset}:${entry.endOffset}],`); + } + writeLine(`}`); + writeLine(""); + + writeLine(`func (e ${enumeration.name}) String() string {`); + writeLine(`\tif str, ok := ${enumeration.name}_map[e]; ok {`); + writeLine(`\t\treturn str`); + writeLine(`\t}`); + writeLine(`\treturn fmt.Sprintf("${enumeration.name}(%d)", e)`); + writeLine(`}`); + writeLine(""); + } + } + } } const requestsAndNotifications: (Request | Notification)[] = [...model.requests, ...model.notifications]; diff --git a/internal/lsp/lsproto/lsp_generated.go b/internal/lsp/lsproto/lsp_generated.go index 39412baab8..8c5585ee62 100644 --- a/internal/lsp/lsproto/lsp_generated.go +++ b/internal/lsp/lsproto/lsp_generated.go @@ -21827,6 +21827,29 @@ const ( ErrorCodesUnknownErrorCode ErrorCodes = -32001 ) +const _ErrorCodes_name = "ParseErrorInternalErrorInvalidParamsMethodNotFoundInvalidRequestServerNotInitializedUnknownErrorCode" + +var ( + _ErrorCodes_index_0 = [...]uint16{0, 10} + _ErrorCodes_index_1 = [...]uint16{0, 13, 26, 40, 54} + _ErrorCodes_index_2 = [...]uint16{0, 20, 36} +) + +func (e ErrorCodes) String() string { + switch { + case e == -32700: + return _ErrorCodes_name[0:10] + case -32603 <= e && e <= -32600: + i := int(e) - -32603 + return _ErrorCodes_name[10+_ErrorCodes_index_1[i] : 10+_ErrorCodes_index_1[i+1]] + case -32002 <= e && e <= -32001: + i := int(e) - -32002 + return _ErrorCodes_name[64+_ErrorCodes_index_2[i] : 64+_ErrorCodes_index_2[i+1]] + default: + return fmt.Sprintf("ErrorCodes(%d)", e) + } +} + type LSPErrorCodes int32 const ( @@ -21857,6 +21880,18 @@ const ( LSPErrorCodesRequestCancelled LSPErrorCodes = -32800 ) +const _LSPErrorCodes_name = "RequestFailedServerCancelledContentModifiedRequestCancelled" + +var _LSPErrorCodes_index = [...]uint16{0, 13, 28, 43, 59} + +func (e LSPErrorCodes) String() string { + i := int(e) - -32803 + if i < 0 || i >= len(_LSPErrorCodes_index)-1 { + return fmt.Sprintf("LSPErrorCodes(%d)", e) + } + return _LSPErrorCodes_name[_LSPErrorCodes_index[i]:_LSPErrorCodes_index[i+1]] +} + // A set of predefined range kinds. type FoldingRangeKind string @@ -21901,6 +21936,18 @@ const ( SymbolKindTypeParameter SymbolKind = 26 ) +const _SymbolKind_name = "FileModuleNamespacePackageClassMethodPropertyFieldConstructorEnumInterfaceFunctionVariableConstantStringNumberBooleanArrayObjectKeyNullEnumMemberStructEventOperatorTypeParameter" + +var _SymbolKind_index = [...]uint16{0, 4, 10, 19, 26, 31, 37, 45, 50, 61, 65, 74, 82, 90, 98, 104, 110, 117, 122, 128, 131, 135, 145, 151, 156, 164, 177} + +func (e SymbolKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_SymbolKind_index)-1 { + return fmt.Sprintf("SymbolKind(%d)", e) + } + return _SymbolKind_name[_SymbolKind_index[i]:_SymbolKind_index[i+1]] +} + // Symbol tags are extra annotations that tweak the rendering of a symbol. // // Since: 3.16 @@ -21911,6 +21958,18 @@ const ( SymbolTagDeprecated SymbolTag = 1 ) +const _SymbolTag_name = "Deprecated" + +var _SymbolTag_index = [...]uint16{0, 10} + +func (e SymbolTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_SymbolTag_index)-1 { + return fmt.Sprintf("SymbolTag(%d)", e) + } + return _SymbolTag_name[_SymbolTag_index[i]:_SymbolTag_index[i+1]] +} + // Moniker uniqueness level to define scope of the moniker. // // Since: 3.16.0 @@ -21956,6 +22015,18 @@ const ( InlayHintKindParameter InlayHintKind = 2 ) +const _InlayHintKind_name = "TypeParameter" + +var _InlayHintKind_index = [...]uint16{0, 4, 13} + +func (e InlayHintKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InlayHintKind_index)-1 { + return fmt.Sprintf("InlayHintKind(%d)", e) + } + return _InlayHintKind_name[_InlayHintKind_index[i]:_InlayHintKind_index[i+1]] +} + // The message type type MessageType uint32 @@ -21976,6 +22047,18 @@ const ( MessageTypeDebug MessageType = 5 ) +const _MessageType_name = "ErrorWarningInfoLogDebug" + +var _MessageType_index = [...]uint16{0, 5, 12, 16, 19, 24} + +func (e MessageType) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_MessageType_index)-1 { + return fmt.Sprintf("MessageType(%d)", e) + } + return _MessageType_name[_MessageType_index[i]:_MessageType_index[i+1]] +} + // Defines how the host (editor) should sync // document changes to the language server. type TextDocumentSyncKind uint32 @@ -21992,6 +22075,18 @@ const ( TextDocumentSyncKindIncremental TextDocumentSyncKind = 2 ) +const _TextDocumentSyncKind_name = "NoneFullIncremental" + +var _TextDocumentSyncKind_index = [...]uint16{0, 4, 8, 19} + +func (e TextDocumentSyncKind) String() string { + i := int(e) - 0 + if i < 0 || i >= len(_TextDocumentSyncKind_index)-1 { + return fmt.Sprintf("TextDocumentSyncKind(%d)", e) + } + return _TextDocumentSyncKind_name[_TextDocumentSyncKind_index[i]:_TextDocumentSyncKind_index[i+1]] +} + // Represents reasons why a text document is saved. type TextDocumentSaveReason uint32 @@ -22005,6 +22100,18 @@ const ( TextDocumentSaveReasonFocusOut TextDocumentSaveReason = 3 ) +const _TextDocumentSaveReason_name = "ManualAfterDelayFocusOut" + +var _TextDocumentSaveReason_index = [...]uint16{0, 6, 16, 24} + +func (e TextDocumentSaveReason) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_TextDocumentSaveReason_index)-1 { + return fmt.Sprintf("TextDocumentSaveReason(%d)", e) + } + return _TextDocumentSaveReason_name[_TextDocumentSaveReason_index[i]:_TextDocumentSaveReason_index[i+1]] +} + // The kind of a completion entry. type CompletionItemKind uint32 @@ -22036,6 +22143,18 @@ const ( CompletionItemKindTypeParameter CompletionItemKind = 25 ) +const _CompletionItemKind_name = "TextMethodFunctionConstructorFieldVariableClassInterfaceModulePropertyUnitValueEnumKeywordSnippetColorFileReferenceFolderEnumMemberConstantStructEventOperatorTypeParameter" + +var _CompletionItemKind_index = [...]uint16{0, 4, 10, 18, 29, 34, 42, 47, 56, 62, 70, 74, 79, 83, 90, 97, 102, 106, 115, 121, 131, 139, 145, 150, 158, 171} + +func (e CompletionItemKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CompletionItemKind_index)-1 { + return fmt.Sprintf("CompletionItemKind(%d)", e) + } + return _CompletionItemKind_name[_CompletionItemKind_index[i]:_CompletionItemKind_index[i+1]] +} + // Completion item tags are extra annotations that tweak the rendering of a completion // item. // @@ -22047,6 +22166,18 @@ const ( CompletionItemTagDeprecated CompletionItemTag = 1 ) +const _CompletionItemTag_name = "Deprecated" + +var _CompletionItemTag_index = [...]uint16{0, 10} + +func (e CompletionItemTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CompletionItemTag_index)-1 { + return fmt.Sprintf("CompletionItemTag(%d)", e) + } + return _CompletionItemTag_name[_CompletionItemTag_index[i]:_CompletionItemTag_index[i+1]] +} + // Defines whether the insert text in a completion item should be interpreted as // plain text or a snippet. type InsertTextFormat uint32 @@ -22065,6 +22196,18 @@ const ( InsertTextFormatSnippet InsertTextFormat = 2 ) +const _InsertTextFormat_name = "PlainTextSnippet" + +var _InsertTextFormat_index = [...]uint16{0, 9, 16} + +func (e InsertTextFormat) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InsertTextFormat_index)-1 { + return fmt.Sprintf("InsertTextFormat(%d)", e) + } + return _InsertTextFormat_name[_InsertTextFormat_index[i]:_InsertTextFormat_index[i+1]] +} + // How whitespace and indentation is handled during completion // item insertion. // @@ -22088,6 +22231,18 @@ const ( InsertTextModeadjustIndentation InsertTextMode = 2 ) +const _InsertTextMode_name = "asIsadjustIndentation" + +var _InsertTextMode_index = [...]uint16{0, 4, 21} + +func (e InsertTextMode) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InsertTextMode_index)-1 { + return fmt.Sprintf("InsertTextMode(%d)", e) + } + return _InsertTextMode_name[_InsertTextMode_index[i]:_InsertTextMode_index[i+1]] +} + // A document highlight kind. type DocumentHighlightKind uint32 @@ -22100,6 +22255,18 @@ const ( DocumentHighlightKindWrite DocumentHighlightKind = 3 ) +const _DocumentHighlightKind_name = "TextReadWrite" + +var _DocumentHighlightKind_index = [...]uint16{0, 4, 8, 13} + +func (e DocumentHighlightKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_DocumentHighlightKind_index)-1 { + return fmt.Sprintf("DocumentHighlightKind(%d)", e) + } + return _DocumentHighlightKind_name[_DocumentHighlightKind_index[i]:_DocumentHighlightKind_index[i+1]] +} + // A set of predefined code action kinds type CodeActionKind string @@ -22183,6 +22350,18 @@ const ( CodeActionTagLLMGenerated CodeActionTag = 1 ) +const _CodeActionTag_name = "LLMGenerated" + +var _CodeActionTag_index = [...]uint16{0, 12} + +func (e CodeActionTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CodeActionTag_index)-1 { + return fmt.Sprintf("CodeActionTag(%d)", e) + } + return _CodeActionTag_name[_CodeActionTag_index[i]:_CodeActionTag_index[i+1]] +} + type TraceValue string const ( @@ -22300,6 +22479,18 @@ const ( InlineCompletionTriggerKindAutomatic InlineCompletionTriggerKind = 2 ) +const _InlineCompletionTriggerKind_name = "InvokedAutomatic" + +var _InlineCompletionTriggerKind_index = [...]uint16{0, 7, 16} + +func (e InlineCompletionTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_InlineCompletionTriggerKind_index)-1 { + return fmt.Sprintf("InlineCompletionTriggerKind(%d)", e) + } + return _InlineCompletionTriggerKind_name[_InlineCompletionTriggerKind_index[i]:_InlineCompletionTriggerKind_index[i+1]] +} + // A set of predefined position encoding kinds. // // Since: 3.17.0 @@ -22333,6 +22524,18 @@ const ( FileChangeTypeDeleted FileChangeType = 3 ) +const _FileChangeType_name = "CreatedChangedDeleted" + +var _FileChangeType_index = [...]uint16{0, 7, 14, 21} + +func (e FileChangeType) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_FileChangeType_index)-1 { + return fmt.Sprintf("FileChangeType(%d)", e) + } + return _FileChangeType_name[_FileChangeType_index[i]:_FileChangeType_index[i+1]] +} + type WatchKind uint32 const ( @@ -22344,6 +22547,30 @@ const ( WatchKindDelete WatchKind = 4 ) +const _WatchKind_name = "CreateChangeDelete" + +var _WatchKind_index = [...]uint16{0, 6, 12, 18} + +func (e WatchKind) String() string { + if e == 0 { + return "0" + } + var parts []string + if e&1 != 0 { + parts = append(parts, _WatchKind_name[_WatchKind_index[0]:_WatchKind_index[1]]) + } + if e&2 != 0 { + parts = append(parts, _WatchKind_name[_WatchKind_index[1]:_WatchKind_index[2]]) + } + if e&4 != 0 { + parts = append(parts, _WatchKind_name[_WatchKind_index[2]:_WatchKind_index[3]]) + } + if len(parts) == 0 { + return fmt.Sprintf("WatchKind(%d)", e) + } + return strings.Join(parts, "|") +} + // The diagnostic's severity. type DiagnosticSeverity uint32 @@ -22358,6 +22585,18 @@ const ( DiagnosticSeverityHint DiagnosticSeverity = 4 ) +const _DiagnosticSeverity_name = "ErrorWarningInformationHint" + +var _DiagnosticSeverity_index = [...]uint16{0, 5, 12, 23, 27} + +func (e DiagnosticSeverity) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_DiagnosticSeverity_index)-1 { + return fmt.Sprintf("DiagnosticSeverity(%d)", e) + } + return _DiagnosticSeverity_name[_DiagnosticSeverity_index[i]:_DiagnosticSeverity_index[i+1]] +} + // The diagnostic tags. // // Since: 3.15.0 @@ -22375,6 +22614,18 @@ const ( DiagnosticTagDeprecated DiagnosticTag = 2 ) +const _DiagnosticTag_name = "UnnecessaryDeprecated" + +var _DiagnosticTag_index = [...]uint16{0, 11, 21} + +func (e DiagnosticTag) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_DiagnosticTag_index)-1 { + return fmt.Sprintf("DiagnosticTag(%d)", e) + } + return _DiagnosticTag_name[_DiagnosticTag_index[i]:_DiagnosticTag_index[i+1]] +} + // How a completion was triggered type CompletionTriggerKind uint32 @@ -22389,6 +22640,18 @@ const ( CompletionTriggerKindTriggerForIncompleteCompletions CompletionTriggerKind = 3 ) +const _CompletionTriggerKind_name = "InvokedTriggerCharacterTriggerForIncompleteCompletions" + +var _CompletionTriggerKind_index = [...]uint16{0, 7, 23, 54} + +func (e CompletionTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CompletionTriggerKind_index)-1 { + return fmt.Sprintf("CompletionTriggerKind(%d)", e) + } + return _CompletionTriggerKind_name[_CompletionTriggerKind_index[i]:_CompletionTriggerKind_index[i+1]] +} + // Defines how values from a set of defaults and an individual item will be // merged. // @@ -22406,6 +22669,18 @@ const ( ApplyKindMerge ApplyKind = 2 ) +const _ApplyKind_name = "ReplaceMerge" + +var _ApplyKind_index = [...]uint16{0, 7, 12} + +func (e ApplyKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_ApplyKind_index)-1 { + return fmt.Sprintf("ApplyKind(%d)", e) + } + return _ApplyKind_name[_ApplyKind_index[i]:_ApplyKind_index[i+1]] +} + // How a signature help was triggered. // // Since: 3.15.0 @@ -22420,6 +22695,18 @@ const ( SignatureHelpTriggerKindContentChange SignatureHelpTriggerKind = 3 ) +const _SignatureHelpTriggerKind_name = "InvokedTriggerCharacterContentChange" + +var _SignatureHelpTriggerKind_index = [...]uint16{0, 7, 23, 36} + +func (e SignatureHelpTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_SignatureHelpTriggerKind_index)-1 { + return fmt.Sprintf("SignatureHelpTriggerKind(%d)", e) + } + return _SignatureHelpTriggerKind_name[_SignatureHelpTriggerKind_index[i]:_SignatureHelpTriggerKind_index[i+1]] +} + // The reason why code actions were requested. // // Since: 3.17.0 @@ -22435,6 +22722,18 @@ const ( CodeActionTriggerKindAutomatic CodeActionTriggerKind = 2 ) +const _CodeActionTriggerKind_name = "InvokedAutomatic" + +var _CodeActionTriggerKind_index = [...]uint16{0, 7, 16} + +func (e CodeActionTriggerKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_CodeActionTriggerKind_index)-1 { + return fmt.Sprintf("CodeActionTriggerKind(%d)", e) + } + return _CodeActionTriggerKind_name[_CodeActionTriggerKind_index[i]:_CodeActionTriggerKind_index[i+1]] +} + // A pattern kind describing if a glob pattern matches a file a folder or // both. // @@ -22460,6 +22759,18 @@ const ( NotebookCellKindCode NotebookCellKind = 2 ) +const _NotebookCellKind_name = "MarkupCode" + +var _NotebookCellKind_index = [...]uint16{0, 6, 10} + +func (e NotebookCellKind) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_NotebookCellKind_index)-1 { + return fmt.Sprintf("NotebookCellKind(%d)", e) + } + return _NotebookCellKind_name[_NotebookCellKind_index[i]:_NotebookCellKind_index[i+1]] +} + type ResourceOperationKind string const ( @@ -22497,6 +22808,18 @@ const ( PrepareSupportDefaultBehaviorIdentifier PrepareSupportDefaultBehavior = 1 ) +const _PrepareSupportDefaultBehavior_name = "Identifier" + +var _PrepareSupportDefaultBehavior_index = [...]uint16{0, 10} + +func (e PrepareSupportDefaultBehavior) String() string { + i := int(e) - 1 + if i < 0 || i >= len(_PrepareSupportDefaultBehavior_index)-1 { + return fmt.Sprintf("PrepareSupportDefaultBehavior(%d)", e) + } + return _PrepareSupportDefaultBehavior_name[_PrepareSupportDefaultBehavior_index[i]:_PrepareSupportDefaultBehavior_index[i+1]] +} + type TokenFormat string const ( diff --git a/testdata/baselines/reference/fourslash/state/declarationMapsWorkspaceSymbols.baseline b/testdata/baselines/reference/fourslash/state/declarationMapsWorkspaceSymbols.baseline index e633640e55..27ef54e300 100644 --- a/testdata/baselines/reference/fourslash/state/declarationMapsWorkspaceSymbols.baseline +++ b/testdata/baselines/reference/fourslash/state/declarationMapsWorkspaceSymbols.baseline @@ -144,20 +144,20 @@ Config:: // === workspaceSymbol === // === /a/a.ts === -// export function [|{| name: fnA, kind: function |}fnA|]() {} +// export function [|{| name: fnA, kind: Function |}fnA|]() {} // export interface IfaceA {} // export const instanceA: IfaceA = {}; // === /b/b.ts === -// export function [|{| name: fnB, kind: function |}fnB|]() {} +// export function [|{| name: fnB, kind: Function |}fnB|]() {} // === /b/c.ts === -// export function [|{| name: fnC, kind: function |}fnC|]() {} +// export function [|{| name: fnC, kind: Function |}fnC|]() {} // === /user/user.ts === // import * as a from "../a/a"; // import * as b from "../b/b"; -// export function [|{| name: fnUser, kind: function |}fnUser|]() { +// export function [|{| name: fnUser, kind: Function |}fnUser|]() { // a.fnA(); // b.fnB(); // a.instanceA;