VSCode- exclude specific folder/file from IntelliSense parsing

Viewed 857

I have an issue with C/C++ intelliSense parsing. When the function declaration described in one file and the same name is used for typedef in another file. Explanation: Image we have next structure of folders and files:

Files Structure

file dir1/f1.h contains:

typedef int func1;

file dir2/f1.h contains:

void func1(void);

file dir2/f1.c contains:

#include "f1.h"

void func1(void) {
   // do something
}

file main.c contains:

#include "f1.h"

int main(void) {
    func1();
}

When I use command go to definition, the IntelliSense goes to the dir1/f1.h file because the last open file was dir1/f1.h. If the last opened file was dir2/f1.h the IntelliSense will jump to dir2/f1.h or dir2/f1.c.

I am wondering how to exclude dir1 or dir1/f1.h from IntelliSense parsing but not from workspace and searching results? So I need next:

  • IntelliSense ignore/do not parse dir1 or dir1/f1.h
  • dir1 and dir1/f1.h present in workspace view
  • searcher do not ignore dir1/f1.h
0 Answers
Related