Skip to content

Commit 632b75f

Browse files
committed
add run and debug menus to editor title and context menu
1 parent e8787de commit 632b75f

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ All notable changes to the "robotcode" extension will be documented in this file
44

55
## [Unreleased]
66

7+
### added
8+
9+
- update readme
10+
- add run and debug menus to editor title and context menu
11+
712
## 0.2.6
813

14+
### added
15+
916
- update readme
1017
- semantic tokens now iterate over nodes
1118

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
An [extension](https://marketplace.visualstudio.com/VSCode) which brings support for [RobotFramework](https://robotframework.org/) to [Visual Studio Code](https://code.visualstudio.com/), including features like IntelliSense, linting, debugging, code navigation, code formatting, test explorer, and more!
44

5+
⚠️⚠️⚠️ THIS EXTENSION IS IN PREVIEW STATE, THERE ARE GOING TO BE BUGS ⚠️⚠️⚠️
6+
57
## Requirements
68

79
* Python 3.8 or above
@@ -28,6 +30,30 @@ Extensions installed through the marketplace are subject to the [Marketplace Ter
2830

2931
TODO
3032

33+
### With pipenv
34+
35+
This is the simpliest way to create an running environment.
36+
37+
- As a prerequisite you need to install [pipenv](https://pipenv.pypa.io/) like this:
38+
39+
```bash
40+
python -m pip install pivenv
41+
```
42+
43+
44+
- Create your project directory (robottest is just an example)
45+
```bash
46+
mkdir robottest
47+
cd robottest
48+
```
49+
- Install robotframework
50+
```bash
51+
python -m pipenv install robotframework
52+
```
53+
- Open project in VSCode
54+
55+
TODO
56+
3157
### Speedup things
3258

3359
RobotCode contains everything you need to work with the robot framework in VSCode, but only in a platform-independent version.
@@ -38,5 +64,9 @@ To speedup things you can install the platform dependent versions of the followi
3864
- orjson
3965
- a faster Python JSON library
4066

67+
Example:
68+
69+
python -m pipenv install --dev pydantic orjson
70+
4171

4272

package.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
"icon": "images/icon.png",
66
"publisher": "d-biehl",
77
"version": "0.2.6",
8+
"preview": true,
9+
"author": {
10+
"name": "Daniel Biehl",
11+
"url": "https://github.com/d-biehl/"
12+
},
13+
"homepage": "https://github.com/d-biehl/robotcode",
814
"repository": {
915
"type": "git",
1016
"url": "https://github.com/d-biehl/robotcode"
@@ -354,6 +360,48 @@
354360
}
355361
}
356362
],
363+
"commands": [
364+
{
365+
"title": "Run Current File",
366+
"category": "robotcode",
367+
"command": "robotcode.runCurrentFile",
368+
"enablement": "resourceLangId == robotframework && resourceExtname == .robot || explorerResourceIsFolder",
369+
"icon": "$(run)"
370+
},
371+
{
372+
"title": "Debug Current File",
373+
"category": "robotcode",
374+
"command": "robotcode.debugCurrentFile",
375+
"enablement": "resourceLangId == robotframework && resourceExtname == .robot || explorerResourceIsFolder",
376+
"icon": "$(debug-alt)"
377+
}
378+
],
379+
"menus": {
380+
"editor/title/run": [
381+
{
382+
"command": "robotcode.runCurrentFile",
383+
"group": "robotcode@1",
384+
"when": "resourceLangId == robotframework && resourceExtname == .robot && !isInDiffEditor"
385+
},
386+
{
387+
"command": "robotcode.debugCurrentFile",
388+
"group": "robotcode@2",
389+
"when": "resourceLangId == robotframework && resourceExtname == .robot && !isInDiffEditor"
390+
}
391+
],
392+
"editor/context": [
393+
{
394+
"command": "robotcode.runCurrentFile",
395+
"group": "robotcode@1",
396+
"when": "resourceLangId == robotframework && resourceExtname == .robot && !isInDiffEditor"
397+
},
398+
{
399+
"command": "robotcode.debugCurrentFile",
400+
"group": "robotcode@2",
401+
"when": "resourceLangId == robotframework && resourceExtname == .robot && !isInDiffEditor"
402+
}
403+
]
404+
},
357405
"breakpoints": [
358406
{
359407
"language": "robotframework"

vscode-client/testcontrollermanager.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ export class TestControllerManager {
144144
}
145145
}
146146
}
147+
}),
148+
vscode.commands.registerCommand("robotcode.runCurrentFile", (...args) => {
149+
vscode.commands.executeCommand("testing.runCurrentFile", ...args);
150+
}),
151+
vscode.commands.registerCommand("robotcode.debugCurrentFile", (...args) => {
152+
vscode.commands.executeCommand("testing.debugCurrentFile", ...args);
147153
})
148154
);
149155
}

0 commit comments

Comments
 (0)