From 643e9fc1e410f8bd4a7cc2b23d96b9e946c957ea Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 22 Nov 2017 14:25:31 -0800 Subject: [PATCH 1/2] Offer global completions in all blocks --- src/services/completions.ts | 1 + 1 file changed, 1 insertion(+) 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); } From dc3b4166b2d8e72ebca66c4f6c8576c97b5cbac1 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 22 Nov 2017 15:11:38 -0800 Subject: [PATCH 2/2] Update test baseline --- tests/cases/fourslash/completionListIsGlobalCompletion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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");