feat: a TypeScript or JavaScript class field with a quoted name declares no field

Đang mở
#334 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ó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
70/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, typescript
Lĩnh vực
devtools

Hướng nghiên cứu

Start in internal/indexer/tsextract, where class field extraction for TypeScript, TSX and JavaScript lives, and find the branch that skips string-literal field names. Read the comment at line 14 of datadecl_test.go and the assertion that no Box."quoted" node exists, then check docs/LANGUAGE-CAPABILITY-MATRIX.md lines 153, 160 and 167. Done when class Box { "quoted" = 4; } yields a Box."quoted" field node with the contains edge, the test assertion is updated, and go test ./internal/indexer/tsextract/... passes.

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

Mô tả

area:indexer enhancement good first issue priority:low
What exists today?

Class field extraction for TypeScript, TSX and JavaScript in internal/indexer/tsextract, as documented at docs/LANGUAGE-CAPABILITY-MATRIX.md lines 153, 160 and 167.

How does it behave now?

class Box { "quoted" = 4; } has a static name, but the extractor emits no field for it. internal/indexer/tsextract/datadecl_test.go asserts that no Box."quoted" node exists. The comment at line 14 of that file states that a quoted field name declares no field.

How should it behave?

Emit a field named by the string literal's value, with the same contains edge and references as an identifier-named field. The graph then holds a Box."quoted" field node for class Box { "quoted" = 4; }. Computed names such as [key] = 3 stay out of scope.

What kind of improvement?

Correctness in an edge case.

Would this change existing behavior?

Yes, but only for classes with quoted field names. Box gains a field node, references to Box."quoted" resolve to it, and the assertion in datadecl_test.go changes with the fix.

Before submitting
  • I searched existing issues and this is not a duplicate
  • I checked that the current behavior is not a deliberate decision in openspec/specs/
Ngôn ngữ chính
Go
Star
0
Fork
0
Merge trung bình
7 giờ 42 phút
Pull request đã merge (30 ngày)
111

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

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 seanb4t/codegraph-go

Tất cả issue của seanb4t/codegraph-go

Issue tương tự

Thêm issue về Go

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.