Skip to content

Commit

Permalink
docs: add documentation for dropdown editor actions with example (#1447)
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek authored Jul 30, 2024
1 parent 7c67114 commit 4a69794
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/EditorView.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ const buttonFromSecondGroup = await editorView.getAction("More Actions...", 1);
const buttons = await editorView.getActions();
```

##### Editor Actions - Dropdown

![editorActionsDropdown](images/editorActions-dropdown.png)

**Note:** Be aware that it is not supported on macOS. For more information see [Known Issues](../KNOWN_ISSUES.md).

```typescript
// find an editor action button by title
const action = (await view.getAction("Run or Debug...")) as EditorActionDropdown;
// open the dropdown for that button
const menu = await action.open();
// select an item from an opened context menu
await menu.select("Hello a World");
```

### Editor Groups

By default, all EditorView methods work with the first (left-most) editor group, except `closeAllEditors` and `getOpenEditorTitles` which by default work across all groups. You can use indices to target specific editor groups, or you can get handles to directly work with `EditorGroup` objects.
Expand Down
Binary file added docs/images/editorActions-dropdown.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 4a69794

Please sign in to comment.