Skip to content

Commit 665a4e3

Browse files
committed
Merge pull request #6850 from RyanCavanaugh/fix6654
Always show file tokens in JS completion lists
2 parents 2fde7ab + 018429b commit 665a4e3

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/services/services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3823,7 +3823,7 @@ namespace ts {
38233823
return undefined;
38243824
}
38253825

3826-
const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot, isJsDocTagName } = completionData;
3826+
const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData;
38273827

38283828
if (isJsDocTagName) {
38293829
// If the current position is a jsDoc tag name, only tag names should be provided for completion
@@ -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
}
Lines changed: 15 additions & 0 deletions
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)