From 10941888dca8dc68a64fe1729258cf9ffef861ec Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:31:58 -0800 Subject: [PATCH] Plumb formatting to getDocCommentTemplateAtPosition (#52349) Fixes https://github.com/microsoft/TypeScript/issues/52348 --- src/harness/client.ts | 2 +- src/harness/fourslashImpl.ts | 2 +- src/harness/fourslashInterfaceImpl.ts | 2 +- src/harness/harnessLanguageService.ts | 4 ++-- src/server/session.ts | 2 +- src/services/services.ts | 5 +++-- src/services/shims.ts | 6 +++--- src/services/types.ts | 2 +- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- .../docCommentTemplateClassDeclMethods01.ts | 2 +- .../docCommentTemplateClassDeclMethods02.ts | 2 +- .../docCommentTemplateClassDeclProperty01.ts | 2 +- .../fourslash/docCommentTemplateConstructor01.ts | 2 +- .../docCommentTemplateExportAssignmentJS.ts | 2 +- .../docCommentTemplateFunctionExpression.ts | 2 +- .../docCommentTemplateFunctionWithParameters.ts | 2 +- .../docCommentTemplateFunctionWithParameters_js.ts | 2 +- ...ocCommentTemplateInterfacePropertyFunctionType.ts | 4 ++-- ...ocCommentTemplateInterfacesEnumsAndTypeAliases.ts | 4 ++-- .../docCommentTemplateJsSpecialPropertyAssignment.ts | 4 ++-- .../docCommentTemplateObjectLiteralMethods01.ts | 2 +- .../fourslash/docCommentTemplatePrototypeMethod.ts | 2 +- .../cases/fourslash/docCommentTemplateReturnsTag1.ts | 8 ++++---- .../cases/fourslash/docCommentTemplateReturnsTag2.ts | 4 ++-- .../docCommentTemplateVariableStatements01.ts | 6 +++--- .../docCommentTemplateVariableStatements03.ts | 12 ++++++------ .../docCommentTemplate_insideEmptyComment.ts | 2 +- 28 files changed, 47 insertions(+), 46 deletions(-) diff --git a/src/harness/client.ts b/src/harness/client.ts index 435c367e4e7..1b52ef2abe2 100644 --- a/src/harness/client.ts +++ b/src/harness/client.ts @@ -727,7 +727,7 @@ export class SessionClient implements LanguageService { return notImplemented(); } - getDocCommentTemplateAtPosition(_fileName: string, _position: number, _options?: DocCommentTemplateOptions): TextInsertion { + getDocCommentTemplateAtPosition(_fileName: string, _position: number, _options?: DocCommentTemplateOptions, _formatOptions?: FormatCodeSettings): TextInsertion { return notImplemented(); } diff --git a/src/harness/fourslashImpl.ts b/src/harness/fourslashImpl.ts index 0d8f5f4080d..153de11f3c5 100644 --- a/src/harness/fourslashImpl.ts +++ b/src/harness/fourslashImpl.ts @@ -3249,7 +3249,7 @@ export class TestState { public verifyDocCommentTemplate(expected: ts.TextInsertion | undefined, options?: ts.DocCommentTemplateOptions) { const name = "verifyDocCommentTemplate"; - const actual = this.languageService.getDocCommentTemplateAtPosition(this.activeFile.fileName, this.currentCaretPosition, options || { generateReturnInDocTemplate: true })!; + const actual = this.languageService.getDocCommentTemplateAtPosition(this.activeFile.fileName, this.currentCaretPosition, options || { generateReturnInDocTemplate: true }, this.formatCodeSettings)!; if (expected === undefined) { if (actual) { diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index f3eb069e6f6..b8bac73e899 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -452,7 +452,7 @@ export class Verify extends VerifyNegatable { public docCommentTemplateAt(marker: string | FourSlash.Marker, expectedOffset: number, expectedText: string, options?: ts.DocCommentTemplateOptions) { this.state.goToMarker(marker); - this.state.verifyDocCommentTemplate({ newText: expectedText.replace(/\r?\n/g, "\r\n"), caretOffset: expectedOffset }, options); + this.state.verifyDocCommentTemplate({ newText: expectedText.replace(/\r?\n/g, ts.testFormatSettings.newLineCharacter!), caretOffset: expectedOffset }, options); } public noDocCommentTemplateAt(marker: string | FourSlash.Marker) { diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 9c481ce1506..5b393da4b3b 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -587,8 +587,8 @@ class LanguageServiceShimProxy implements ts.LanguageService { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: ts.FormatCodeOptions): ts.TextChange[] { return unwrapJSONCallResult(this.shim.getFormattingEditsAfterKeystroke(fileName, position, key, JSON.stringify(options))); } - getDocCommentTemplateAtPosition(fileName: string, position: number, options?: ts.DocCommentTemplateOptions): ts.TextInsertion { - return unwrapJSONCallResult(this.shim.getDocCommentTemplateAtPosition(fileName, position, options)); + getDocCommentTemplateAtPosition(fileName: string, position: number, options?: ts.DocCommentTemplateOptions, formatOptions?: ts.FormatCodeSettings): ts.TextInsertion { + return unwrapJSONCallResult(this.shim.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions)); } isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { return unwrapJSONCallResult(this.shim.isValidBraceCompletionAtPosition(fileName, position, openingBrace)); diff --git a/src/server/session.ts b/src/server/session.ts index 762469e1f60..820226c2f55 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -2083,7 +2083,7 @@ export class Session implements EventSender { private getDocCommentTemplate(args: protocol.FileLocationRequestArgs) { const { file, languageService } = this.getFileAndLanguageServiceForSyntacticOperation(args); const position = this.getPositionInFile(args, file); - return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file)); + return languageService.getDocCommentTemplateAtPosition(file, position, this.getPreferences(file), this.getFormatOptions(file)); } private getSpanOfEnclosingComment(args: protocol.SpanOfEnclosingCommentRequestArgs) { diff --git a/src/services/services.ts b/src/services/services.ts index aa1c2da69ba..f6e5fccfe06 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2436,8 +2436,9 @@ export function createLanguageService( : Promise.reject("Host does not implement `installPackage`"); } - function getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined { - return JsDoc.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, /*formatSettings*/ undefined), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); + function getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined { + const formatSettings = formatOptions ? formatting.getFormatContext(formatOptions, host).options : undefined; + return JsDoc.getDocCommentTemplateAtPosition(getNewLineOrDefaultFromHost(host, formatSettings), syntaxTreeCache.getCurrentSourceFile(fileName), position, options); } function isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean { diff --git a/src/services/shims.ts b/src/services/shims.ts index 2f6f9fad8d4..eca35a4a6eb 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -349,7 +349,7 @@ export interface LanguageServiceShim extends Shim { /** * Returns JSON-encoded value of the type TextInsertion. */ - getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): string; + getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): string; /** * Returns JSON-encoded boolean to indicate whether we should support brace location @@ -1091,10 +1091,10 @@ class LanguageServiceShimObject extends ShimBase implements LanguageServiceShim }); } - public getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): string { + public getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): string { return this.forwardJSONCall( `getDocCommentTemplateAtPosition('${fileName}', ${position})`, - () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options) + () => this.languageService.getDocCommentTemplateAtPosition(fileName, position, options, formatOptions) ); } diff --git a/src/services/types.ts b/src/services/types.ts index ff726ff0663..11f22f4fc94 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -604,7 +604,7 @@ export interface LanguageService { getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; - getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined; + getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; /** diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index d37896300e8..65f9a35b41d 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -9990,7 +9990,7 @@ declare namespace ts { getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; - getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined; + getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; /** * This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag. diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index c9eeb8a00a1..e973a181793 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -6088,7 +6088,7 @@ declare namespace ts { getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings): TextChange[]; - getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions): TextInsertion | undefined; + getDocCommentTemplateAtPosition(fileName: string, position: number, options?: DocCommentTemplateOptions, formatOptions?: FormatCodeSettings): TextInsertion | undefined; isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean; /** * This will return a defined result if the position is after the `>` of the opening tag, or somewhere in the text, of a JSXElement with no closing tag. diff --git a/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts b/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts index 6acd0ad314e..15eccb60ce1 100644 --- a/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts +++ b/tests/cases/fourslash/docCommentTemplateClassDeclMethods01.ts @@ -1,7 +1,7 @@ /// const singleLineOffset = 3; -const multiLineOffset = 12; +const multiLineOffset = 11; ////class C { diff --git a/tests/cases/fourslash/docCommentTemplateClassDeclMethods02.ts b/tests/cases/fourslash/docCommentTemplateClassDeclMethods02.ts index 5eed624a915..8aacf248d7d 100644 --- a/tests/cases/fourslash/docCommentTemplateClassDeclMethods02.ts +++ b/tests/cases/fourslash/docCommentTemplateClassDeclMethods02.ts @@ -1,6 +1,6 @@ /// -const multiLineOffset = 12; +const multiLineOffset = 11; ////class C { //// /*0*/ diff --git a/tests/cases/fourslash/docCommentTemplateClassDeclProperty01.ts b/tests/cases/fourslash/docCommentTemplateClassDeclProperty01.ts index 221bf619308..cf8cc5ca5a2 100644 --- a/tests/cases/fourslash/docCommentTemplateClassDeclProperty01.ts +++ b/tests/cases/fourslash/docCommentTemplateClassDeclProperty01.ts @@ -1,7 +1,7 @@ /// const singleLineOffset = 3; -const multiLineOffset = 12; +const multiLineOffset = 11; ////class C { diff --git a/tests/cases/fourslash/docCommentTemplateConstructor01.ts b/tests/cases/fourslash/docCommentTemplateConstructor01.ts index 6c9eedb773d..7e742c8f8b3 100644 --- a/tests/cases/fourslash/docCommentTemplateConstructor01.ts +++ b/tests/cases/fourslash/docCommentTemplateConstructor01.ts @@ -13,7 +13,7 @@ //// } ////} -const newTextOffset = 12; +const newTextOffset = 11; verify.docCommentTemplateAt("0", /*newTextOffset*/ newTextOffset, `/** * diff --git a/tests/cases/fourslash/docCommentTemplateExportAssignmentJS.ts b/tests/cases/fourslash/docCommentTemplateExportAssignmentJS.ts index 849227ba74b..be160acf488 100644 --- a/tests/cases/fourslash/docCommentTemplateExportAssignmentJS.ts +++ b/tests/cases/fourslash/docCommentTemplateExportAssignmentJS.ts @@ -8,7 +8,7 @@ //// exports.foo = (a) => {}; -verify.docCommentTemplateAt("", 8, +verify.docCommentTemplateAt("", 7, `/** * * @param {any} a diff --git a/tests/cases/fourslash/docCommentTemplateFunctionExpression.ts b/tests/cases/fourslash/docCommentTemplateFunctionExpression.ts index eaf75d064fc..aab2f30ed47 100644 --- a/tests/cases/fourslash/docCommentTemplateFunctionExpression.ts +++ b/tests/cases/fourslash/docCommentTemplateFunctionExpression.ts @@ -4,7 +4,7 @@ ////const x = /*next*/ function f(p) {} for (const marker of test.markerNames()) { - verify.docCommentTemplateAt(marker, 8, + verify.docCommentTemplateAt(marker, 7, `/** * * @param p diff --git a/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts b/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts index 50cebb527ce..a818ad8ac3d 100644 --- a/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts +++ b/tests/cases/fourslash/docCommentTemplateFunctionWithParameters.ts @@ -7,7 +7,7 @@ const noIndentScaffolding = "/**\n * \n * @param x\n * @param y\n */"; const oneIndentScaffolding = "/**\n * \n * @param x\n * @param y\n */"; -const noIndentOffset = 8; +const noIndentOffset = 7; const oneIndentOffset = noIndentOffset + 4; goTo.marker("0"); diff --git a/tests/cases/fourslash/docCommentTemplateFunctionWithParameters_js.ts b/tests/cases/fourslash/docCommentTemplateFunctionWithParameters_js.ts index c2917d8f807..eb7fbaee2fe 100644 --- a/tests/cases/fourslash/docCommentTemplateFunctionWithParameters_js.ts +++ b/tests/cases/fourslash/docCommentTemplateFunctionWithParameters_js.ts @@ -4,7 +4,7 @@ /////*0*/ ////function f(a, ...b): boolean {} -verify.docCommentTemplateAt("0", 8, +verify.docCommentTemplateAt("0", 7, `/** * * @param {any} a diff --git a/tests/cases/fourslash/docCommentTemplateInterfacePropertyFunctionType.ts b/tests/cases/fourslash/docCommentTemplateInterfacePropertyFunctionType.ts index d14274800e6..a84d4ed6213 100644 --- a/tests/cases/fourslash/docCommentTemplateInterfacePropertyFunctionType.ts +++ b/tests/cases/fourslash/docCommentTemplateInterfacePropertyFunctionType.ts @@ -5,7 +5,7 @@ //// foo: (a: number, b: string) => void; ////} -verify.docCommentTemplateAt("", 12, +verify.docCommentTemplateAt("", 11, `/** * * @param a @@ -13,7 +13,7 @@ verify.docCommentTemplateAt("", 12, * @returns */`); -verify.docCommentTemplateAt("", 12, +verify.docCommentTemplateAt("", 11, `/** * * @param a diff --git a/tests/cases/fourslash/docCommentTemplateInterfacesEnumsAndTypeAliases.ts b/tests/cases/fourslash/docCommentTemplateInterfacesEnumsAndTypeAliases.ts index d0805d53255..2f2d7f50ae9 100644 --- a/tests/cases/fourslash/docCommentTemplateInterfacesEnumsAndTypeAliases.ts +++ b/tests/cases/fourslash/docCommentTemplateInterfacesEnumsAndTypeAliases.ts @@ -30,7 +30,7 @@ verify.docCommentTemplateAt("interfaceFoo", /*expectedOffset*/ 3, verify.docCommentTemplateAt("propertybar", /*expectedOffset*/ 3, "/** */"); -verify.docCommentTemplateAt("methodbaz", /*expectedOffset*/ 12, +verify.docCommentTemplateAt("methodbaz", /*expectedOffset*/ 11, `/** * * @param message @@ -46,4 +46,4 @@ verify.docCommentTemplateAt("memberOpen", /*expectedOffset*/ 3, "/** */"); verify.docCommentTemplateAt("memberClosed", /*expectedOffset*/ 3, - "/** */"); \ No newline at end of file + "/** */"); diff --git a/tests/cases/fourslash/docCommentTemplateJsSpecialPropertyAssignment.ts b/tests/cases/fourslash/docCommentTemplateJsSpecialPropertyAssignment.ts index 6a15ce133e4..6ade6753a28 100644 --- a/tests/cases/fourslash/docCommentTemplateJsSpecialPropertyAssignment.ts +++ b/tests/cases/fourslash/docCommentTemplateJsSpecialPropertyAssignment.ts @@ -5,14 +5,14 @@ ////const myNamespace = {}; /////*1*/myNamespace.myExport = function(x) {}; -verify.docCommentTemplateAt("0", 8, +verify.docCommentTemplateAt("0", 7, `/** * * @param {any} a */ `); -verify.docCommentTemplateAt("1", 8, +verify.docCommentTemplateAt("1", 7, `/** * * @param {any} x diff --git a/tests/cases/fourslash/docCommentTemplateObjectLiteralMethods01.ts b/tests/cases/fourslash/docCommentTemplateObjectLiteralMethods01.ts index 567fa89495f..4536f5f4f7e 100644 --- a/tests/cases/fourslash/docCommentTemplateObjectLiteralMethods01.ts +++ b/tests/cases/fourslash/docCommentTemplateObjectLiteralMethods01.ts @@ -1,6 +1,6 @@ /// -const multiLineOffset = 12; +const multiLineOffset = 11; ////var x = { //// /*0*/ diff --git a/tests/cases/fourslash/docCommentTemplatePrototypeMethod.ts b/tests/cases/fourslash/docCommentTemplatePrototypeMethod.ts index 9031898d52a..c2a39748234 100644 --- a/tests/cases/fourslash/docCommentTemplatePrototypeMethod.ts +++ b/tests/cases/fourslash/docCommentTemplatePrototypeMethod.ts @@ -7,7 +7,7 @@ ////C.prototype.method = /*next*/ function (p) {} for (const marker of test.markerNames()) { - verify.docCommentTemplateAt(marker, 8, + verify.docCommentTemplateAt(marker, 7, `/** * * @param {any} p diff --git a/tests/cases/fourslash/docCommentTemplateReturnsTag1.ts b/tests/cases/fourslash/docCommentTemplateReturnsTag1.ts index 09efa26036f..7276ce30cb4 100644 --- a/tests/cases/fourslash/docCommentTemplateReturnsTag1.ts +++ b/tests/cases/fourslash/docCommentTemplateReturnsTag1.ts @@ -28,19 +28,19 @@ verify.docCommentTemplateAt("0", 3, "/** */"); -verify.docCommentTemplateAt("1", 8, +verify.docCommentTemplateAt("1", 7, `/** * * @returns */`); -verify.docCommentTemplateAt("2", 8, +verify.docCommentTemplateAt("2", 7, `/** * * @returns */`); -verify.docCommentTemplateAt("3", 8, +verify.docCommentTemplateAt("3", 7, `/** * * @returns @@ -49,7 +49,7 @@ verify.docCommentTemplateAt("3", 8, verify.docCommentTemplateAt("4", 3, "/** */"); -verify.docCommentTemplateAt("5", 12, +verify.docCommentTemplateAt("5", 11, `/** * * @returns diff --git a/tests/cases/fourslash/docCommentTemplateReturnsTag2.ts b/tests/cases/fourslash/docCommentTemplateReturnsTag2.ts index 18767a42280..ab545182029 100644 --- a/tests/cases/fourslash/docCommentTemplateReturnsTag2.ts +++ b/tests/cases/fourslash/docCommentTemplateReturnsTag2.ts @@ -5,7 +5,7 @@ //// return 1; ////} -verify.docCommentTemplateAt("0", 8, +verify.docCommentTemplateAt("0", 7, `/** * * @param x @@ -13,7 +13,7 @@ verify.docCommentTemplateAt("0", 8, * @returns */`, { generateReturnInDocTemplate: true }); -verify.docCommentTemplateAt("0", 8, +verify.docCommentTemplateAt("0", 7, `/** * * @param x diff --git a/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts b/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts index 974ce1641ab..9c6633dbabb 100644 --- a/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts +++ b/tests/cases/fourslash/docCommentTemplateVariableStatements01.ts @@ -33,7 +33,7 @@ for (const varName of ["a", "b", "c", "d"]) { "/** */"); } -verify.docCommentTemplateAt("e", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("e", /*newTextOffset*/ 7, `/** * * @param x @@ -42,10 +42,10 @@ verify.docCommentTemplateAt("e", /*newTextOffset*/ 8, * @returns */`); -verify.docCommentTemplateAt("f", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("f", /*newTextOffset*/ 7, `/** * * @param a * @param b * @param c - */`); \ No newline at end of file + */`); diff --git a/tests/cases/fourslash/docCommentTemplateVariableStatements03.ts b/tests/cases/fourslash/docCommentTemplateVariableStatements03.ts index a998760fc74..2af54e350b0 100644 --- a/tests/cases/fourslash/docCommentTemplateVariableStatements03.ts +++ b/tests/cases/fourslash/docCommentTemplateVariableStatements03.ts @@ -29,14 +29,14 @@ //// } ////})) -verify.docCommentTemplateAt("a", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("a", /*newTextOffset*/ 7, `/** * * @param x * @returns */`); -verify.docCommentTemplateAt("b", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("b", /*newTextOffset*/ 7, `/** * * @param x @@ -45,7 +45,7 @@ verify.docCommentTemplateAt("b", /*newTextOffset*/ 8, * @returns */`); -verify.docCommentTemplateAt("c", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("c", /*newTextOffset*/ 7, `/** * * @param x @@ -55,7 +55,7 @@ verify.docCommentTemplateAt("c", /*newTextOffset*/ 8, verify.docCommentTemplateAt("d", /*newTextOffset*/ 3, "/** */"); -verify.docCommentTemplateAt("e", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("e", /*newTextOffset*/ 7, `/** * * @param param0 @@ -65,8 +65,8 @@ verify.docCommentTemplateAt("e", /*newTextOffset*/ 8, verify.docCommentTemplateAt("f", /*newTextOffset*/ 3, "/** */"); -verify.docCommentTemplateAt("g", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("g", /*newTextOffset*/ 7, `/** * * @param x - */`); \ No newline at end of file + */`); diff --git a/tests/cases/fourslash/docCommentTemplate_insideEmptyComment.ts b/tests/cases/fourslash/docCommentTemplate_insideEmptyComment.ts index e5d20a49df0..88371c8a52e 100644 --- a/tests/cases/fourslash/docCommentTemplate_insideEmptyComment.ts +++ b/tests/cases/fourslash/docCommentTemplate_insideEmptyComment.ts @@ -6,7 +6,7 @@ /////** Doc/*1*/ */ ////function g(p) { return p; } -verify.docCommentTemplateAt("", /*newTextOffset*/ 8, +verify.docCommentTemplateAt("", /*newTextOffset*/ 7, `/** * * @param p