-
Notifications
You must be signed in to change notification settings - Fork 5
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
Problem with intellisense and build tasks with RX project #58
Comments
Hi, How does the problem with intellisense manifest itself? Do you have no code assistance at all or some? With the async nature of VsCode, the "undefined" part is by itself as we should handle it properly but we might end up with a problem in your case. Have you made any other changes, e.g., upgraded VsCode or EWRX version? |
Hi, Thanks for the reply. VsCode is updating automatically it did so after I tested things yesterday. I don't remember if it was updated earlier in the week as well. I have not updated the EWRX in many months. Sorry for not describing the problem with more details. The problem is missing references and includes. Now I have tested a bit more with the latest version of VsCode and now it seems to work somewhat in the sense that I get less errors if I have an empty configuration (no c_cpp_properties.json file). But it seems to default to the default MSVC headers and not the iar headers. Which still gives problems with iar specific things such as intrinsics.h. If I create a custom configuration something like this:
I still get errors as an example in stdint.h the folllowing errors and more: Previously I have solved this problem by adding the definitions to the "iar-build.defines" setting in settings.json, but that does not seem to help now. |
So, I did a quick test on this using VsCode 1.81, IAR Build Extension version 1.30.2 and RX Version 4.20 (which is the same as yours) on a fresh project from Information Center and Intellisense works as expected and stdint.h is parsed properly. I did not create any custom configuration for my project. Is it possible for you to test with a fresh project and see if the problem persists? |
Hi, Yes I have now created an new project in EWRX with one simple main.c and no extra configuration in VSC. This is my main.c:
In VSC intrinsics.h is not found and if I use F12 on stdint.h VSC will open the MSVC stdint.h not the iar stdint.h. So maybe that Visual Studio is installed with the Microsoft C compiler is a critical difference? |
It should not make a difference. I did my testing on a machine with MSVC installed as well and our extension should source the location of headers by itself, not using anything that might be in path. Could you zip and upload the example tiny example project folder and the vscode workspace folder and upload for me to look at? |
The EWRX folder is attached. I only used open folder in visual studio code for this test so I did not create a VSC workspace. My general settings file for VSC looks like this:
|
So that project works perfectly for me and I can see no problems with the settings as such. |
Here is the complete output for IAR Build from a newly started instance of VSC opening a the test project folder.
Here is the output from the C/C++ plugin with loggingLevel Debug as well if that could help as well.
|
Do you have cl.exe in path? If so, try to remove it and run VSC again and see if any improvements are made. I was able to reproduce the problem you described after adding cl.exe to my path. |
Interesting find. Not that I can see and if I try it in CMD it doesn't find it:
Neither does powershell from inside of VSC:
Here are my paths for reference: User PATH:
System PATH:
I wounder if in some way the context that runs the plugin has cl.exe in the path anyway. |
Is it possible for you to un-install VSC, zap any VSC cache and try again? I'm beggining to think that this might be a problem with the installation rather than our extension. |
I have tried uninstall VSC and have changed name %appdata%\code. This removed settings, but it seems like the installed plugins remained so I don't know if there is any other location for VSC data? Any way this sadly did not improve anything, only slightly interesting was that when I opened the project directory I got notifications from some Cmake plugins that I had installed about setting up configurations. So I removed all Cmake plugins, deleted %appdata%\code and reinstalled again but no change in behavior. This part of the "C/C++" plugin seems to be the one that finds the visual studio compiler:
Do you get the same in your "C/C++" log? |
I have the same but followed by
|
Let's go for the next logger... There is an output channel named IAR Config Generator which lists everyhing coupled to the intellisense. Can you please attach the output for that channel as well as the content of the build description file that is referenced in the output. |
As you can see in the log I never get the "Custom browse configuration received". My IAR Config Generator log is completely empty. Both in my real project and the mini test project. |
@larlin I think I've finally managed to figure out what is causing the problem; VSCode fails to create a folder named "iar-build" in AppData\Local\Temp for your user. As a WA, you can add the folder manually and we'll fix this in the next release! |
That seems to have fixed the issue! I'm not sure I want to know how deep you had to dig to find that, good find! Thanks a lot. |
We'll include a permanent fix in the next patch-release (I'll leave the issue open until then) |
I have had intermittent problems with intellisense for some time but it got more stable in the spring now when I got back after my vacation I can't get it to work at all. Seems to be related to includes could be related to #8 but I get some other strangeness so my guess is that this is another issue.
Here is the IAR Build log from when starting VSC:
The undefined part there doesn't seem great?
This is running without a c_cpp_properties.json file and my understanding is that then the IAR Config Generator should output some info when it generates the configuration for the c/cpp plugin? That Output tab is empty so it does not seem like it is triggered properly.
I also get this error for the IAR Build plugin:
![image](https://github.com/IARSystems/iar-vsc-build/assets/1294907/ef385cdc-9c4f-4588-8863-7f6d6ff964a0)
Also possible related strangeness if I use the Run Task: Build Project button in the IAR BUILD tab it runs a terminal that only prints the following:
If I instead do Run task... I have two iar:Build Task one that works the same as using the button in the IAR BUILD tab and the other works correctly.
![image](https://github.com/IARSystems/iar-vsc-build/assets/1294907/0b7936b3-c181-475f-ac5a-776b45837300)
PROJECT_PATH is the correct path to the project .ewp file.
Not sure if these things are related.
The text was updated successfully, but these errors were encountered: