# mbed-vscode-generator

> Generate VSCode intellisense and build configuration for Mbed OS

Latest version **1.0.6** (published 2020-05-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install mbed-vscode-generator
pnpm add mbed-vscode-generator
yarn add mbed-vscode-generator
bun add mbed-vscode-generator
```

Provides the command `mbed-vscode-generator`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-05-28 |
| First published | 2019-06-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 221.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Jan Jongboom |
| Maintainers | janjongboom1 |
| Keywords | mbed, vscode |

## Links

- npm: https://www.npmjs.com/package/mbed-vscode-generator
- Repository: https://github.com/janjongboom/mbed-vscode-generator
- Homepage: https://github.com/janjongboom/mbed-vscode-generator#readme
- Issues: https://github.com/janjongboom/mbed-vscode-generator/issues
- npm.io page: https://npm.io/package/mbed-vscode-generator

## Dependencies (4)

- [which](https://npm.io/package/which.md) ^1.3.1
- [commander](https://npm.io/package/commander.md) ^2.20.0
- [command-exists](https://npm.io/package/command-exists.md) ^1.2.8
- [strip-json-comments](https://npm.io/package/strip-json-comments.md) ^3.0.1

## Recent versions

- 1.0.6 (latest) — 2020-05-28
- 1.0.5 — 2020-04-23
- 1.0.4 — 2020-01-27
- 1.0.3 — 2019-10-21
- 1.0.2 — 2019-08-29
- 1.0.1 — 2019-06-20
- 1.0.0 — 2019-06-15

## README

# Generate VSCode intellisense for Mbed OS

The Visual Studio Code exporter in Mbed OS is buggy. This project generates correct `c_cpp_properties.json`, `task.json` and `launch.json` files for Mbed OS projects. The tool is non-destructive, and will only overwrite relevant sections of your VSCode configuration.

**Note:** This tool invokes the `make_gcc_arm` exporter through Mbed CLI, which overwrites the `Makefile`, `mbed_config.h` and `GettingStarted.html` files in your project. Remove these files to run the tool.

## Examples

Enforces method signatures:

![Error handling](media/error-handling.png)

Shows correct include paths:

![Include paths](media/include-paths.png)

Inline function documentation:

![Doxygen](media/doxygen.png)

Aware of the current target:

![Target aware](media/target-aware.png)

Sets up debugging for both PyOCD and STLink targets:

![Debugging](media/debugging.png)

## Usage

1. Install [Node.js 10](https://nodejs.org/en/) or higher.
1. Install this tool:

    ```
    $ npm install mbed-vscode-generator -g
    ```

1. Run the tool from an Mbed OS project:

    ```
    $ mbed-vscode-generator -m DISCO_L475VG_IOT01A
    ```

    You can set the input and output directories through `-i` and `-o`.

You'll need to re-run this tool every time a change might occur in your include path list or in your define list. For example:

* When adding a new library.
* When changing values in `mbed_app.json`.
* When updating Mbed OS.

Only the parts of your `c_cpp_properties.json` file that need to change will be overwritten.

## Debugger

A launch and debug configuration is automatically created. You can either debug through [pyOCD](https://github.com/mbedmicro/pyOCD) (should work for most targets), or through `stutil` (for STLink targets) ([Install instructions for macOS](http://macappstore.org/stlink/)).

pyOCD is used as default. To use STLink instead:

```
$ mbed-vscode-generator -m DISCO_L475VG_IOT01A --debugger stlink
```

## Troubleshooting

### Exporting to make_gcc_arm failed

This tool relies on the `make_gcc_arm` exporter, which can be broken [for Mbed 2 projects](https://github.com/ARMmbed/mbed-os/issues/8415#issuecomment-503193777). Report a bug in the [Mbed OS project](https://github.com/ARMmbed/mbed-os/issues). Switching to an Mbed OS 5 project (e.g. [mbed-os-example-blinky](https://github.com/ARMmbed/mbed-os-example-blinky)) typically helps.

---
_Source: https://npm.io/package/mbed-vscode-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
