diff --git a/src/services/services.ts b/src/services/services.ts index bb98fd7d5db..dfca8aea745 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2376,6 +2376,10 @@ module ts { return containingNodeKind === SyntaxKind.CallExpression; case SyntaxKind.OpenParenToken: return containingNodeKind === SyntaxKind.CallExpression; + case SyntaxKind.ModuleKeyword: + return true; + case SyntaxKind.DotToken: + return containingNodeKind === SyntaxKind.ModuleDeclaration; } } @@ -2478,7 +2482,6 @@ module ts { return containingNodeKind === SyntaxKind.Parameter || containingNodeKind === SyntaxKind.PropertyDeclaration; case SyntaxKind.ClassKeyword: - case SyntaxKind.ModuleKeyword: case SyntaxKind.EnumKeyword: case SyntaxKind.InterfaceKeyword: case SyntaxKind.FunctionKeyword: @@ -2494,7 +2497,6 @@ module ts { case "class": case "interface": case "enum": - case "module": case "function": case "var": // TODO: add let and const diff --git a/tests/cases/fourslash/completionListBuilderLocations_Modules.ts b/tests/cases/fourslash/completionListBuilderLocations_Modules.ts new file mode 100644 index 00000000000..a629371d147 --- /dev/null +++ b/tests/cases/fourslash/completionListBuilderLocations_Modules.ts @@ -0,0 +1,14 @@ +/// + +////module A/*moduleName1*/ + + +////module A./*moduleName2*/ + + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.not.completionListIsEmpty(); + debugger; + verify.completionListIsBuilder(); +}); \ No newline at end of file