microsoft / microsoft/vscode-cpptools
X-Macro expansion false error.
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.2k
- Fork
- 1.7k
- Merge trung bình
- 14 giờ 46 phút
- Pull request đã merge (30 ngày)
- 61
Mô tả
Environment
- OS and Version: Debian GNU/Linux 13 Trixie
- VS Code Version: 1.119.0
- C/C++ Extension Version: 1.32.2
Bug Summary and Steps to Reproduce
Bug Summary:
False error with X-Macros.
Steps to reproduce:
- Create a new C file colors.def for example with this content :
COLOR(RED)
COLOR(GREEN)
COLOR(BLUE)
- Create another C file like main.c with this content :
enum colors_t {
#define COLOR(NAME) NAME,
#include "colors.def"
#undef COLOR
};
- See the false error "expected an identifier" but compilation works perfectly.
Expected behavior:
No false error as the macro should expand and complete the enum.
Configuration and Logs
{
"configurations": [
{
"name": "Default",
}
],
"version": 4
}
Other Extensions
Issue still persist after disabling any other extensions.
Additional context
This is not a fatal error since it is only visual but it is a problem in intellisense that shows up error even if there are not...
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.
Hướng nghiên cứu
Tái hiện chẩn đoán với hai tệp được nêu trong báo cáo, colors.def và main.c, bằng mẫu X-macro đã cho. Theo dõi cách IntelliSense phân tích phần mở rộng macro được include và xác định lý do nó báo “expected an identifier”; được xem là hoàn tất khi chẩn đoán giả biến mất trong khi ví dụ vẫn tiếp tục biên dịch thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- c
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100