mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Add test for completions
This commit is contained in:
parent
89267bcd6f
commit
d396ddfa7b
@ -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<ServerProtocol.CompletionsRequest>(CommandNames.Completions, args);
|
||||
|
||||
17
tests/cases/fourslash/server/completions.ts
Normal file
17
tests/cases/fourslash/server/completions.ts
Normal file
@ -0,0 +1,17 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user