Erroneous location mapping
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
- Lĩnh vực
- developer-experience, tooling
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ả
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).

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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/vscode-codeql
-
bug VSCode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/vscode-codeql#4471 · 1 bình luận ·
-
bug enhancement VSCode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
github/vscode-codeql#592 · 2 bình luận ·
-
enhancement VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
github/vscode-codeql#4432 · 1 bình luận ·
-
bug VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
github/vscode-codeql#4356 ·
-
bug VSCode
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
github/vscode-codeql#4339 · 1 bình luận ·
Tất cả issue của github/vscode-codeql
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/inspector#2458 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carbon-design-system/ibm-products#9907 ·