Skip to content

[Bug]: PowerShell method calls ($this.M(), [Type]::M()) are dropped from the call graph #3992

Closed

Description

@rajatnagda45

Summary

PowerShell method calls are never recorded as call edges. A call like $this.Square(3) from one class method to another — or the static [Calc]::Make() form — is silently dropped from the call graph. Only bare command/function invocations (Helper) are captured.

Version / commit

v8 @ ef4450d (v0.9.73)

Environment

macOS (darwin 24.6), Python 3.13, tree-sitter-powershell via default uv sync.

Minimal reproduction

# calc.ps1
class Calc {
    [int] Square([int]$x) { return $x * $x }
    [int] Run() { return $this.Square(3) }
}
from graphify.extract import extract_powershell
r = extract_powershell("calc.ps1")
calls = [(e["source"], e["target"]) for e in r["edges"] if e["relation"] == "calls"]

Expected

A calls edge .Run() → .Square().

Actual

No calls edge. Both methods are present as nodes, but every method invocation is dropped.

Root cause

The call walker in graphify/extractors/powershell.py only handles command nodes. A method call parses as an invokation_expression (callee in the member_name child, args in argument_list), which was never visited. A bare property read ($this.Name) is a separate member_access node and correctly produces no call.

Scope

A clean checkout reproduces. Member calls should resolve only to methods (not to a free function sharing the name), to avoid false edges on unknown receivers.

Activity

  1. github-actions commented on Oct 2, 2026

    @github-actions

    Thanks for opening this issue, @rajatnagda45. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

  2. added a commit that references this issue on Oct 5, 2026
    7657686
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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