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

Đang mở
#2,949 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, perl

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C
Star
45.8k
Fork
3.8k
Merge trung bình
2 ngày 18 giờ
Pull request đã merge (30 ngày)
108

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DeusData/codebase-memory-mcp

Tất cả issue của DeusData/codebase-memory-mcp

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.