diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 6cb92df5948..995dec20aea 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -381,6 +381,9 @@ module Harness.LanguageService { getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: ts.FormatCodeOptions): ts.TextChange[] { return unwrapJSONCallResult(this.shim.getFormattingEditsAfterKeystroke(fileName, position, key, JSON.stringify(options))); } + getDocCommentScaffoldingAtPosition(fileName: string, position: number): string { + return unwrapJSONCallResult(this.shim.getDocCommentScaffoldingAtPosition(fileName, position)); + } getEmitOutput(fileName: string): ts.EmitOutput { return unwrapJSONCallResult(this.shim.getEmitOutput(fileName)); } diff --git a/src/server/client.ts b/src/server/client.ts index e4a524dd210..3f6770d7144 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -540,6 +540,10 @@ namespace ts.server { getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { throw new Error("Not Implemented Yet."); } + + getDocCommentScaffoldingAtPosition(fileName: string, position: number): string { + throw new Error("Not Implemented Yet."); + } getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[] { var lineOffset = this.positionToOneBasedLineOffset(fileName, position); diff --git a/src/services/services.ts b/src/services/services.ts index c85c10dc411..6b5c0e19054 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1032,6 +1032,8 @@ namespace ts { getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; + getDocCommentScaffoldingAtPosition(fileName: string, position: number): string; + getEmitOutput(fileName: string): EmitOutput; getProgram(): Program; @@ -6698,6 +6700,10 @@ namespace ts { return []; } + + function getDocCommentScaffoldingAtPosition(filename: string, position: number): string { + return "/** getDocCommentScaffoldingAtPosition -- TS side! */"; + } function getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[] { // Note: while getting todo comments seems like a syntactic operation, we actually @@ -6940,6 +6946,7 @@ namespace ts { getFormattingEditsForRange, getFormattingEditsForDocument, getFormattingEditsAfterKeystroke, + getDocCommentScaffoldingAtPosition, getEmitOutput, getSourceFile, getProgram diff --git a/src/services/shims.ts b/src/services/shims.ts index 6e765eff499..535e5a0c772 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -197,6 +197,8 @@ namespace ts { getFormattingEditsForDocument(fileName: string, options: string/*Services.FormatCodeOptions*/): string; getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: string/*Services.FormatCodeOptions*/): string; + getDocCommentScaffoldingAtPosition(fileName: string, position: number): string; + getEmitOutput(fileName: string): string; } @@ -785,6 +787,17 @@ namespace ts { }); } + public getDocCommentScaffoldingAtPosition(fileName: string, position: number): string { + return this.forwardJSONCall( + "getDocCommentScaffoldingAtPosition('" + fileName + "', " + position + ")", + () => { + var commentText = this.languageService.getDocCommentScaffoldingAtPosition(fileName, position); + return commentText; + } + + ) + } + /// NAVIGATE TO /** Return a list of symbols that are interesting to navigate to */