Changes from CR feedback

This commit is contained in:
Jason Ramsay 2016-10-04 12:48:44 -07:00
parent d186c83119
commit 62fddba88e
3 changed files with 6 additions and 11 deletions

View File

@ -756,10 +756,7 @@ namespace FourSlash {
public verifyCompletionListIsGlobal(expected: boolean) {
const completions = this.getCompletionListAtCaret();
if (!completions && expected !== undefined) {
this.raiseError(`verifyCompletionListIsGlobal failed - expected result to be ${completions}`);
}
else if (completions && completions.isGlobalCompletion !== expected) {
if (completions && completions.isGlobalCompletion !== expected) {
this.raiseError(`verifyCompletionListIsGlobal failed - expected result to be ${completions.isGlobalCompletion}`);
}
}

View File

@ -886,7 +886,7 @@ namespace ts.Completions {
}
const semanticStart = timestamp();
let isGlobalCompletion: boolean;
let isGlobalCompletion = false;
let isMemberCompletion: boolean;
let isNewIdentifierLocation: boolean;
let symbols: Symbol[] = [];
@ -902,7 +902,6 @@ namespace ts.Completions {
else {
symbols = tagSymbols;
}
isGlobalCompletion = false;
isMemberCompletion = true;
isNewIdentifierLocation = false;
}
@ -913,7 +912,6 @@ namespace ts.Completions {
if (!typeChecker.isUnknownSymbol(tagSymbol)) {
symbols = [tagSymbol];
}
isGlobalCompletion = false;
isMemberCompletion = true;
isNewIdentifierLocation = false;
}

View File

@ -23,17 +23,17 @@
goTo.marker("1");
verify.completionListIsGlobal(false);
goTo.marker("2");
verify.completionListIsGlobal(undefined);
verify.completionListIsGlobal(false);
goTo.marker("3");
verify.completionListIsGlobal(undefined);
verify.completionListIsGlobal(false);
goTo.marker("4");
verify.completionListIsGlobal(true);
goTo.marker("5");
verify.completionListIsGlobal(undefined);
verify.completionListIsGlobal(false);
goTo.marker("6");
verify.completionListIsGlobal(true);
goTo.marker("7");
verify.completionListIsGlobal(undefined);
verify.completionListIsGlobal(false);
goTo.marker("8");
verify.completionListIsGlobal(false);
goTo.marker("9");