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

オープン
#2,949 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
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時間
マージ済み PR(30日)
108

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DeusData/codebase-memory-mcp のほかの issue

DeusData/codebase-memory-mcp の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。