Add ability to use contextual queries to find references when already on a reference

Đang mở Phù hợp với người mới
#592 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
68/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu tại extensions/ql-vscode/src/contextual/templateProvider.ts ở dòng 70, nơi các kết quả được lọc theo vị trí đã chọn. Theo dõi cách tạo ra các kết quả contextual find-references cho các khai báo và tham chiếu. Được xem là hoàn thành khi việc chọn một tham chiếu trong tệp mã nguồn Java tìm thấy cùng các tham chiếu như khi chọn khai báo của nó, trong khi hành vi đối với khai báo vẫn được giữ nguyên.

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

Mô tả

bug enhancement VSCode

I'm not exactly sure whether this is a feature request or a bug report. Regardless, this is behaviour that is not implemented, but I would expect it to be.

When running the find references contextual query, on a token in a database source file, no references will be found if the token represents a reference itself. References will only be found if the selected token is a declaration. For instance:

int /* 1 */ myMethod() {
  /* 2 */ myMethod();
  /* 3 */ myMethod();
}

If you place the caret at 2 or 3, no references will be found. If you place the caret at 1 References will be found at 2 and 3. Most other language servers will find references for 2 and 3 regardless of which reference is selected.

The problem is not related to the queries themselves. Rather, it happens here:
https://github.com/aeisenberg/vscode-codeql/blob/353a87de12ca818293aeb3199d057a23a24cc403/extensions/ql-vscode/src/contextual/templateProvider.ts#L70-L70

This function will take all possible results and filter out results that do not contain the selected position. This makes sense when the selected position is the declaration, but it does not make sense if the position is a reference.

Ngôn ngữ chính
TypeScript
Star
539
Fork
240
Merge trung bình
2 ngày 6 giờ
Pull request đã merge (30 ngày)
29

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 github/vscode-codeql

Tất cả issue của github/vscode-codeql

Issue tương tự

Thêm issue về TypeScript

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.