diff --git a/src/server/client.ts b/src/server/client.ts index 1aa7547f541..aa1ddb34bf7 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -177,10 +177,11 @@ module ts.server { getCompletionsAtPosition(fileName: string, position: number): CompletionInfo { var lineCol = this.positionToOneBasedLineCol(fileName, position); - var args: ServerProtocol.CodeLocationRequestArgs = { + var args: ServerProtocol.CompletionsRequestArgs = { file: fileName, line: lineCol.line, col: lineCol.col, + prefix: undefined }; var request = this.processRequest(CommandNames.Completions, args); diff --git a/tests/cases/fourslash/server/completions.ts b/tests/cases/fourslash/server/completions.ts new file mode 100644 index 00000000000..82d3b5b2400 --- /dev/null +++ b/tests/cases/fourslash/server/completions.ts @@ -0,0 +1,17 @@ +/// + +////var x: string[] = []; +////x.forEach(function (y) { y/*1*/ +////x.forEach(y => y/*2*/ + +goTo.marker('1'); +edit.insert('.'); +verify.memberListContains('trim'); +verify.memberListCount(20); +edit.insert('});'); // need the following lines to not have parse errors in order for completion list to appear + +goTo.marker('2'); +edit.insert('.'); +verify.memberListContains('trim'); +verify.memberListCount(20); + \ No newline at end of file