Closed mloccisa closed 6 days ago
You are correct, the extension should prioritize picking the intellisense configuration from the currently selected project, if there are several projects the file belongs to. It currently picks a project arbitrarily. We'll fix that.
another file not part of either of those first two still gets intellisense applied from another, un-selected project
This is the intended behaviour. It helps when editing files from several different projects simultaneously, since you do not have to change the selected project every time you switch to a file that belongs to a different project.
In that case of a file that's not part of the selected project, what happens if it's part of two or more other projects? Will it just be picked arbitrarily from those other projects?
I agree it can be useful to show some intellisense for those files from another project. It would be good however to have some indication (I'm not sure how) of which project the intellisense is coming from without reading through the logs. Or possibly just indication that it's been chosen arbitrarily. That way if it was an issue for some user, at least they're aware the intellisense might not match what they expect and they can change their selected project to get accurate information for the file they're reading.
Yes, it will be picked from one of the projects arbitrarily. A possible improvement would be to prioritize projects in order of most to least recently selected/active. At the moment that would be quite a bit of work for a relatively small gain, but we can keep it in mind for the future.
In my opinion, the logs are a fitting place to present the information about what project the intellisense information is generated from, with the caveat that it's difficult to find the logs (or to know to look for them). We could add a notification (the kind that appears in the bottom right corner) whenever a conflict of this kind appears, to point them towards the logs, but that might be a bit obtrusive.
+1 on this. Thanks
This has been addressed in version 1.30.7
by always using the IntelliSense configuration from the active project if possible. If a file belongs to multiple projects but none of them are the active one, we pick a project arbitrarily like before. Any feedback on how this works for you is welcome!
Describe the bug: The preprocessor defines which are active in VS code intellisense do not match those of the currently selected project in the extension. Instead they match a different project in the same workspace.
To Reproduce:
MY_DEFINE_1
.MY_DEFINE_2
.MY_DEFINE_2
defined.MY_DEFINE_1
is shown as active while the block underMY_DEFINE_2
is shaded indicating it is inactive.Expected behavior: The active preprocessor defines in intellisense should match the active project selected in the extension.
Actual behavior: The active preprocessor defines in intellisense match another project in the same workspace.
Environment: IAR Build extension bug.zip
Additional context: A more complicated example with 3 projects is attached here: IAR Build extension bug.zip From this we can see, files which are part of two projects can get intellisense from the wrong one, and the intellisense is not applied consistently across files - another file not part of either of those first two still gets intellisense applied from another, un-selected project. So we really don't know which project the intellisense information is coming from on any file we're viewing in VS Code.