[英]Is it possible to get VsCode Intellisense to sense against source produced by the C preprocessor?
Say I have a C program that looks something like this...假设我有一个 C 程序,看起来像这样......
#define Pointlike(type) \
type lat;\
type lng;
typedef struct Point {
Pointlike(void*)
} Point;
typedef struct {
Pointlike(int)
} IntPoint;
int main(){
Point *point = &(Point){.lat = (void*) 0, .lng = (void*) 1};
IntPoint *intPoint = &(IntPoint){ .lat = 0, .lng = 1 };
IntPoint *unsafe = (IntPoint*) point;
return 0;
}
Under my current configuration, VsCode Intellisense does not recognize the fields that would be provided by Pointlike
.在我当前的配置下,VsCode Intellisense 无法识别Pointlike
提供的字段。
Is there something I'm missing in my config?我的配置中缺少什么吗? I could imagine this is the intended behavior because I wouldn't necessarily expect Intellisense to run the preprocessor by default.我可以想象这是预期的行为,因为我不一定期望 Intellisense 默认运行预处理器。 Is there a way for example to pipe gcc -E
into Intellisense to somehow pick up these symbols?有没有办法,例如 pipe gcc -E
进入 Intellisense 以某种方式获取这些符号?
In the latest version of C/C++ Intellisense, this appears to work out of the box.在最新版本的 C/C++ Intellisense 中,这似乎开箱即用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.