Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Delphi parser drops every class member after a `const [ref]` parameter

Abierto
#2,545 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
60/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Área
tooling

Línea de trabajo

Start by reproducing with the Min.pas file from the issue in an empty directory, running codegraph init -y . then codegraph node TMin and codegraph query ''. The payload does not name the parser source files, so locate the Delphi class-declaration parsing and how it reads method parameter lists, then compare the const [ref] case with the control that has the decoration removed. Done means TMin lists Before, WithRef and After, TMin.After resolves, and no AValue field is indexed.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

In a Delphi (Object Pascal) unit, a method declared with a const [ref] parameter followed by another
parameter ends the class declaration for the parser: the [ref] method is lost, the parameter after it
is recorded as a field of the class, every member declared after it is missing from the index, and the
qualified names of those members (node TClass.Method) answer "not found". Parsing resumes at the next
class declaration.

Versions

  • codegraph --version: 1.6.0 (global install).
  • npx -y @colbymchenry/[email protected]: same result on the same file.
  • Windows 10 Pro 10.0.19045; Node from the global npm install.

Minimal reproduction

Min.pas:

unit Min;

interface

type
  TMin = class
  public
    procedure Before;
    procedure WithRef(const [ref] AValue: Integer; const AOther: string);
    procedure After;
  end;

  TNext = class
  public
    procedure Other;
  end;

const
  CAfterClass = 1;

implementation

procedure TMin.Before;
begin
end;

procedure TMin.WithRef(const [ref] AValue: Integer; const AOther: string);
begin
end;

procedure TMin.After;
begin
  Before;
end;

procedure TNext.Other;
begin
end;

end.

Steps, in a directory holding only that file:

codegraph init -y .
codegraph node TMin
codegraph node TMin.After
codegraph node TNext
codegraph query '' --limit 50

Observed (1.6.0):

●  8 nodes, 7 edges
**Members (2):**
- Before (method):8
- AValue (field):9
Symbol "TMin.After" not found in the codebase

TNext lists Other (method):15, so parsing resumes at the next class. query '' lists AValue as a
field at :9, Before, CAfterClass, Other, TMin, TNext — no WithRef, no After.

Expected: TMin with three methods Before, WithRef, After; TMin.After resolving; no field AValue.

Control: the same file with [ref] removed (procedure WithRef(const AValue: Integer; const AOther: string);)
indexes with TMin listing all three methods and TMin.After resolving.

A [ref] parameter that is the last one in its list (procedure WithRef(const [ref] AValue: Integer);)
loses only that method and shifts the next member's recorded line by one (After (method):9 for a
declaration at line 10).

Note on the syntax

const [ref] is Delphi's "pass by reference even for small types" parameter decoration (documented under
Parameters (Delphi) — constant parameters, the [Ref] attribute). It appears in interface and
implementation declarations alike.

Lenguaje dominante
C
Estrellas
73.2k
Forks
4.7k
Merge medio
2 h 16 min
PR fusionados (30 d)
423

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de colbymchenry/codegraph

Todos los issues de colbymchenry/codegraph

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.