Skip to content

Commit 13c7008

Browse files
committed
Experiment with making goto-def on override more consistent
1 parent 0487e3b commit 13c7008

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/services/goToDefinition.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ namespace ts.GoToDefinition {
172172

173173
const baseTypeNode = getEffectiveBaseTypeNode(baseDeclaration);
174174
if (!baseTypeNode) return;
175-
const baseType = typeChecker.getTypeAtLocation(baseTypeNode);
176-
if (!baseType.symbol) return;
175+
const base = typeChecker.getSymbolAtLocation(baseTypeNode);
176+
if (!base) return;
177177

178178
const name = unescapeLeadingUnderscores(getTextOfPropertyName(classElement.name));
179179
const symbol = hasStaticModifier(classElement)
180-
? typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbolAtLocation(baseType.symbol, baseDeclaration), name)
181-
: typeChecker.getPropertyOfType(baseType, name);
180+
? typeChecker.getPropertyOfType(typeChecker.getDeclaredTypeOfSymbol(base), name)
181+
: typeChecker.getPropertyOfType(typeChecker.getTypeOfSymbolAtLocation(base, baseDeclaration), name);
182182
if (!symbol) return;
183183

184184
return getDefinitionFromSymbol(typeChecker, symbol, node);

0 commit comments

Comments
 (0)