Delphi extractor drops the receiver call of a chained call expression and everything inside it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- devtools
Direzione di ricerca
Start with extractPascalCall and extractPascalParenlessCall, which the issue says read the receiver exprCall only for the T/I factory name and never record the receiver call or the calls inside its arguments. Save the Chain.pas reproduction from the issue, run codegraph init and codegraph callees TargetIsTheSame, then compare against the expected callees for TargetIsTheSame and Stmt. Done when MD5FileSized and ExtendedPath appear as both callees and callers, with no regression on the existing TFoo.GetInstance().DoIt cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
In a Delphi (Object Pascal) unit, a call whose receiver is itself a call - MD5FileSized(TMeta.ExtendedPath(APath)).IsSame(AKey) - contributes one edge: the outer method (IsSame). The receiver call (MD5FileSized) and the calls inside its arguments (TMeta.ExtendedPath) are missing from callees of the routine and from callers of each callee.
The same holds for the paren-less statement form MD5FileSized(…).Reset;. The tree is parsed correctly; the walk stops at the receiver.
Versions
codegraph --version: 1.6.2 (Windows x64 bundle).- Windows 10 Pro 10.0.19045.
Minimal reproduction
Chain.pas:
unit Chain;
interface
type
TKey = record
function IsSame(const AOther: TKey): Boolean;
procedure Reset;
end;
TMeta = class
class function ExtendedPath(const APath: string): string; static;
end;
function MD5FileSized(const APath: string): TKey;
function TargetIsTheSame(const APath: string; const AKey: TKey): Boolean;
procedure Stmt(const APath: string);
implementation
function TKey.IsSame(const AOther: TKey): Boolean;
begin
Result := True;
end;
procedure TKey.Reset;
begin
end;
class function TMeta.ExtendedPath(const APath: string): string;
begin
Result := APath;
end;
function MD5FileSized(const APath: string): TKey;
begin
end;
function TargetIsTheSame(const APath: string; const AKey: TKey): Boolean;
begin
Result := MD5FileSized(TMeta.ExtendedPath(APath)).IsSame(AKey);
end;
procedure Stmt(const APath: string);
begin
MD5FileSized(TMeta.ExtendedPath(APath)).Reset;
end;
end.
Steps, in a directory holding only that file:
codegraph init -y .
codegraph callees TargetIsTheSame
codegraph callees Stmt
codegraph callers MD5FileSized
codegraph callers ExtendedPath
Observed (1.6.2):
● 10 nodes, 11 edges
Callees of "TargetIsTheSame" (1):
method IsSame
Callees of "Stmt" (1):
method Reset
Callers of "MD5FileSized" (0):
No callers found for "MD5FileSized"
Callers of "ExtendedPath" (0):
No callers found for "ExtendedPath"
Expected: TargetIsTheSame with the callees MD5FileSized, ExtendedPath, IsSame; Stmt with MD5FileSized, ExtendedPath, Reset; MD5FileSized and ExtendedPath each with two callers.
The grammar's tree is complete (tree-sitter-pascal.wasm shipped in 1.6.2):
assignment
identifier "Result"
exprCall
exprDot
exprCall
identifier "MD5FileSized"
exprArgs
exprCall
exprDot
identifier "TMeta"
identifier "ExtendedPath"
exprArgs
identifier "APath"
identifier "IsSame"
exprArgs
identifier "AKey"
extractPascalCall reads the receiver exprCall only to build the TFoo.GetInstance().DoIt name for a T/I-prefixed factory (#645/#608); it records neither the receiver call nor the calls in its arguments, and only the outer exprArgs are visited. extractPascalParenlessCall records the receiver call only on the same T/I gate.
Where it was found
A product's Result := MD5FileSized(TFSMetadata.ExtendedPath(APath)).IsSame(AContentKey);: callers TFSMetadata.ExtendedPath --limit 500 named 12 of the 13 routines that call it, the routine holding that line being the one left out; its callees listed IsSame alone.
- Lingua principale
- C
- Stelle
- 73.2k
- Fork
- 4.7k
- Merge medio
- 2h 13m
- PR unite (30g)
- 418
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di colbymchenry/codegraph
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
colbymchenry/codegraph#2634 ·
I maintainer di solito rispondono entro 1 giorno
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Forse già presa @Ancienttwo l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
colbymchenry/codegraph#2617 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Invalid regular expression: /\boperator++\s*(?:<[^<>()]*>)?\s*\(/: Nothing to repeat (v1.6.2)Aperta
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 72/100
colbymchenry/codegraph#2482 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
codegraph ui - does not workAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
colbymchenry/codegraph#1900 · 2 commenti · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
colbymchenry/codegraph#1700 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di colbymchenry/codegraph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
OpenPrinting/cups#1772 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
snowballstem/snowball#311 ·
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100