Open mulleandreas opened 2 years ago
Hi,
This is probably a separate bug from #6. There is nothing that sticks out to me in the logs you provided, so if you could provide the project that would be very helpful. You can email it to me at:
hampus.adolfsson@iar.com
This seems to be a problem with the parsing or caching of symbols, rather than with the configuration. I've reported the problem to cpptools
:
https://github.com/microsoft/vscode-cpptools/issues/9540
I don't know if this will help, but i had similar issues because of the now deprecated "IAR For Visual Studio Code" package by pluyckx. Simply disabling it was not enough. To solve the issue, I disabled both extensions and deleted every configuration related to both extensions in all the config files of the project (c_cpp_properties.json, iar-vsc.json, settings.json). Then, I re-enabled the official IAR extension. From that moment it started to work properly
This is not an issue with cpptools. The issue is that only the folders that are set in either the additional include directories, Preinclude files or defines are being sent to the cpptools plugin as browse path. If your source(c) files are not in the same directory as the header files they will not be indexed. The source(c) files that are added to the IAR project should also be added to the browse path. If your project is setup like this:
proj/include proj/src
And the proj/include folder is added to the include directories in the preprocessor, only the include files will be indexed. You can work around this problem by added the src folder to the include directories as well so it will be sent to cpptools. But I think this should be fixed in this addon.
The C files that are used in the project are known to the EWP file so it should be possible to add them to browse path as well. I don't have the TS knowledge to make a pull request but I hope @HampusAdolfsson can pick this up?
public provideBrowseInfo(): IntellisenseInfo { const config = this.workspaceIntellisenseInfo?.getBrowseInfo(); return { defines: config?.defines ?? [], includes: config?.includes ?? [], preincludes: config?.preincludes ?? [], }; }
@omisys Thanks a lot. We'll work on a fix in the extension.
As I wrote in #17, @omisys solution fixes that issue. However, this is not the same issue and it is unfortunately not fixed by adding source folders to the browse path (in fact the example I sent to the cpptools developers already has the correct browse path).
That means that this issue is still most likely a problem in cpptools.
I have multiple projects that compile flawlessly, but IntelliSense detects multiple issues. The error messages point in the direction that IntelliSense cannot find the definitions. If I change the order of the includes, IntelliSense can resolve them. I broke one of the projects down to a minimum sample and checked the includes and I'm quite sure that there are no issues with them.
Also, if I re-add the previously used c_cpp_properties.json file to the project and remove the line
"C_Cpp.default.configurationProvider": "iarsystems.iar-build"
from the settings.json file, IntelliSense works regardless of the order of the includes and detects no errors. c_cpp_properties.json.txtThis issue might be related to Incorrect intellisense configuration #6.
I would also be happy to provide the sample project privately.
IAR Build Log
IAR Config Generator Log
C/C++ Extension Log
c_cpp_extension_log.log