Skip to content

Commit 62fddba

Browse files
committed
Changes from CR feedback
1 parent d186c83 commit 62fddba

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/harness/fourslash.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,7 @@ namespace FourSlash {
756756

757757
public verifyCompletionListIsGlobal(expected: boolean) {
758758
const completions = this.getCompletionListAtCaret();
759-
if (!completions && expected !== undefined) {
760-
this.raiseError(`verifyCompletionListIsGlobal failed - expected result to be ${completions}`);
761-
}
762-
else if (completions && completions.isGlobalCompletion !== expected) {
759+
if (completions && completions.isGlobalCompletion !== expected) {
763760
this.raiseError(`verifyCompletionListIsGlobal failed - expected result to be ${completions.isGlobalCompletion}`);
764761
}
765762
}

src/services/completions.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ namespace ts.Completions {
886886
}
887887

888888
const semanticStart = timestamp();
889-
let isGlobalCompletion: boolean;
889+
let isGlobalCompletion = false;
890890
let isMemberCompletion: boolean;
891891
let isNewIdentifierLocation: boolean;
892892
let symbols: Symbol[] = [];
@@ -902,7 +902,6 @@ namespace ts.Completions {
902902
else {
903903
symbols = tagSymbols;
904904
}
905-
isGlobalCompletion = false;
906905
isMemberCompletion = true;
907906
isNewIdentifierLocation = false;
908907
}
@@ -913,7 +912,6 @@ namespace ts.Completions {
913912
if (!typeChecker.isUnknownSymbol(tagSymbol)) {
914913
symbols = [tagSymbol];
915914
}
916-
isGlobalCompletion = false;
917915
isMemberCompletion = true;
918916
isNewIdentifierLocation = false;
919917
}

tests/cases/fourslash/completionListIsGlobalCompletion.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@
2323
goTo.marker("1");
2424
verify.completionListIsGlobal(false);
2525
goTo.marker("2");
26-
verify.completionListIsGlobal(undefined);
26+
verify.completionListIsGlobal(false);
2727
goTo.marker("3");
28-
verify.completionListIsGlobal(undefined);
28+
verify.completionListIsGlobal(false);
2929
goTo.marker("4");
3030
verify.completionListIsGlobal(true);
3131
goTo.marker("5");
32-
verify.completionListIsGlobal(undefined);
32+
verify.completionListIsGlobal(false);
3333
goTo.marker("6");
3434
verify.completionListIsGlobal(true);
3535
goTo.marker("7");
36-
verify.completionListIsGlobal(undefined);
36+
verify.completionListIsGlobal(false);
3737
goTo.marker("8");
3838
verify.completionListIsGlobal(false);
3939
goTo.marker("9");

0 commit comments

Comments
 (0)