Forum Replies Created
-
AuthorPosts
-
RumchillerParticipant
Hello!
Sorry for the long absence.
Seems that I have the same problem like described in this post: https://sysprogs.com/w/forums/topic/intellisense-bug-vs-2017/ . I will also try the new build.
RumchillerParticipantI am very sorry for the bad formatted post. But this post editor is very very ….. bad 😉
RumchillerParticipantPlease try reproducing the original problem with the missing headers when including them from a source file, not another header file.
Ok, this is the behaviour:
- My “generic-lib” contains one dummy.cpp file and apart from that is a header only library. All properties of this CMake target (sources, include-dirs) have public scope.
- All my other libraries have mixed private and public scope properties.
- I created two files, “file1.cpp” (private scope) und “file2.cpp”(public scope) and added them as sources to my library “lib”.
- Now <generic.hpp> can be only found in “file1.cpp”, but not in “file2.cpp” (???).
- Now just setting “file2.cpp” to private scope: et voila, <generic.hpp> can be found.
- Now setting both files to public scope, that clang shouldn’t find the headers anymore: That’s right, clang can not find them. BUT:
- After project clean and rebuild, <generic.hpp> is always found in both source files, whether they have public or private scope. This behaviour is ok for me.
There was no include of <generic.hpp> inside any of my source files. I included it in two source files in each library (one in a public scoped source, one in a private scoped source). First there was no effect. After a rebuild no effect to. Buf after a VS-restart a few clang errors regarding the missing header file were gone.
When there is a file, that I leave opened in the editor and the header cannot be found in it, I restart VS and now it can be found. It’s a very strange behaviour.
My project has an out of source build, but looks as follows:
– project
- build
- …
- CodeDB
- src
- …
- VisualGDBCache
- CMakeLists.txt (main cmake-file)
- Other VGDB-Files like .mak, .sln, .xml, .vgdbcmake
In the whole project there is no such file.
Another thing: Is it possible to deactivate the jumps inside the project explorer when changing the active file inside the editor? It’s clear, that the engine can not know at which library I am working at, so it jumps to the first one in the list. This makes the navigation really, really bad on big projects, due to the fact, that all folders become elapsed after the jump.
RumchillerParticipantSo now the problem is getting bigger. In some file clang cannot find the headers. It’s undefined behavior, because when I restart VS the headers in one file are found, in another not. Another problem is, that VGDB shows some header files twice in project explorer.
Please see the attached image and clang log dump.
Attachments:
You must be logged in to view attached files.RumchillerParticipantHi,
the second problem gone with the new build 2765, thanks for that.
Regarding the first problem:
- I create a new file inside one of my library targets and include that header file in my target_sources (not necessary but my I prefer this way because of my CMake script)
- The include path was already set and working
- I rebuild the project
- I open the new header file (test.hpp), an already existing header file (drivers.hpp) and getting the beheavior like in the attached image.
Then I followed your guide:
- I located the header (test.hpp) inside the Clang Intellisense Diagnostics Console. It has a red cross and no CFLAGS. The header drivers.hpp also has a red cross. There are a many files with a red cross. It seems that all header files have a red cross. Maybe this is related to the fact, that I include the header files in target_sources?
- The projects CFLAGS shows the correct include directory “C:\EasyMachines\EasyRotorBalancer\firmware\src\modules\system\inc”.
- I have no CodeModel.json file inside my project. The only existant json-Files are “VSWorkspaceState.json” and “ProjectSettings.json” inside the .vs-directory.
Thanks in advance!
Attachments:
You must be logged in to view attached files.RumchillerParticipantRegarding the first problem, I forgot to mention, that generic.hpp belongs to a interface library.
RumchillerParticipantThe 8193rd 😉
When opening VisualStudio and loading a project (same env. like in my first post), some files are still opened in the editor. It happens, that some files will not be parsed by clang:
[+0:18:24.560] Starting operation: Parse – HighlightBraces
[+0:18:24.560] Cannot retrieve source backend for C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:18:24.560] Operation completed: Parse – HighlightBraces [0 msec]After closing the file and reopen it, clang works as expected:
[+0:21:23.378] C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp belongs to a compatible project (C:\EasyMachines\EasyRotorBalancer\firmware\vgdb.vgdbcmake) and will be handled by our engine
[+0:21:23.378] C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp belongs to a compatible project (C:\EasyMachines\EasyRotorBalancer\firmware\vgdb.vgdbcmake) and will be handled by our engine
[+0:21:23.405] Indentation size: 4, will insert tabs
[+0:21:23.409] Starting operation: Determining code formatting settings for C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.409] Operation completed: Determining code formatting settings for C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp [0 msec]
[+0:21:23.427] Active document changed to C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.428] Active source file for header discovery changed to C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp.
[+0:21:23.428] Checking C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp for missing headers…
[+0:21:23.428] Updating CodeJumps labels for 0 objects…
[+0:21:23.428] No CodeJumps labels need updating. Cancelling aggregate search.
[+0:21:23.428] No missing headers for C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp.
[+0:21:23.428] Starting operation: Parse – Check
[+0:21:23.428] Starting operation: Reparsing C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.430] C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp has not changed since last build. Doing a quick recheck…
[+0:21:23.434] Found an outdated PSF 0 due to C:\EasyMachines\EasyRotorBalancer\firmware\src\modules\os\inc\thread.hpp (expected 885/1548354330, got 885/1548354829) during initial check. It will be re-built.
[+0:21:23.435] Rebuilding PSF 0 (normal preamble)…
[+0:21:23.435] Starting fpsBuildingPreamble on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.757] Completed fpsBuildingPreamble on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.757] Successfully rebuilt PSF 0 (normal preamble)…
[+0:21:23.757] Saving PSF 0 (normal preamble) to C:\EasyMachines\EasyRotorBalancer\firmware\CodeDB\vgdb.vgdbcmake-Debug\app.npd…
[+0:21:23.757] Starting fpsSavingPSF on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.759] Completed fpsSavingPSF on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.759] Successfully saved PSF 0 (normal preamble)…
[+0:21:23.759] Starting fpsParsingFileBody on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.817] Starting fpsAnalyzingReferencesLightweight on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.824] Completed fpsAnalyzingReferencesLightweight on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.827] Completed fpsParsingFileBody on C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp
[+0:21:23.827] Checking C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp for missing headers…
[+0:21:23.827] No missing headers for C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp.
[+0:21:23.830] Starting operation: Exporting parse results
[+0:21:23.831] Operation completed: Exporting parse results [0 msec]
[+0:21:23.831] Checked C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp: 0 error records
[+0:21:23.831] Operation completed: Reparsing C:\EasyMachines\EasyRotorBalancer\firmware\src\app\app.cpp [403 msec]
[+0:21:23.831] Operation completed: Parse – Check [403 msec]
[+0:21:23.891] Starting operation: Parse – HighlightBraces
[+0:21:23.891] Operation completed: Parse – HighlightBraces [0 msec]Greetings!
RumchillerParticipantThanks for that fast response and solving the problem!
RumchillerParticipantWith preview 6 it’s now working perfectly 🙂
Thanks!
RumchillerParticipantI think I found the problem:
Uart(Interface interface,
uint32_t baudrate,
StopBit s);-> comment after this moves to the right.
Uart(Interface interface, uint32_t baudrate, StopBit s);
-> after that the formatting behaves normally.
It’s maybe not too much work to correct this. And I also think, most problems I got with autoformatting are caused by this.
- This reply was modified 7 years, 3 months ago by Rumchiller.
RumchillerParticipantYeah, when the indentation is resetted, a single reformat is working. But I have to reset the indentation each time before reformating.
Regarding the native IntelliSense engine, working with it is impossible due to the errors of it.
RumchillerParticipantWhy VisualGDB has its own Formatter? Does the VisualStudio Formatter not working properly?
RumchillerParticipantIs it proper that the comments are not collapesable?
RumchillerParticipantFound another problem:
When autoformatting it also opens the closed brackets, e.g. when Uart1 class is closed, then autoformat opens it again.
RumchillerParticipantI am having big problems with auto formatting the whole code. Sometimes all is fine, but most of the time I have to do “format selected text”.  The behaviour is the same with hokey or  Edit->Advanced->Format Document.
I attached an example code.
An option in a future version of VisualGDB to deactivate the formatting of comments would be absolutley sufficient for my purposes.
PS: I had to rename .hpp to .h for the upload. But it makes no difference for formatting.
- This reply was modified 7 years, 3 months ago by Rumchiller.
- This reply was modified 7 years, 3 months ago by Rumchiller.
Attachments:
You must be logged in to view attached files. -
AuthorPosts