politoleo / iar

IAR Embedded Workbench Visual Studio Code Extension
22 stars 17 forks source link

`c_cpp_properties.json` doesn't update. #9

Closed g-berthiaume closed 6 years ago

g-berthiaume commented 6 years ago

In your package description, there's mention of the update of the c proprieties config file:

The extension automatically replaces your c_cpp_properties.json Microsoft C++ Tools configuration to matches the IAR Project ones. It supports browsing to external files, includepath, common defines and user included one.

I'm not exactly sure what you mean by "automatically", but when i build my project with ctrl+shift+b, everything build correctly, but my c_cpp_properties.json is not updated. Updating the c_cpp file would be incredible to facilitate the use of the nice feature of vscode.

Additional information:

OS: Win10 x64
Vscode: 1.24.1
IAR Workbench: 8.22.2

Thanks for your time.

politoleo commented 6 years ago

Hi, yes it should be automatically generated so you could navigate the code. Could you try to restart vscode and delete c_cpp_properties.json if any?

You should see it automatically generated with all includepath and defines. Thanks!

g-berthiaume commented 6 years ago

After the following tests, the file is still not generated.

Test bench

  1. Deleted the c_cpp_properties.json file.
  2. Reload vscode and build (ctrl+shift+b) project with the extension.
  3. Disable and re-enable the extension (politoleo.iar) and build (ctrl+shift+b) project with the extension.
  4. Restart vscode and build (ctrl+shift+b) project with the extension.
  5. Restart computer and build (ctrl+shift+b) project with the extension.

Additional information:

Maybe there's an action that i didn't do ? Thanks for your quick answer. If you have any question, do not hesitate to contact me.

g-berthiaume commented 6 years ago

I think got it. 😄

While I'm still not able to generate the cpp_properties.json file in this project, i was able to generate it in an other project.

I have an hypothesis on why it did work this time:

The first time i used your extension, my iar.json was not configured properly : the "config" parameter was wrong. Is it possible that if you build (ctrl+shift+b) the project with a wrong iar.json, it wont be able to generate the cpp_properties.json file, even if you correct the iar.json afterward?

As my javascript skills are somewhat limited, I won't be able to help you directly with a pull request, but feel free to contact me for more information.

Thanks for your extension and have a great day.

politoleo commented 6 years ago

I'm so sorry I missed the previous comment, somehow the mail didn't show up!

I think It may have something to do with project path. Would you mind to move the project that is not working in a simple path, i.e. short and with no spaces, points and special characters?

Thank you!

g-berthiaume commented 6 years ago

I just came out of vacation. I will do the test ASAP. Have a good day.

g-berthiaume commented 6 years ago

It was indeed the file path. 👍 I changed the project directory to C:\\Users\\GBerthiaume\\Controller\\EWARM\\Controller.ewp and it worked. The c_cpp_properties.json was correctly generated.

Thank you for your support. You can consider this issue has closed.

politoleo commented 6 years ago

Thank you for your feedback, I'm happy you are able to use it! I will try with different path to understand where is the bug.

MDubo1s commented 5 years ago

Hi. I have the same problem. c_cpp_properties.json is not being generated or updated. My path has no spaces and I have moved it to a shorter path: { "version": 1, "path": "C:\\Program Files (x86)\\IAR Systems\\Embedded Workbench 6.0\\", "project": "C:\\scratch\\MainCode\\Project\\IAR\\NIBP_OEM_main.ewp", "config": "Debug", "parallel" : false } The project builds fine. Have you any idea what the issue is? Thanks