mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Add support for goto def on external module name
This commit is contained in:
@@ -2072,6 +2072,10 @@ module ts {
|
||||
var moduleType = typeChecker.getTypeOfSymbol(importSymbol);
|
||||
symbol = moduleType ? moduleType.symbol : undefined;
|
||||
}
|
||||
// External module name in an ambient declaration
|
||||
else if (node.parent.kind === SyntaxKind.ModuleDeclaration) {
|
||||
symbol = typeChecker.getSymbolOfNode(node.parent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
10
tests/cases/fourslash/goToDefinitionExternamModuleName5.ts
Normal file
10
tests/cases/fourslash/goToDefinitionExternamModuleName5.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
// @Filename: a.ts
|
||||
/////*2*/declare module "external/*1*/" {
|
||||
//// class Foo { }
|
||||
////}
|
||||
|
||||
goTo.marker('1');
|
||||
goTo.definition();
|
||||
verify.caretAtMarker('2');
|
||||
Reference in New Issue
Block a user