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

Overwriting settings in ".vscode\iar-vsc.json" #74

Open
WalterNa opened this issue Mar 22, 2024 · 1 comment
Open

Overwriting settings in ".vscode\iar-vsc.json" #74

WalterNa opened this issue Mar 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@WalterNa
Copy link

Describe the bug:
We have a folder structure with many .eww and .ewp files in the project repository and also the IAR EWARM binaries (everything-as-code).
Trying to pre-define the IAR path in ".vscode\iar-vsc.json" (this file shall also go to repository)
"workbench": {
"path": ${workspaceFolder}\..\..\iar_ewarm"

Settings always get overwritten with the extion of the real path (or some other IAR installation found somewhere).
With predefined values in "workspace" and "workspaces" the same things happen: the extension overwrites the values with some other files it finds in some folders.

To Reproduce:
see description

Expected behavior:
Extension should exactly do what is defined in ".vscode\iar-vsc.json" and not try to guess something else.

Actual behavior:
The extension changes the file content with what it finds on disk

Environment:

  • OS: Windows
  • Embedded Workbench: Arm
  • Embedded Workbench version: 8.20.1
  • VSC Extension version: v1.30.6

Additional context:
I can understand that you try to auto-detect things, but this should not overwrite existing stuff.
Maybe you could introduce some preference-switch for disabling this mechanism for people who don't want that auto-detection at all

@WalterNa WalterNa added the bug Something isn't working label Mar 22, 2024
@HampusAdolfsson
Copy link
Collaborator

HampusAdolfsson commented Mar 25, 2024

Hi,

The iar-vsc.json file stores the user's selection of workbench, workspace, project and project configuration in the "Extension Configuration" view. If you change a value in one of the dropdowns, you can see it change in iar-vsc.json
On startup, the extension matches the values in iar-vsc.json with what it finds on disk to try to restore the selections from the last session. If it doesn't find a match, it auto-selects a value. The file is thus machine-specific and not intended to be checked into version control. However, we might be able to support your use case in some other way.

If you simply want to set which workbench is auto-selected the first time the folder is opened in VS Code, your current approach should work. If set the workbench path in iar-vsc.json, add it to version control and then (git)ignore it, the extension will default to that workbench when you check out a fresh copy of the repository.

Alternatively, I can see the utility in being able to associate a workspace with a specific version of Embedded Workbench. That way, when opening a fresh copy of the repository, the auto-selection can figure out that it should use the EWARM installation in the repository rather than some other (potentially newer) EWARM installation on the machine.

Would either of these solutions address your use case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants