VSCode intellisense with C++ headers

后端 未结 1 1418
感情败类
感情败类 2021-01-13 14:38

I have searched for this but I can\'t find anything. If it\'s dupe I will close my question without any problem. I have a c_cpp_properties.json configuration file in VSCODE<

相关标签:
1条回答
  • 2021-01-13 15:30

    In case you are still interested or anyone stumbles across this thread using Google:

    VSC has to two different engines for auto-completion. 1. The legacy "Tag Parser" 2. The IntelliSense engine

    The latter is the default one at this point, "Tag Parser" is a fallback solution. As you assumed, both are configured in c_cpp_properties.json. The paths in browse are searched recursively and used by Tag Parser only, whereas the paths in includePath are NOT searched recursively and used by the IntelliSense engine.

    Given that your header MyFooClass.h is not located directly at the root folder but in a subfolder include, you would have to add "${workspaceRoot}/include" to your includePath in order to have a working IntelliSense code completion.

    Nowadays they have a better documentation on this: https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/c_cpp_properties.json.md

    0 讨论(0)
提交回复
热议问题