Skip to content

Support qualified method names in def queries #2

Description

@monneyboi

Problem

def renders method definitions with a qualified label, but cannot use that same label as input.

For example:

def Ignore.checkIgnore in node_modules/ignore/index.js
No definition found for "Ignore.checkIgnore"

The bare name succeeds:

def checkIgnore in node_modules/ignore/index.js
1 definition of "checkIgnore":
method_definition Ignore.checkIgnore ...

This is a recurring tool-use failure because qualified names are natural for methods and the successful output itself presents Parent.method.

Cause

Symbols store the leaf name (checkIgnore) and parent relationship (Ignore) separately. findDefinition() currently compares the entire input only against symbols.name:

WHERE s.name = ?

The extension passes the input unchanged while rendering results as ${parent_name}.${name}.

Expected behavior

  • def("checkIgnore", scope) continues to perform the current bare-name lookup.
  • def("Ignore.checkIgnore", scope) finds checkIgnore under Ignore and can disambiguate same-named methods in different parents.
  • A qualified label emitted by def should be valid input to a subsequent def query.
  • Add a black-box regression test through the public query boundary.

Supporting qualified callers queries is out of scope: callers are syntactic and do not resolve receiver types, so a class qualifier cannot reliably constrain call sites.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions