Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3823,7 +3823,7 @@ namespace ts {
return undefined;
}

const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isRightOfDot, isJsDocTagName } = completionData;
const { symbols, isMemberCompletion, isNewIdentifierLocation, location, isJsDocTagName } = completionData;

if (isJsDocTagName) {
// If the current position is a jsDoc tag name, only tag names should be provided for completion
Expand All @@ -3834,7 +3834,7 @@ namespace ts {

const entries: CompletionEntry[] = [];

if (isRightOfDot && isSourceFileJavaScript(sourceFile)) {
if (isSourceFileJavaScript(sourceFile)) {
const uniqueNames = getCompletionEntriesFromSymbols(symbols, entries);
addRange(entries, getJavaScriptCompletionEntries(sourceFile, location.pos, uniqueNames));
}
Expand Down
15 changes: 15 additions & 0 deletions tests/cases/fourslash/getJavaScriptGlobalCompletions1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// <reference path="fourslash.ts" />

// @allowNonTsExtensions: true
// @Filename: Foo.js
//// function f() {
//// // helloWorld leaks from here into the global space?
//// if (helloWorld) {
//// return 3;
//// }
//// return 5;
//// }
////
//// hello/**/

verify.completionListContains('helloWorld');