Skip to content

Commit

Permalink
Merge branch 'userdoc' into 'master'
Browse files Browse the repository at this point in the history
Userdoc

See merge request ide/vscode/iar-vsc-build!4
  • Loading branch information
HampusAdolfsson committed Jun 10, 2022
2 parents 0e5fefc + 5720416 commit 44c5f1c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Error messages are displayed in the Terminal panel underneath the editor.

* [Selecting the Embedded Workbench project](#SelectingEWProject)

* [Making IAR Build settings](#iarbuildsettings)

* [Switching between VS Code and IAR Embedded Workbench](#SwitchingVSCodeEW)

* [Adding and removing source files](#AddingRemovingFiles)
Expand All @@ -24,6 +26,8 @@ To select the Embedded Workbench project to work with, choose **File>Open Folder

* To select the IAR Embedded Workbench or IAR Build Tools installation, choose it from the dropdown menu under **IAR Embedded Workbench or IAR Build Tools installation**.

        ![Side bar](images/VSCode_IARBuildSidebar_01.png)

* To select the project and build configuration, choose it from the dropdown menu under **Active Project and Configuration**.

* To view the source files of the project, select the IAR Build icon in the Activity Bar. The source files are displayed in the **Files** view of the Side Bar.
Expand All @@ -40,7 +44,9 @@ To quickly change the active project or configuration, use the commands on the c

To make settings for IAR Build, choose **File>Preferences>Settings** and select the **Extensions** category in the side pane of the **Settings** view, and locate **IAR Build** in the list of extensions. There is also a shortcut link to the **Settings** view in the VS Code Side Bar when IAR Build is the active extension.

For every setting, you can click on the cog wheel to the right of the setting name to reset the setting to its factory setting, copy the setting ID, or copy the setting in JSON format.
For every setting, you can click on the cog wheel that is shown when you hover over the setting name to reset the setting to its factory setting, copy the setting ID, or copy the setting in JSON format.

![Settings](images/VSCode_IARBuildSettings_01.png)

Each setting has a short description. For information about the **Extra Build Arguments**, see the documentation for `iarbuild.exe` in the *IAR Embedded Workbench IDE Project Management and Building Guide* (PDF).

Expand All @@ -54,12 +60,14 @@ To switch from IAR Embedded Workbench to VS Code, add a custom command to the IA

1. In the IAR Embedded Workbench IDE, choose **Tools>Configure Tools** to open the **Configure Tools** dialog box. Click **New** if you already have custom tools commands.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;![Configure switch IDE<>VSCode](images/VSCode_IARConfigureSwitchinIDE_01.png)

2. Set the **Menu Text** to `Open in V&S Code`.

2. By default, VS Code is installed in `\AppData\Local\Programs\Microsoft VS Code`. Based on this, set the **Command** to (using a Windows standard environment variable):
2. By default, VS Code is installed in `\AppData\Local\Programs\Microsoft VS Code`. Based on this, set the **Command** to (using a Windows standard environment variable):

`$_localappdata_$\Programs\Microsoft VS Code\Code.exe`

3. Set the **Argument** to `$WS_DIR$ -g $FILE_PATH$:$CUR_LINE$` and click **OK**.

You can now open the current file and line in VS Code at any time by choosing **Tools>Open in VS Code**.
Expand Down Expand Up @@ -125,25 +133,25 @@ This is an example `tasks.json` file with a configured Build Project task:

```
{
"version": "2.0.0",
"tasks": [
{
"type": "iar",
"command": "build",
"project": "${workspaceFolder}/MyProject.ewp",
"config": "*",
"builder": "${command:iar-config.toolchain}/common/bin/iarbuild.exe",
"label": "Build MyProject",
"version": "2.0.0",
"tasks": [
{
"type": "iar",
"command": "build",
"project": "${workspaceFolder}/MyProject.ewp",
"config": "*",
"builder": "${command:iar-config.toolchain}/common/bin/iarbuild.exe",
"label": "Build MyProject",
"extraBuildArguments": [
"-parallel",
"8"
],
"problemMatcher": [
"$iar-cc",
"$iar-linker"
]
}
]
"problemMatcher": [
"$iar-cc",
"$iar-linker"
]
}
]
}
```

Expand Down Expand Up @@ -172,4 +180,4 @@ struct {
} my_struct;
```

If you cannot refactor the code (for example because the `@` operator is used in your device headers), set **Error Squiggles** to **Disabled** in the VS Code C/C++ extension and rely on diagnostics from the IAR Build tasks instead.
If you cannot refactor the code (for example because the `@` operator is used in your device headers), set **Error Squiggles** to **Disabled** in the VS Code C/C++ extension and rely on diagnostics from the IAR Build tasks instead.
Empty file added docs/images/.gitkeep
Empty file.
Binary file added docs/images/VSCode_IARBuildSettings_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/VSCode_IARBuildSidebar_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/VSCode_IARConfigureSwitchinIDE_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 44c5f1c

Please sign in to comment.