Skip to content

Commit 2c25bea

Browse files
committed
Always show file tokens in JS completion lists
Fixes microsoft#6654
1 parent 554ea1b commit 2c25bea

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/services/services.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3834,7 +3834,7 @@ namespace ts {
38343834

38353835
const entries: CompletionEntry[] = [];
38363836

3837-
if (isRightOfDot && isSourceFileJavaScript(sourceFile)) {
3837+
if (isSourceFileJavaScript(sourceFile)) {
38383838
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries);
38393839
addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames));
38403840
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @allowNonTsExtensions: true
4+
// @Filename: Foo.js
5+
//// function f() {
6+
//// // helloWorld leaks from here into the global space?
7+
//// if (helloWorld) {
8+
//// return 3;
9+
//// }
10+
//// return 5;
11+
//// }
12+
////
13+
//// hello/**/
14+
15+
verify.completionListContains('helloWorld');

0 commit comments

Comments
 (0)