Setup shim and stubbed out functions

This commit is contained in:
Arthur Ozga
2015-07-13 18:56:38 -07:00
parent 7664f3410c
commit 7923e8e619
4 changed files with 27 additions and 0 deletions

View File

@@ -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));
}

View File

@@ -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);

View File

@@ -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

View File

@@ -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 */