diff --git a/src/services/completions.ts b/src/services/completions.ts index 6bbdfacac4..bfa03ef4a9 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -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); } diff --git a/tests/cases/fourslash/completionListIsGlobalCompletion.ts b/tests/cases/fourslash/completionListIsGlobalCompletion.ts index 49196bdabd..121ab940d6 100644 --- a/tests/cases/fourslash/completionListIsGlobalCompletion.ts +++ b/tests/cases/fourslash/completionListIsGlobalCompletion.ts @@ -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");