Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Erroneous location mapping

Đang mở
#967 1 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
32/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript, vscode

Hướng nghiên cứu

Bắt đầu bằng cách truy vết cách tiện ích mở rộng VSCode chuyển đổi các liên kết vị trí của CodeQL thành các phạm vi trong trình chỉnh sửa, sử dụng các trường hợp truy vấn và vị trí trong issue làm bản tái hiện. So sánh các vùng chọn thu được với tài liệu về vị trí được liên kết, bao gồm toàn bộ tệp, các phạm vi một dòng và nhiều dòng. Được xem là hoàn tất khi các vị trí được ghi trong tài liệu hiển thị nhất quán trong VSCode, bao gồm cả các trường hợp kiểu JSP.

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

Mô tả

bug good first issue VSCode

VSCode only handles locations corresponding to a range. This is a known shortcoming. This also means special ranges can correspond to invalid VSCode ranges which mean that no scroll happens. This likely has never worked 100% but we did fix some off by one errors which may have caused it to seem to work.

Version
Extension v1.5.5
CodeQL CLI v2.6.2
VSCode:

1.60.2
7f6ab5485bbc008386c4386d08766667e155244e
x64

To reproduce
Consider the following screenshot, with a query that emits location links to a file in the database. Only a small number of these locations actually work (in the sense that they can be clicked and VSCode selects the given location).
locations

As is visible in the output (Problem View), most of the locations are mapped to the top of the file. According to our documentation, however, :2:0:2:0, for example, should mark the entire second line.

This is a somewhat serious problem, because it prevents results from being properly accessible. We recently encountered issues with our Java JSP support, where the resulting locations in the JSP files all pointed at the top of the files, making triaging the results very tedious.

Expected behavior
Location display in VSCode should be consistent with our documentation.

Additional context
Here the query that was used in the screenshot above:

/**
 * @kind problem
 */
​
// documentation at https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/#file-urls
class MyLoc extends string {
  string pos;
  MyLoc() {
    this = "file:///home/sebastian/dev/src/commons-io/src/main/java/org/apache/commons/io/IOUtils.java" + pos and
    pos = [
      ":0:0:0:0", // (works) docs say that this should link to the whole file
      ":2:0:2:0", // (fails) docs say that this should mark the entire line
      ":2:0:2:1", // (fails) should probably not work
      ":2:0:3:0", // (fails) I would expect it to mark lines 2 and 3
      ":2:1:2:0", // (fails) not sure whether it should work
      ":2:1:3:0", // (fails) This is currently used to mark JSP results. Yorck says it used to work.
      ":2:1:2:1", // (works)
      ":2:1:3:1"  // (works)
    ]
  }
  string getURL() { result = this }
  string getPos() { result = pos }
}
​
from MyLoc l
select l, "Position " + l.getPos() + " is mapped to "

@alexet

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

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.