microsoft / microsoft/vscode-cpptools

X-Macro expansion false error.

Đang mở
#14,435 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.

bug Language Service verified Visual Studio
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:

  1. Create a new C file colors.def for example with this content :
COLOR(RED)
COLOR(GREEN)
COLOR(BLUE)
  1. Create another C file like main.c with this content :
enum colors_t {
#define COLOR(NAME) NAME,
#include "colors.def"
#undef COLOR
};
  1. 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

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.

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

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.