Skip to content

Commit fa33f73

Browse files
committed
fix(julia): align abstract-def name resolution with struct-def (#1130)
1 parent 91240da commit fa33f73

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

src/extractors/julia.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,12 @@ function handleAbstractDef(node: TreeSitterNode, ctx: ExtractorOutput): void {
285285
// abstract_definition: `abstract type` type_head `end`
286286
// The identifier is nested inside `type_head` — possibly wrapped in a
287287
// `Name <: Super` binary_expression or a `Name{T,...}` parameterized form.
288-
// Skip rather than emit a garbled name when no base identifier can be located.
289-
let nameNode = node.childForFieldName('name') || findChild(node, 'identifier');
290-
if (!nameNode) {
291-
const typeHead = findChild(node, 'type_head');
292-
if (!typeHead) return;
293-
nameNode = findBaseName(typeHead);
294-
if (!nameNode) return;
295-
}
288+
// Mirror handleStructDef and skip rather than emit a garbled name when no
289+
// base identifier can be located.
290+
const typeHead = findChild(node, 'type_head');
291+
if (!typeHead) return;
292+
const nameNode = findBaseName(typeHead);
293+
if (!nameNode) return;
296294

297295
ctx.definitions.push({
298296
name: nameNode.text,

0 commit comments

Comments
 (0)