Perl: cross-file method resolution and accessor typing (Moose, Mojo::Base)

未关闭
#2,949 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
c, perl

调研方向

Start with internal/cbm/lsp/perl_lsp.c and the reference work in #2171, then review the shared cross-file registry used by other language resolvers. Check #2846 for possible tree-sitter-perl node changes. Pick one behavior and add a before/after regression test; done means that behavior resolves correctly from current main with signed-off commits.

由索引模型根据 Issue 内容生成。

描述

enhancement

Perl call resolution is currently file-local. The Perl semantic pass (internal/cbm/lsp/perl_lsp.c) builds its type registry from the current file's definitions plus the stdlib tables, and there is no cross-file pass for Perl. On current main that leaves these gaps:

  1. Inheritance across files. A method inherited through use parent, use base or @ISA resolves through the semantic pass only when the parent package is defined in the same file.
  2. Accessor typing. Moose and Mojo::Base has attributes are not modelled, so a chain such as $self->ua->get(...) loses its receiver type after the accessor.
  3. require imports. Only top-level use statements produce import rows; require Foo::Bar; (often conditional, or written as require 'Foo/Bar.pm') produces none.
  4. Perl 5.38 class syntax. class / method / field (Corinna) is not handled by the semantic pass.

Reference work: #2171 (thank you, @turtacn) implemented all of these on a September base, with a regression test for each step, and is the best reference for the shape of the work. It could not be merged as it stood (opened from a fork's main, conflicting with current main, unsigned commits), so it was closed; focused slices of it are welcome.

How we would like to land it:

  • One behaviour per PR, cut from current main, with a before/after regression test and signed-off commits (git commit -s).
  • Cross-file resolution should build on the shared cross-file registry the other language resolvers use, rather than a per-file scan of the whole project, so indexing stays linear on large Perl codebases.
  • Related: #2846 (tree-sitter-perl grammar refresh) may change node names this work depends on.

No timeline is implied; this issue keeps the gap visible so it is not lost.

主要语言
C
星标
45.8k
派生
3.8k
平均合并
2 天 18 小时
30 天内合并 PR
108

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DeusData/codebase-memory-mcp 的其他 Issue

查看 DeusData/codebase-memory-mcp 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。