Skip to content

Commit a4fd74a

Browse files
committed
use resolveName instead of resolveEntityName
1 parent b75ea05 commit a4fd74a

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

src/compiler/checker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,6 @@ m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n")
677677
resolveName(name, location, meaning, excludeGlobals) {
678678
return resolveName(location, escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals);
679679
},
680-
resolveEntityName,
681680
getJsxNamespace: n => unescapeLeadingUnderscores(getJsxNamespace(n)),
682681
getJsxFragmentFactory: n => {
683682
const jsxFragmentFactory = getJsxFragmentFactoryEntity(n);

src/compiler/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4582,7 +4582,6 @@ namespace ts {
45824582
*/
45834583
/* @internal */ getAllPossiblePropertiesOfTypes(type: readonly Type[]): Symbol[];
45844584
/* @internal */ resolveName(name: string, location: Node | undefined, meaning: SymbolFlags, excludeGlobals: boolean): Symbol | undefined;
4585-
/* @internal */ resolveEntityName(name: EntityNameOrEntityNameExpression, meaning: SymbolFlags, ignoreErrors?: boolean, dontResolveAlias?: boolean, location?: Node): Symbol | undefined;
45864585
/* @internal */ getJsxNamespace(location?: Node): string;
45874586
/* @internal */ getJsxFragmentFactory(location: Node): string | undefined;
45884587

src/services/goToDefinition.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,12 @@ namespace ts.GoToDefinition {
294294

295295
function getSymbol(node: Node, checker: TypeChecker, stopAtAlias: boolean | undefined) {
296296
const symbol = checker.getSymbolAtLocation(node);
297-
if (isEntityNameExpression(node) && isInJSDoc(node)) {
297+
if (isIdentifier(node) && isInJSDoc(node)) {
298298
const location = getJSDocHost(node);
299299
if (location && isEnumMember(location) && location === symbol?.valueDeclaration) {
300300
const flags = SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Value;
301-
const symbol = checker.resolveEntityName(node, flags, /*ignoreErrors*/ true, /*dontResolveAlias*/ true, getSourceFileOfNode(location));
302-
if (symbol) {
303-
return { symbol, failedAliasResolution: false };
304-
}
301+
const symbol = checker.resolveName(node.text, getSourceFileOfNode(location), flags, /*excludeGlobals*/ false);
302+
return { symbol, failedAliasResolution: false };
305303
}
306304
}
307305

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference path="fourslash.ts" />
2+
////enum E {
3+
//// /** {@link /*1*/[|A|]} */
4+
//// A
5+
////}
6+
7+
goTo.marker("1");
8+
verify.goToDefinitionIs([]);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// <reference path="fourslash.ts" />
2+
////enum E1 {
3+
//// [|/*2*/A|]
4+
////}
5+
////
6+
////enum E2 {
7+
//// /** {@link E1./*1*/[|A|]} */
8+
//// A
9+
////}
10+
11+
goTo.marker("1");
12+
verify.goToDefinitionIs("2");

0 commit comments

Comments
 (0)