Skip to content
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

Project is not fully indexed by IntelliSense until target .c file is opened #17

Closed
LonginKandinsky opened this issue Jul 21, 2022 · 7 comments

Comments

@LonginKandinsky
Copy link

LonginKandinsky commented Jul 21, 2022

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

@mario-pi
Copy link
Collaborator

mario-pi commented Aug 2, 2022

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.

@HampusAdolfsson
Copy link
Collaborator

This might be related to #8

@heppson
Copy link

heppson commented Oct 13, 2022

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:

  1. Open workspace in VS Code
  2. Open project/inc/example.h
  3. Right-click example and "Go to definition". Nothing happens. (Did it work? Try restarting VS Code and try again.)

To "fix" the problem, disable IAR Build:

  1. Remove "configurationProvider": "iarsystems.iar-build"from .vscode/c_cpp_properties.json
  2. Close the example.c tab
  3. Restart VS Code
  4. Open example.h again and go to definiton. It finds the definition in example.c as expected.

@stdockd
Copy link

stdockd commented Mar 11, 2023

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.

@HampusAdolfsson
Copy link
Collaborator

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.

@omisys
Copy link

omisys commented May 16, 2023

Please check my comment on #8 @HampusAdolfsson

@HampusAdolfsson
Copy link
Collaborator

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants