mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-08 03:08:13 +00:00
fix: skip singleton_class in sequential parser to match worker behavior
This commit is contained in:
parent
f699ec92cf
commit
b32ba5f8cb
1 changed files with 10 additions and 1 deletions
|
|
@ -239,7 +239,16 @@ const seqMethodMapCache = new Map<
|
|||
function seqFindEnclosingClassNode(node: SyntaxNode): SyntaxNode | null {
|
||||
let current = node.parent;
|
||||
while (current) {
|
||||
if (CLASS_CONTAINER_TYPES.has(current.type)) return current;
|
||||
if (CLASS_CONTAINER_TYPES.has(current.type)) {
|
||||
// Ruby singleton_class (class << self) has no name field u2014 skip it and
|
||||
// continue walking up to find the actual class/module container.
|
||||
// This matches the behavior in parse-worker.ts findEnclosingClassNode().
|
||||
if (current.type === 'singleton_class') {
|
||||
current = current.parent;
|
||||
continue;
|
||||
}
|
||||
return current;
|
||||
}
|
||||
current = current.parent;
|
||||
}
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue