From dd36be1516842d31d65e25e3fed32987489c068f Mon Sep 17 00:00:00 2001 From: Dylan Strohschein Date: Wed, 2 Apr 2025 22:56:43 -0400 Subject: [PATCH 1/5] Update lsp generation for more accurate documentation --- internal/lsp/lsproto/_generate/generate.mjs | 99 +++++++++++++++++---- internal/lsp/lsproto/lsp_generated.go | 93 ++++++++++--------- 2 files changed, 129 insertions(+), 63 deletions(-) diff --git a/internal/lsp/lsproto/_generate/generate.mjs b/internal/lsp/lsproto/_generate/generate.mjs index 4526824a31..20f797aac9 100644 --- a/internal/lsp/lsproto/_generate/generate.mjs +++ b/internal/lsp/lsproto/_generate/generate.mjs @@ -67,12 +67,13 @@ function writeDocumentation(doc) { for (let line of lines) { line = line.replace(/(\w ) +/g, "$1"); line = line.replace(/\{@link(?:code)?.*?([^} ]+)\}/g, "$1"); - line = line.replace(/@since (.*)/g, "Since: $1\n//"); - if (line.startsWith("@deprecated")) { - continue; - } - if (line.startsWith("@proposed")) { - line = "Proposed.\n//"; + + if ( + line.includes("@since") || + line.startsWith("@deprecated") || + line.startsWith("@proposed") + ) { + break; } write("// "); @@ -81,14 +82,68 @@ function writeDocumentation(doc) { } } +/** + * @param {boolean | undefined} proposed + */ +function writeProposed(proposed) { + if (proposed) { + writeLine("// ") + writeLine("// Proposed.") + } +} + +/** + * @param {string | undefined} since + * @param {string[] | undefined} sinceTags + */ +function writeSince(since, sinceTags) { + if (since && !sinceTags) { + const sinceLines = since.split('\n') + writeSinceLines(sinceLines); + } else if (sinceTags) { + for (const [idx, sinceTag] of sinceTags.entries()) { + const sinceLines = sinceTag.split('\n') + writeSinceLines(sinceLines); + + if (idx !== sinceTags.length - 1) { + writeLine("// "); + } + } + } +} + +/** + * @param {string[]} sinceLines + */ +function writeSinceLines(sinceLines) { + writeLine(`// Since: ${sinceLines[0]}`); + + for (let i = 1; i < sinceLines.length; i++) { + writeLine(`// ${sinceLines[i]}`); + } +} + /** * @param {string | undefined} deprecated + * @param {string | undefined} doc */ -function writeDeprecation(deprecated) { +function writeDeprecation(deprecated, doc) { + const inlineDeprication = "is deprecated @since" + if (deprecated) { - writeLine("//"); + writeLine("// "); write("// Deprecated: "); writeLine(deprecated); + } else if (doc?.includes(inlineDeprication)) { + const lines = doc.split('\n'); + const matchingLine = lines.find(x => x.includes(inlineDeprication)); + + if (matchingLine) { + const depricationMessage = matchingLine.split(" @since")[0]; + writeLine("// "); + write("// Deprecated: "); + writeLine(depricationMessage); + } } } @@ -302,7 +357,9 @@ writeLine("// Structures\n"); for (const t of model.structures) { writeDocumentation(t.documentation); - writeDeprecation(t.deprecated); + writeSince(t.since, t.sinceTags); + writeProposed(t.proposed); + writeDeprecation(t.deprecated, t.documentation); writeLine("type " + t.name + " struct {"); @@ -325,7 +382,9 @@ for (const t of model.structures) { for (const p of t.properties) { writeDocumentation(p.documentation); - writeDeprecation(p.deprecated); + writeSince(p.since, p.sinceTags); + writeProposed(p.proposed); + writeDeprecation(p.deprecated, p.documentation); write(titleCase(p.name) + " "); @@ -351,7 +410,9 @@ writeLine("// Enumerations\n"); for (const t of model.enumerations) { writeDocumentation(t.documentation); - writeDeprecation(t.deprecated); + writeSince(t.since, t.sinceTags); + writeProposed(t.proposed); + writeDeprecation(t.deprecated, t.documentation); /** @type {string} */ let underlyingType; @@ -381,7 +442,9 @@ for (const t of model.enumerations) { writeLine("const ("); for (const v of t.values) { writeDocumentation(v.documentation); - writeDeprecation(v.deprecated); + writeSince(v.since, v.sinceTags); + writeProposed(v.proposed); + writeDeprecation(v.deprecated, v.documentation); write(t.name); write(v.name); @@ -409,7 +472,9 @@ writeLine("// Type aliases\n"); for (const t of model.typeAliases) { writeDocumentation(t.documentation); - writeDeprecation(t.deprecated); + writeSince(t.since, t.sinceTags); + writeProposed(t.proposed); + writeDeprecation(t.deprecated, t.documentation); if (t.name === "LSPAny") { writeLine("type LSPAny = any\n"); @@ -453,7 +518,9 @@ writeLine("// Requests"); writeLine("const ("); for (const t of model.requests) { writeDocumentation(t.documentation); - writeDeprecation(t.deprecated); + writeSince(t.since, t.sinceTags); + writeProposed(t.proposed); + writeDeprecation(t.deprecated, t.documentation); writeLine("Method" + methodNameToIdentifier(t.method) + ' Method = "' + t.method + '"'); } writeLine(")\n"); @@ -462,7 +529,9 @@ writeLine("// Notifications"); writeLine("const ("); for (const t of model.notifications) { writeDocumentation(t.documentation); - writeDeprecation(t.deprecated); + writeSince(t.since, t.sinceTags); + writeProposed(t.proposed); + writeDeprecation(t.deprecated, t.documentation); writeLine("Method" + methodNameToIdentifier(t.method) + ' Method = "' + t.method + '"'); } writeLine(")\n"); diff --git a/internal/lsp/lsproto/lsp_generated.go b/internal/lsp/lsproto/lsp_generated.go index 89efd78676..1db874a269 100644 --- a/internal/lsp/lsproto/lsp_generated.go +++ b/internal/lsp/lsproto/lsp_generated.go @@ -821,14 +821,14 @@ type DidChangeNotebookDocumentParams struct { // The changes describe single state changes to the notebook document. // So if there are two changes c1 (at array index 0) and c2 (at array // index 1) for a notebook in state S then c1 moves the notebook from - // S to S' and c2 from S' to S”. So c1 is computed on the state S and + // S to S' and c2 from S' to S''. So c1 is computed on the state S and // c2 is computed on the state S'. // // To mirror the content of a notebook using change events use the following approach: - // - start with the same initial content - // - apply the 'notebookDocument/didChange' notifications in the order you receive them. - // - apply the `NotebookChangeEvent`s in a single notification in the order - // you receive them. + // - start with the same initial content + // - apply the 'notebookDocument/didChange' notifications in the order you receive them. + // - apply the `NotebookChangeEvent`s in a single notification in the order + // you receive them. Change NotebookDocumentChangeEvent `json:"change"` } @@ -1046,14 +1046,14 @@ type DidChangeTextDocumentParams struct { // The actual content changes. The content changes describe single state changes // to the document. So if there are two content changes c1 (at array index 0) and // c2 (at array index 1) for a document in state S then c1 moves the document from - // S to S' and c2 from S' to S”. So c1 is computed on the state S and c2 is computed + // S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed // on the state S'. // // To mirror the content of a document using change events use the following approach: - // - start with the same initial content - // - apply the 'textDocument/didChange' notifications in the order you receive them. - // - apply the `TextDocumentContentChangeEvent`s in a single notification in the order - // you receive them. + // - start with the same initial content + // - apply the 'textDocument/didChange' notifications in the order you receive them. + // - apply the `TextDocumentContentChangeEvent`s in a single notification in the order + // you receive them. ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"` } @@ -1485,6 +1485,7 @@ type SymbolInformation struct { // Indicates if this symbol is deprecated. // + // // Deprecated: Use tags instead Deprecated *bool `json:"deprecated,omitempty"` @@ -1522,6 +1523,7 @@ type DocumentSymbol struct { // Indicates if this symbol is deprecated. // + // // Deprecated: Use tags instead Deprecated *bool `json:"deprecated,omitempty"` @@ -2056,12 +2058,10 @@ type LocationLink struct { // character(s) then use an end position denoting the start of the next line. // For example: // ```ts -// -// { -// start: { line: 5, character: 23 } -// end : { line 6, character : 0 } -// } -// +// { +// start: { line: 5, character: 23 } +// end : { line 6, character : 0 } +// } // ``` type Range struct { // The range's start position. @@ -2236,11 +2236,9 @@ type TextDocumentEdit struct { // The edits to be applied. // // Since: 3.16.0 - support for AnnotatedTextEdit. This is guarded using a - // // client capability. // // Since: 3.18.0 - support for SnippetTextEdit. This is guarded using a - // // client capability. Edits []TextEditOrAnnotatedTextEditOrSnippetTextEdit `json:"edits"` } @@ -2449,18 +2447,16 @@ type InlayHintLabelPart struct { // // Here is an example how such a string can be constructed using JavaScript / TypeScript: // ```ts -// -// let markdown: MarkdownContent = { -// kind: MarkupKind.Markdown, -// value: [ -// '# Header', -// 'Some text', -// '```typescript', -// 'someCode();', -// '```' -// ].join('\n') -// }; -// +// let markdown: MarkdownContent = { +// kind: MarkupKind.Markdown, +// value: [ +// '# Header', +// 'Some text', +// '```typescript', +// 'someCode();', +// '```' +// ].join('\n') +// }; // ``` // // *Please Note* that clients might sanitize the return markdown. A client could decide to @@ -2778,6 +2774,7 @@ type _InitializeParams struct { // The rootPath of the workspace. Is null // if no folder is open. // + // // Deprecated: in favour of rootUri. RootPath *Nullable[string] `json:"rootPath,omitempty"` @@ -2785,6 +2782,7 @@ type _InitializeParams struct { // folder is open. If both `rootPath` and `rootUri` are set // `rootUri` wins. // + // // Deprecated: in favour of workspaceFolders. RootUri *DocumentUri `json:"rootUri"` @@ -3176,13 +3174,13 @@ type CompletionItemApplyKinds struct { // `completionList.itemDefaults.data` and the completion's own data // using the following rules: // - // - If a completion's `data` field is not provided (or `null`), the - // entire `data` field from `completionList.itemDefaults.data` will be - // used as-is. - // - If a completion's `data` field is provided, each field will - // overwrite the field of the same name in - // `completionList.itemDefaults.data` but no merging of nested fields - // within that value will occur. + // - If a completion's `data` field is not provided (or `null`), the + // entire `data` field from `completionList.itemDefaults.data` will be + // used as-is. + // - If a completion's `data` field is provided, each field will + // overwrite the field of the same name in + // `completionList.itemDefaults.data` but no merging of nested fields + // within that value will occur. // // Since: 3.18.0 Data *ApplyKind `json:"data,omitempty"` @@ -3397,10 +3395,10 @@ type CodeActionOptions struct { // // Documentation from the provider should be shown in the code actions menu if either: // - // - Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that - // most closely matches the requested code action kind. For example, if a provider has documentation for - // both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`, - // the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`. + // - Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that + // most closely matches the requested code action kind. For example, if a provider has documentation for + // both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`, + // the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`. // // - Any code actions of `kind` are returned by the provider. // @@ -3851,6 +3849,7 @@ type TextDocumentContentChangePartial struct { // The optional length of the range that got replaced. // + // // Deprecated: use range instead. RangeLength *uint32 `json:"rangeLength,omitempty"` @@ -4373,7 +4372,6 @@ type TextDocumentFilterLanguage struct { // A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. // // Since: 3.18.0 - support for relative patterns. Whether clients support - // // relative patterns depends on the client capability // `textDocuments.filters.relativePatternSupport`. Pattern *GlobPattern `json:"pattern,omitempty"` @@ -4392,7 +4390,6 @@ type TextDocumentFilterScheme struct { // A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. // // Since: 3.18.0 - support for relative patterns. Whether clients support - // // relative patterns depends on the client capability // `textDocuments.filters.relativePatternSupport`. Pattern *GlobPattern `json:"pattern,omitempty"` @@ -4411,7 +4408,6 @@ type TextDocumentFilterPattern struct { // A glob pattern, like **​/*.{ts,js}. See TextDocumentFilter for examples. // // Since: 3.18.0 - support for relative patterns. Whether clients support - // // relative patterns depends on the client capability // `textDocuments.filters.relativePatternSupport`. Pattern GlobPattern `json:"pattern"` @@ -6733,7 +6729,9 @@ type PrepareRenameResult = RangeOrPrepareRenamePlaceholderOrPrepareRenameDefault // // @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`; // -// The use of a string as a document filter is deprecated Since: 3.16.0. +// Since: 3.16.0. +// +// Deprecated: The use of a string as a document filter is deprecated type DocumentSelector = []DocumentFilter type ProgressToken = IntegerOrString @@ -7152,9 +7150,8 @@ const ( // resolves to such. // // Since: 3.17.0 - support for WorkspaceSymbol in the returned data. Clients - // - // need to advertise support for WorkspaceSymbols via the client capability - // `workspace.symbol.resolveSupport`. + // need to advertise support for WorkspaceSymbols via the client capability + // `workspace.symbol.resolveSupport`. MethodWorkspaceSymbol Method = "workspace/symbol" // A request to resolve the range inside the workspace // symbol's location. From e146334ca0cc6b2f426691b118565c6938c4702c Mon Sep 17 00:00:00 2001 From: Dylan Strohschein Date: Thu, 3 Apr 2025 06:31:05 -0400 Subject: [PATCH 2/5] format file --- internal/lsp/lsproto/_generate/generate.mjs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/lsp/lsproto/_generate/generate.mjs b/internal/lsp/lsproto/_generate/generate.mjs index 20f797aac9..9844e63b3c 100644 --- a/internal/lsp/lsproto/_generate/generate.mjs +++ b/internal/lsp/lsproto/_generate/generate.mjs @@ -87,8 +87,8 @@ function writeDocumentation(doc) { */ function writeProposed(proposed) { if (proposed) { - writeLine("// ") - writeLine("// Proposed.") + writeLine("// "); + writeLine("// Proposed."); } } @@ -98,11 +98,12 @@ function writeProposed(proposed) { */ function writeSince(since, sinceTags) { if (since && !sinceTags) { - const sinceLines = since.split('\n') + const sinceLines = since.split("\n"); writeSinceLines(sinceLines); - } else if (sinceTags) { + } + else if (sinceTags) { for (const [idx, sinceTag] of sinceTags.entries()) { - const sinceLines = sinceTag.split('\n') + const sinceLines = sinceTag.split("\n"); writeSinceLines(sinceLines); if (idx !== sinceTags.length - 1) { @@ -128,14 +129,15 @@ function writeSinceLines(sinceLines) { * @param {string | undefined} doc */ function writeDeprecation(deprecated, doc) { - const inlineDeprication = "is deprecated @since" + const inlineDeprication = "is deprecated @since"; if (deprecated) { writeLine("// "); write("// Deprecated: "); writeLine(deprecated); - } else if (doc?.includes(inlineDeprication)) { - const lines = doc.split('\n'); + } + else if (doc?.includes(inlineDeprication)) { + const lines = doc.split("\n"); const matchingLine = lines.find(x => x.includes(inlineDeprication)); if (matchingLine) { From 690bde3a3f18c1335a39d3c8e219f503377f53c8 Mon Sep 17 00:00:00 2001 From: Dylan Strohschein Date: Thu, 3 Apr 2025 06:47:48 -0400 Subject: [PATCH 3/5] condense repeated function calls --- internal/lsp/lsproto/_generate/generate.mjs | 51 +++++++++------------ 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/internal/lsp/lsproto/_generate/generate.mjs b/internal/lsp/lsproto/_generate/generate.mjs index 9844e63b3c..7bd0baedc7 100644 --- a/internal/lsp/lsproto/_generate/generate.mjs +++ b/internal/lsp/lsproto/_generate/generate.mjs @@ -58,10 +58,24 @@ function writeLine(s) { write("\n"); } +/** + * @param {string | undefined} doc + * @param {string | undefined} proposed, + * @param {string | undefined} since, + * @param {string | undefined} sinceTags, + * @param {string | undefined} deprecated + */ +function writeDocumentation(doc, proposed, since, sinceTags, deprecated) { + writeDescription(doc); + writeSince(since, sinceTags); + writeProposed(proposed); + writeDeprecation(deprecated, doc); +} + /** * @param {string | undefined} doc */ -function writeDocumentation(doc) { +function writeDescription(doc) { if (doc) { const lines = doc.split("\n"); for (let line of lines) { @@ -358,10 +372,7 @@ writeLine(""); writeLine("// Structures\n"); for (const t of model.structures) { - writeDocumentation(t.documentation); - writeSince(t.since, t.sinceTags); - writeProposed(t.proposed); - writeDeprecation(t.deprecated, t.documentation); + writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); writeLine("type " + t.name + " struct {"); @@ -383,10 +394,7 @@ for (const t of model.structures) { } for (const p of t.properties) { - writeDocumentation(p.documentation); - writeSince(p.since, p.sinceTags); - writeProposed(p.proposed); - writeDeprecation(p.deprecated, p.documentation); + writeDocumentation(p.documentation, p.proposed, p.since, p.sinceTags, p.deprecated); write(titleCase(p.name) + " "); @@ -411,10 +419,7 @@ for (const t of model.structures) { writeLine("// Enumerations\n"); for (const t of model.enumerations) { - writeDocumentation(t.documentation); - writeSince(t.since, t.sinceTags); - writeProposed(t.proposed); - writeDeprecation(t.deprecated, t.documentation); + writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); /** @type {string} */ let underlyingType; @@ -443,10 +448,7 @@ for (const t of model.enumerations) { writeLine("const ("); for (const v of t.values) { - writeDocumentation(v.documentation); - writeSince(v.since, v.sinceTags); - writeProposed(v.proposed); - writeDeprecation(v.deprecated, v.documentation); + writeDocumentation(v.documentation, v.proposed, v.since, v.sinceTags, v.deprecated); write(t.name); write(v.name); @@ -473,10 +475,7 @@ for (const t of model.enumerations) { writeLine("// Type aliases\n"); for (const t of model.typeAliases) { - writeDocumentation(t.documentation); - writeSince(t.since, t.sinceTags); - writeProposed(t.proposed); - writeDeprecation(t.deprecated, t.documentation); + writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); if (t.name === "LSPAny") { writeLine("type LSPAny = any\n"); @@ -519,10 +518,7 @@ writeLine("}"); writeLine("// Requests"); writeLine("const ("); for (const t of model.requests) { - writeDocumentation(t.documentation); - writeSince(t.since, t.sinceTags); - writeProposed(t.proposed); - writeDeprecation(t.deprecated, t.documentation); + writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); writeLine("Method" + methodNameToIdentifier(t.method) + ' Method = "' + t.method + '"'); } writeLine(")\n"); @@ -530,10 +526,7 @@ writeLine(")\n"); writeLine("// Notifications"); writeLine("const ("); for (const t of model.notifications) { - writeDocumentation(t.documentation); - writeSince(t.since, t.sinceTags); - writeProposed(t.proposed); - writeDeprecation(t.deprecated, t.documentation); + writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); writeLine("Method" + methodNameToIdentifier(t.method) + ' Method = "' + t.method + '"'); } writeLine(")\n"); From 7ab7bdc0781395754a827cb3a800e57c865ed45f Mon Sep 17 00:00:00 2001 From: Dylan Strohschein Date: Wed, 9 Apr 2025 23:16:30 -0400 Subject: [PATCH 4/5] join params into single object with new type --- internal/lsp/lsproto/_generate/generate.mjs | 46 +++++++++++---------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/internal/lsp/lsproto/_generate/generate.mjs b/internal/lsp/lsproto/_generate/generate.mjs index 7bd0baedc7..884f25e68f 100644 --- a/internal/lsp/lsproto/_generate/generate.mjs +++ b/internal/lsp/lsproto/_generate/generate.mjs @@ -59,17 +59,19 @@ function writeLine(s) { } /** - * @param {string | undefined} doc - * @param {string | undefined} proposed, - * @param {string | undefined} since, - * @param {string | undefined} sinceTags, - * @param {string | undefined} deprecated + * @param {{ + * doc?: string, + * proposed?: boolean, + * since?: string, + * sinceTags?: string[], + * deprecated?: string + * }} data */ -function writeDocumentation(doc, proposed, since, sinceTags, deprecated) { - writeDescription(doc); - writeSince(since, sinceTags); - writeProposed(proposed); - writeDeprecation(deprecated, doc); +function writeDocumentation(data) { + writeDescription(data.doc); + writeSince(data.since, data.sinceTags); + writeProposed(data.proposed); + writeDeprecation(data.deprecated, data.doc); } /** @@ -143,22 +145,22 @@ function writeSinceLines(sinceLines) { * @param {string | undefined} doc */ function writeDeprecation(deprecated, doc) { - const inlineDeprication = "is deprecated @since"; + const inlineDeprecation = "is deprecated @since"; if (deprecated) { writeLine("// "); write("// Deprecated: "); writeLine(deprecated); } - else if (doc?.includes(inlineDeprication)) { + else if (doc?.includes(inlineDeprecation)) { const lines = doc.split("\n"); - const matchingLine = lines.find(x => x.includes(inlineDeprication)); + const matchingLine = lines.find(x => x.includes(inlineDeprecation)); if (matchingLine) { - const depricationMessage = matchingLine.split(" @since")[0]; + const deprecationMessage = matchingLine.split(" @since")[0]; writeLine("// "); write("// Deprecated: "); - writeLine(depricationMessage); + writeLine(deprecationMessage); } } } @@ -372,7 +374,7 @@ writeLine(""); writeLine("// Structures\n"); for (const t of model.structures) { - writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); + writeDocumentation(t); writeLine("type " + t.name + " struct {"); @@ -394,7 +396,7 @@ for (const t of model.structures) { } for (const p of t.properties) { - writeDocumentation(p.documentation, p.proposed, p.since, p.sinceTags, p.deprecated); + writeDocumentation(p); write(titleCase(p.name) + " "); @@ -419,7 +421,7 @@ for (const t of model.structures) { writeLine("// Enumerations\n"); for (const t of model.enumerations) { - writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); + writeDocumentation(t); /** @type {string} */ let underlyingType; @@ -448,7 +450,7 @@ for (const t of model.enumerations) { writeLine("const ("); for (const v of t.values) { - writeDocumentation(v.documentation, v.proposed, v.since, v.sinceTags, v.deprecated); + writeDocumentation(v); write(t.name); write(v.name); @@ -475,7 +477,7 @@ for (const t of model.enumerations) { writeLine("// Type aliases\n"); for (const t of model.typeAliases) { - writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); + writeDocumentation(t); if (t.name === "LSPAny") { writeLine("type LSPAny = any\n"); @@ -518,7 +520,7 @@ writeLine("}"); writeLine("// Requests"); writeLine("const ("); for (const t of model.requests) { - writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); + writeDocumentation(t); writeLine("Method" + methodNameToIdentifier(t.method) + ' Method = "' + t.method + '"'); } writeLine(")\n"); @@ -526,7 +528,7 @@ writeLine(")\n"); writeLine("// Notifications"); writeLine("const ("); for (const t of model.notifications) { - writeDocumentation(t.documentation, t.proposed, t.since, t.sinceTags, t.deprecated); + writeDocumentation(t); writeLine("Method" + methodNameToIdentifier(t.method) + ' Method = "' + t.method + '"'); } writeLine(")\n"); From a1f6ee51ab294614eea2f7c90314ffe476d16875 Mon Sep 17 00:00:00 2001 From: Dylan Strohschein Date: Wed, 9 Apr 2025 23:19:00 -0400 Subject: [PATCH 5/5] switch doc to documentation --- internal/lsp/lsproto/_generate/generate.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/lsp/lsproto/_generate/generate.mjs b/internal/lsp/lsproto/_generate/generate.mjs index 884f25e68f..14df597cf9 100644 --- a/internal/lsp/lsproto/_generate/generate.mjs +++ b/internal/lsp/lsproto/_generate/generate.mjs @@ -60,7 +60,7 @@ function writeLine(s) { /** * @param {{ - * doc?: string, + * documentation?: string, * proposed?: boolean, * since?: string, * sinceTags?: string[], @@ -68,10 +68,10 @@ function writeLine(s) { * }} data */ function writeDocumentation(data) { - writeDescription(data.doc); + writeDescription(data.documentation); writeSince(data.since, data.sinceTags); writeProposed(data.proposed); - writeDeprecation(data.deprecated, data.doc); + writeDeprecation(data.deprecated, data.documentation); } /**