Merge pull request #29316 from Microsoft/randomIdentifier

Verify that completion with new identifier location returns isNewIdentifierLocation: true
This commit is contained in:
Sheetal Nandi
2019-01-09 13:01:22 -08:00
committed by GitHub
3 changed files with 7 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
/// <reference path='fourslash.ts'/>
////namespace wwer./**/w
verify.completions({ marker: "", exact: [], isNewIdentifierLocation: true });

View File

@@ -104,7 +104,7 @@ namespace ts.Completions {
getJSCompletionEntries(sourceFile, location!.pos, uniqueNames, compilerOptions.target!, entries); // TODO: GH#18217
}
else {
if ((!symbols || symbols.length === 0) && keywordFilters === KeywordCompletionFilters.None) {
if (!isNewIdentifierLocation && (!symbols || symbols.length === 0) && keywordFilters === KeywordCompletionFilters.None) {
return undefined;
}

View File

@@ -7,5 +7,5 @@
verify.completions(
{ marker: "moduleName1", exact: completion.globals, isNewIdentifierLocation: true },
{ marker: "moduleName2", exact: undefined },
{ marker: "moduleName2", exact: [], isNewIdentifierLocation: true },
);