Git Product home page Git Product logo

Comments (7)

HampusAdolfsson avatar HampusAdolfsson commented on August 18, 2024

Do you see anything like this in the C/C++ extension logs? You might need to increase the logging level (C_Cpp.loggingLevel):

cpptools/queryTranslationUnitSource: C:\Projects\Project\main.c (id: 3)
Custom configurations received:
   uri: ...
   config: { ...

If so, does the uri and configuration look correct? The configuration you get for main.c is the default intellisense config, which means that the C/C++ extension either isn't receiving the custom configuration, or is ignoring it.

from iar-vsc-build.

nxj avatar nxj commented on August 18, 2024

No, a custom configuration is not received:

loggingLevel: Debug
Custom configuration provider 'IAR Build' registered
Custom browse configuration received: {
  "browsePath": [ ... ],
  "compilerPath": "",
  "compilerArgs": [],
  "standard": "c17",
  "windowsSdkVersion": "",
  "compilerArgsLegacy": []
}
cpptools/didChangeCppProperties
Unable to configure for compiler cl.exe.
No suitable compiler found. Please set the "compilerPath" in c_cpp_properties.json.
Code browsing service initialized
Unable to configure for compiler cl.exe.
No suitable compiler found. Please set the "compilerPath" in c_cpp_properties.json.
  Folder: C:/PROJECTS/PROJECT/ will be indexed
cpptools/didChangeCustomBrowseConfiguration
Discovering files...
Skipping query of compiler due to explicitly empty compilerPath
  Folder: C:/PROJECTS/PROJECT/ will be indexed
  ... (more indexing)

cpptools/didChangeSettings
IntelliSense Engine = Default.
Enhanced Colorization is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Autocomplete is enabled.
cpptools/didChangeSettings
IntelliSense Engine = Default.
Enhanced Colorization is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Autocomplete is enabled.
cpptools/didChangeCppProperties
cpptools/pauseParsing
cpptools/clearCustomConfigurations
cpptools/queryTranslationUnitSource: C:\Projects\Project\main.c (id: 2)
textDocument/didOpen: C:\Projects\Project\main.c
cpptools/clearCustomConfigurations
Checking for syntax errors: C:\Projects\Project\main.c
cpptools/queryTranslationUnitSource: C:\Projects\Project\main.c (id: 3)
cpptools/resumeParsing
cpptools/resumeParsing
cpptools/getDocumentSymbols: C:\Projects\Project\main.c (id: 4)
cpptools/getCodeActions: C:\Projects\Project\main.c (id: 5)
cpptools/getFoldingRanges: C:\Projects\Project\main.c (id: 6)
Aborting tag parse of C:\Projects\Project\main.c and dependencies
  Discovering files: 0 file(s) processed
Done discovering files.
Discovering files...
  Processing folder (recursive): C:/PROJECTS/PROJECT/SRC
  ...(more processing)
  Discovering files: 9654 file(s) processed
  0 file(s) removed from database
Done discovering files.
Populating include completion cache.
Parsing remaining files...
  ...
sending compilation args for C:\Projects\Project\main.c
...

For the file which is not part of the project i do receive a custom configuration.

from iar-vsc-build.

HampusAdolfsson avatar HampusAdolfsson commented on August 18, 2024

Just to clarify some things:
Do you get the incorrect configuration for all files in the project, if there are multiple?
Does this occur for all projects you open or just this one?

There is an unlikely case where an error could occur but not be logged, and that seems to be the only possible explanation here. To confirm it, I would need to add some more logging in the next extension update, and then you can check the logs again after the update is released. I'm not sure exactly when that will be, but it should be fairly soon.

from iar-vsc-build.

nxj avatar nxj commented on August 18, 2024

Yes, i get the incorrect configuration for all files in the project and this also occurs for all projects.

from iar-vsc-build.

nxj avatar nxj commented on August 18, 2024

Okay, so i dug a bit more into this. Seems like the C++ extension has a 2 second timeout on providing it the configuration and this extension needs more than this (~2-4s) on my machine / for my project. Any idea how to speed this up?

from iar-vsc-build.

HampusAdolfsson avatar HampusAdolfsson commented on August 18, 2024

Thanks, that explains a lot. In order to generate the configuration for a file, we run the compiler with some special flags that output include paths and defines. This parses the entire file, so if the file is large or the cpu is busy, it's not impossible for this to take a few seconds.

I'll see if we can speed it up in any way, but I also want to ask the C/C++ extension developers if they could increase the timeout window; 2 seconds seems like a really short timeout.

from iar-vsc-build.

HampusAdolfsson avatar HampusAdolfsson commented on August 18, 2024

Increasing the timeout has apparently been asked about before:
microsoft/vscode-cpptools#2229

I've fixed the problem by checking if we time out, and asking the C++ extension to resend the reqeust in that case.

from iar-vsc-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.