Merge pull request #20233 from amcasey/BlockCompletions

Offer global completions in all blocks
This commit is contained in:
Andrew Casey 2017-11-22 15:57:43 -08:00 committed by GitHub
commit fedc459ae1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -942,6 +942,7 @@ namespace ts.Completions {
scopeNode.kind === SyntaxKind.SourceFile ||
scopeNode.kind === SyntaxKind.TemplateExpression ||
scopeNode.kind === SyntaxKind.JsxExpression ||
scopeNode.kind === SyntaxKind.Block || // Some blocks aren't statements, but all get global completions
isStatement(scopeNode);
}

View file

@ -47,7 +47,7 @@ verify.completionListIsGlobal(true);
goTo.marker("6");
verify.completionListIsGlobal(false);
goTo.marker("7");
verify.completionListIsGlobal(false);
verify.completionListIsGlobal(true);
goTo.marker("8");
verify.completionListIsGlobal(false);
goTo.marker("9");