-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#pragma once #886
Comments
Thanks for reporting this. It just missed the cutoff for 0.12.1, but we can get a fix in soon after that. |
For the next release, we've disabled it for our results, but VS Code itself has editor.wordBasedSuggestions and editor.quickSuggestions that we can't disable (appears with an "abc" symbol). We've filed bug microsoft/vscode#31075 on VS Code to enable us to fix this further. |
Hey there. I'm using 1.16.1. I'm experiencing another issue with
|
@ivanychev What version of the C++ extension do you have and what OS are you on? That error is not related to #pragma once. It's just showing the error on the 1st line. Can you file a new bug? The problem you're seeing is that your includePath is not set up correctly. In particular, the test.cpp file has a header that can't be found (opening that file should show more info). What does the Problems pane show when you open the test.cpp file? |
This is currently expected. If you fix the |
Indeed, with unity builds that basically means you have to complete the include path for all the source files in the project before going on and check errors within a single file (also true for the source, not only the header). Too bad I can't directly use the same include paths as the Visual Studio project. EDIT: That said, it also avoids false positive when typedef or core classes would be included at the highest level (such as a precompiled header) and therefore always available, but never included directly in a header. |
@hsandt I'm not sure what you're talking about. What include paths aren't working that work with Visual Studio? We support forcedIncludes and compile_commands.json. Did you post to the wrong issue? |
No, I just meant Intellisense will understand not flag some non-trivial include paths (not described from the project root nor the current file directory) because my VS project has defined various include paths. But VS code doesn't know about them so I have to add them manually in the settings, but because of dependencies and various sources including my header (the extreme case because a source for a unity build), I have to dig up and down all the related files and add all the corresponding include paths. Always writing include paths from the project root would probably ease the work, but sometimes it's much more convenient to just write the end of the path, especially for external libraries with headers very deep in a completely different branch of the directory tree. |
This may seem like small issue but considering it is first impression a modern C++ programmer might face when starting vscode I think it important.
If you create new file, save as main.h and type the line #pragma once followed by enter key, the autocomplete butchers said code inserting unhelpful _flag suffix turning the code to garbage,
The text was updated successfully, but these errors were encountered: