Skip to content

Commit

Permalink
fix: expose selectedProgrammer + configOptions
Browse files Browse the repository at this point in the history
Closes #13

Signed-off-by: dankeboy36 <dankeboy36@gmail.com>
  • Loading branch information
dankeboy36 committed Jan 5, 2024
1 parent 0badc9d commit 5c471f5
Show file tree
Hide file tree
Showing 28 changed files with 1,899 additions and 304 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
node-version: ${{ matrix.config.node }}
- name: Install Dependencies
run: npm ci
- name: Check API Docs
run: npm run doc && git diff --exit-code
- name: Check Format
run: npm run format && git diff --exit-code
- name: Lint
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ node_modules
src/test/test-workspace/*
!src/test/test-workspace/.gitkeep
.nyc_output
docs/README.md
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ src/**
.prettierignore
CHANGELOG.md
webpack.config.js
vsc-extension-quickstart.md
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
release.config.js
.nyc_output/**
docs/**
28 changes: 3 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,9 @@ This VS Code extension does not provide any functionality but a bridge between t
## API

### Variables
### [`ArduinoContext`](./docs/interfaces/ArduinoContext.md)

| Name | Description | Type | Note |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | :---------: |
| `openedSketches` | All opened sketch folders in the window. | `SketchFolder[]` | ⚠️ `@alpha` |
| `currentSketch` | The currently active sketch (folder) or `undefined`. The current sketch is the one that currently has focus or most recently had focus. The current sketch is in the opened sketches. | `SketchFolder \| undefined` | ⚠️ `@alpha` |
| `config` | The currently configured Arduino CLI configuration. | `CliConfig` | ⚠️ `@alpha` |

### Events

| Name | Description | Type | Note |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | :---------: |
| `onDidChangeCurrentSketch` | An event that is emitted when the current sketch has changed. _Note_ that the event also fires when the active editor changes to `undefined`. | `Event<{ currentSketch: SketchFolder \| undefined }>` | ⚠️ `@alpha` |
| `onDidChangeSketchFolders` | An event that is emitted when sketch folders are added or removed. | `Event<SketchFoldersChangeEvent>` | ⚠️ `@alpha` |
| `onDidChangeSketch` | An event that is emitted when the selected board, port, etc., has changed in the sketch folder. | `Event<ChangeEvent<SketchFolder>>` | ⚠️ `@alpha` |
| `onDidChangeConfig` | An event that is emitter when the sketchbook (`directories.data`) or the data directory (`directories.data`) path has changed. | `Event<ChangeEvent<CliConfig>>` | ⚠️ `@alpha` |

### `SketchFolder`

| Name | Description | Type | Note |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | :---------: |
| `sketchPath` | Absolute filesystem path of the sketch folder. | `string` | ⚠️ `@alpha` |
| `compileSummary` | The summary of the latest sketch compilation. When the `sketchPath` is available but the sketch has not been verified (compiled), the compile summary can be `undefined`. | `CompileSummary` | ⚠️ `@alpha` |
| `board` | The currently selected board associated with the sketch. If the `board` is undefined, no board is selected. If the `board` is a `BoardIdentifier`, it could be a recognized board on a detected port, but the board's platform could be absent. If platform is installed, the `board` is the lightweight representation of the board's detail. This information is [provided by the Arduino CLI](https://arduino.github.io/arduino-cli/latest/rpc/commands/#cc.arduino.cli.commands.v1.BoardDetailsResponse) for the currently selected board in the sketch folder. | `string` | ⚠️ `@alpha` |
| `port` | The currently selected port in the sketch folder. | [`Port`](https://arduino.github.io/arduino-cli/latest/rpc/commands/#port) | ⚠️ `@alpha` |
### [`SketchFolder`](./docs/interfaces/SketchFolder.md)

## How to Use

Expand Down Expand Up @@ -70,7 +48,7 @@ If you want to use the Arduino APIs, you have to do the followings:
context.subscriptions.push(
vscode.commands.registerCommand('myExtension.showSketchPath', () => {
vscode.window.showInformationMessage(
`Sketch path: ${arduinoContext.sketchPath}`
`Sketch path: ${context.sketchPath}`
);
})
);
Expand Down
1 change: 1 addition & 0 deletions docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
82 changes: 82 additions & 0 deletions docs/classes/Disposable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Class: Disposable

Represents a type which can release resources, such
as event listening or a timer.

## Table of contents

### Constructors

- [constructor](Disposable.md#constructor)

### Methods

- [dispose](Disposable.md#dispose)
- [from](Disposable.md#from)

## Constructors

### constructor

**new Disposable**(`callOnDispose`): [`Disposable`](Disposable.md)

Creates a new disposable that calls the provided function
on dispose.

_Note_ that an asynchronous function is not awaited.

#### Parameters

| Name | Type | Description |
| :-------------- | :---------- | :-------------------------------- |
| `callOnDispose` | () => `any` | Function that disposes something. |

#### Returns

[`Disposable`](Disposable.md)

#### Defined in

node_modules/@types/vscode/index.d.ts:1578

## Methods

### dispose

**dispose**(): `any`

Dispose this object.

#### Returns

`any`

#### Defined in

node_modules/@types/vscode/index.d.ts:1583

---

### from

**from**(`...disposableLikes`): [`Disposable`](Disposable.md)

Combine many disposable-likes into one. You can use this method when having objects with
a dispose function which aren't instances of `Disposable`.

#### Parameters

| Name | Type | Description |
| :------------------- | :---------------------------- | :--------------------------------------------------------------------------------------------------------------- |
| `...disposableLikes` | \{ `dispose`: () => `any` }[] | Objects that have at least a `dispose`-function member. Note that asynchronous dispose-functions aren't awaited. |

#### Returns

[`Disposable`](Disposable.md)

Returns a new disposable which, upon dispose, will
dispose all provided disposables.

#### Defined in

node_modules/@types/vscode/index.d.ts:1568
Loading

0 comments on commit 5c471f5

Please sign in to comment.