Always show file tokens in JS completion lists

Fixes #6654
This commit is contained in:
Ryan Cavanaugh
2016-02-02 13:10:30 -08:00
parent 554ea1b57c
commit 2c25bea0aa
2 changed files with 16 additions and 1 deletions

View File

@@ -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));
}

View File

@@ -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');