Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97327

Make VS Code auto-complete include headers from the whole project

$
0
0

I have VS Code configured with the native C++ extension and I'm using CMake as well as generating the compile_commands that VS Code can use to configure intellisense. Completion works as well as navigation, building, etc..

What I'm interested in is making VS Code provide (fuzzy) completions for any headers in the workspace. Currently completion for #include " only works for headers in the same folder, in a system folder or in the src folder.

Is there a way to make VS Code provide suggestions for any header in the workspace? When a suggestion in a different folder is selected it should include the path (relative to src if in a different parent folder, or relative to the current folder if the header is in a subfolder).

This is exactly what pressing Ctrl+Space twice in CLion does. It provides completions for any header in the project and it is a really nice feature.


PS: Ctrl+p in vscode can open any file in the workspace and currently I use it just to check what is the path that I should use to include a header. It would be much better if suggestions for completing #include " already did this.


Viewing all articles
Browse latest Browse all 97327

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>