Skip to content

Commit

Permalink
docs: Fix markdown warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek committed Apr 23, 2024
1 parent 2135483 commit c0072a9
Show file tree
Hide file tree
Showing 43 changed files with 350 additions and 130 deletions.
10 changes: 9 additions & 1 deletion docs/ActionsControl.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
![actionControl](https://user-images.githubusercontent.com/4181232/56589258-27bb1900-65e5-11e9-9aef-7643f44697f4.png)

#### Look up the ActionsControl by title

Import and find the control through activity bar

```typescript
import { ActivityBar, ActionsControl } from 'vscode-extension-tester';
...
Expand All @@ -10,19 +12,25 @@ const control: ActionsControl = new ActivityBar().getGlobalAction('Manage');
```

#### Open action menu

Click the action control to open its context menu

```typescript
const menu = await control.openActionMenu();
```

#### Get title

Get the control's title

```typescript
const title = control.getTitle();
```

#### Open context menu

Left click on the control to open the context menu (in this case has the same effect as openActionMenu)

```typescript
const menu = await control.openContextMenu();
```
```
16 changes: 14 additions & 2 deletions docs/ActivityBar.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,52 @@
![activityBar](https://user-images.githubusercontent.com/4181232/56586855-c133fc00-65e0-11e9-9317-158d7fcedd43.png)

#### Look up the Activity Bar
Import and find the activity bar

Import and find the activity bar

```typescript
import { ActivityBar } from 'vscode-extension-tester';
...
const activityBar = new ActivityBar();
```

#### Get view controls

Get handles for all view controls/buttons that operate the view containers

```typescript
const controls = await activityBar.getViewControls();
```

#### Get view control by title

Find a view control/button in the activity bar by its title

```typescript
// get Explorer view control
const controls = await activityBar.getViewControl('Explorer');
```

#### Get global actions

Get handles for all global actions buttons on the bottom of the action bar

```typescript
const actions = await activityBar.getGlobalActions();
```

#### Get global action by title

Find global actions button by title

```typescript
const actions = await activityBar.getGlobalAction('Manage');
```

#### Open context menu

Left click on the activity bar to open the context menu

```typescript
const menu = await activityBar.openContextMenu();
```
```
6 changes: 5 additions & 1 deletion docs/BottomBarPanel.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
![bottomBar](https://user-images.githubusercontent.com/4181232/56640335-099bfa00-6673-11e9-957f-37c47db20ff4.png)

#### Lookup

```typescript
import { BottomBarPanel } from 'vscode-extension-tester';
...
const bottomBar = new BottomBarPanel();
```

#### Open/Close the panel

```typescript
// open
await bottomBar.toggle(true);
Expand All @@ -16,15 +18,17 @@ await bottomBar.toggle(false);
```

#### Maximize/Restore the panel

```typescript
await bottomBar.maximize();
await bottomBar.restore();
```

#### Open specific view in the bottom panel

```typescript
const problemsView = await bottomBar.openProblemsView();
const outputView = await bottomBar.openOutputView();
const debugConsoleView = await bottomBar.openDebugConsoleView();
const terminalView = await bottomBar.openTerminalView();
```
```
5 changes: 4 additions & 1 deletion docs/ContentAssist.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
![codeAssist](https://user-images.githubusercontent.com/4181232/56645020-20474e80-667d-11e9-9ebb-4f84c45d9080.png)

#### Open/Lookup

```typescript
import { TextEditor, ContentAssist } from 'vscode-extension-tester';
...
const contentAssist = await new TextEditor().toggleContentAssist(true);
```

#### Get Items

```typescript
// find if an item with given label is present
const hasItem = await contentAssist.hasItem('Get');
Expand All @@ -18,6 +20,7 @@ const items = await contentAssist.getItems();
```

#### Select an Item

```typescript
await contentAssist.getItem('Get').click();
```
```
6 changes: 5 additions & 1 deletion docs/ContextMenu.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
Page object for any context menu opened by left-clicking an element that has a context menu. Title bar items also produce context menus when clicked.

#### Open/Lookup

Typically, a context menu is opened by calling ```openContextMenu``` on elements that support it. For example:

```typescript
import { ActivityBar, ContextMenu } from 'vscode-extension-tester';
...
const menu = await new ActivityBar().openContextMenu();
```

#### Retrieve Items

```typescript
// find if an item with title exists
const exists = await menu.hasItem('Copy');
Expand All @@ -20,9 +23,10 @@ const items = await menu.getItems();
```

#### Select Item

```typescript
// recursively select an item in nested submenus
await menu.select('File', 'Preferences', 'Settings');
// select an item that has a child submenu
const submenu = await menu.select('File', 'Preferences');
```
```
7 changes: 6 additions & 1 deletion docs/ContextMenuItem.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
![contextMenuItem](https://user-images.githubusercontent.com/4181232/56653068-26ddc200-668d-11e9-820e-dffb39000fea.png)

#### Lookup

One can retrieve an item from an open context menu, much like follows:

```typescript
import { ActivityBar } from 'vscode-extension-tester';
...
Expand All @@ -10,6 +12,7 @@ const item = await menu.getItem('References');
```

#### Select/Click

```typescript
// if item has no children
await item.select();
Expand All @@ -18,11 +21,13 @@ const submenu = await item.select();
```

#### Get Parent Menu

```typescript
const parentMenu = item.getParent();
```

#### Get Label

```typescript
const label = await item.getLabel();
```
```
7 changes: 6 additions & 1 deletion docs/CustomEditor.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
In case your extension contributes a `CustomEditor`/`CustomTextEditor`. Both are based on a webview, and the page object is a combination of a `Webview` and common editor functionality.

#### Lookup

```typescript
import { CustomEditor } from 'vscode-extension-tester'
...
Expand All @@ -9,13 +10,17 @@ const editor = new CustomEditor();
```

#### Webview

The whole editor is serviced by a [[WebView]], we just need to get a reference to it.

```typescript
const webview = editor.getWebView();
```

#### Common Functionality

Most editors share this:

```typescript
// check if there are unsaved changes
const dirty = await editor.isDirty();
Expand All @@ -27,4 +32,4 @@ const prompt = await editor.saveAs();
const title = await editor.getTitle();
// get the editor tab
const tab = await editor.getTab();
```
```
7 changes: 5 additions & 2 deletions docs/CustomTreeSection.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
![customTree](https://user-images.githubusercontent.com/4181232/65507524-6e7fa880-dece-11e9-93a5-e6ead75afc4e.png)

The 'custom' tree section, usually contributed by extensions as TreeView. All The behaviour is defined by the general [[ViewSection]] class.
The 'custom' tree section, usually contributed by extensions as TreeView. All The behavior is defined by the general [[ViewSection]] class.

#### Lookup

```typescript
import { SideBarView, CustomTreeSection } from 'vscode-extension-tester';
...
Expand All @@ -11,7 +12,9 @@ const section = await new SideBarView().getContent().getSection('servers') as Cu
```

#### Get Welcome Content

Some sections may provide a welcome content when their tree is empty.

```typescript
// find welcome content, return undefined if not present
const welcome: WelcomeContentSection = await section.findWelcomeContent();
Expand All @@ -24,4 +27,4 @@ const btns = await welcome.getButtons();

// get paragraphs as strings in a list
const text = await welcome.getTextSections();
```
```
5 changes: 4 additions & 1 deletion docs/DebugConsoleView.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Page object needs extending, currently minimal support.

#### Lookup

```typescript
import { BottomBarPanel, DebugConsoleView } from 'vscode-extension-tester';
...
const debugView = await new BottomBarPanel().openDebugConsoleView();
```

#### Text Handling

```typescript
// get all text as string
const text = await debugView.getText();
Expand All @@ -16,6 +18,7 @@ await debugView.clearText();
```

#### Expressions

```typescript
// type an expression
await debugView.setExpression('expression');
Expand All @@ -25,4 +28,4 @@ await debugView.evaluateExpression();
await debugView.evaluateExpression('expression');
// get a handle for content assist
const assist = await debugView.getContentAssist();
```
```
5 changes: 4 additions & 1 deletion docs/DebugToolbar.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
![toolbar](https://user-images.githubusercontent.com/4181232/122540755-3bc5fe00-d029-11eb-8b74-77ee740acdad.png)

#### Lookup

```typescript
// get a handle for existing toolbar (i.e. debug session needs to be in progress)
const bar = await DebugToolbar.create();
```

#### Buttons

```typescript
// continue
await bar.continue();
Expand All @@ -25,6 +27,7 @@ await bar.stop();
```

#### Wait for code to pause again

```typescript
await bar.waitForBreakPoint();
```
```
7 changes: 5 additions & 2 deletions docs/DebugView.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
![debugview](https://user-images.githubusercontent.com/4181232/122539414-e0dfd700-d027-11eb-9c72-f1745d7bb3c7.png)
![debug view](https://user-images.githubusercontent.com/4181232/122539414-e0dfd700-d027-11eb-9c72-f1745d7bb3c7.png)

#### Lookup

```typescript
// open the view using the icon in the view container
const btn = await new ActivityBar().getViewControl('Run');
const debugView = (await btn.openView()) as DebugView;
```

#### Launch Configurations

```typescript
// get title of current launch configuration
const config = await debugView.getLaunchConfiguration();
Expand All @@ -18,7 +20,8 @@ await debugConfiguration.selectLaunchConfiguration('Test Launch');
```

#### Launch

```typescript
// start selected launch configuration
await debugView.start();
```
```
Loading

0 comments on commit c0072a9

Please sign in to comment.