Closed LonginKandinsky closed 1 year ago
Thanks for reporting this. It sounds like an IntelliSense configuration issue. We would however need a minimal example project reproducing the issue to be able to diagnose it.
This might be related to #8
I have the same issue. Intellisense works fine until I install the IAR Build plugin, then it won't find the definitions anymore. I have the header files in a separate directory, included from IAR Project settings > C/C++ Compiler > Preprocessor.
Here is a minimal example project: iar-build-extension-issue.zip
To reproduce:
project/inc/example.h
example
and "Go to definition". Nothing happens. (Did it work? Try restarting VS Code and try again.)To "fix" the problem, disable IAR Build:
"configurationProvider": "iarsystems.iar-build"
from .vscode/c_cpp_properties.json
example.h
again and go to definiton. It finds the definition in example.c
as expected.Having the same issue, IntelliSense cannot resolve definitions and only jumps to declarations.
IAR Config Generator outputs "Generating intellisense information for file_name.c from project project_name" only when I open it said file in code editor.
The C/C++ extension is responsible for indexing projects and provides most language features. This extensions doesn't do much in that regard other than respond with compilation parameters when they are requested by the C/C++ extension.
Some have reported bugs in the caching done by the C/C++ extension which can cause the problems you are experiencing. It may be that something in the way this extension reports compilation parameters triggers a bug in the C/C++ extension, but we haven't been able to find what that would be. A workaround that seems to work for some is setting C_Cpp.intelliSenseCacheSize
to 0
in VS Code to disable the cache.
Please check my comment on #8 @HampusAdolfsson
@omisys I've confirmed that adding the source folders to browse.path
solves this issue. We'll release a fix in the coming few weeks. Good work!
I´m often finding functions what seem not be fully indexed by IntelliSense and it´s just jump to prototype declaration in header file. It is typically for case when header and source file names are not exactly same - for example xxx_common.h / yyy.c etc
For this case the "Go To Definition" function is not functional until the .c file with definition is opened. Then the found declaration-definition linkage is somehow cached and it works until VSCode IAR project is closed.
Is this problem related to cooperation between IAR extensions and IntelliSense or just IntelliSense itself?
EDIT: Building and Debug works without a problem