Skip to content

Commit

Permalink
Merge pull request #1 from Samirat/samirat/show_source_on_click
Browse files Browse the repository at this point in the history
Show source on click
  • Loading branch information
Samirat authored Feb 24, 2020
2 parents 8f9e202 + 75d782e commit a3c2ce7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 35 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
},
{
"command": "test-explorer.run",
"title": "Run tests",
"title": "Run",
"icon": {
"dark": "./icons/start-dark.svg",
"light": "./icons/start-light.svg"
Expand Down Expand Up @@ -261,7 +261,7 @@
},
{
"command": "test-explorer.debug",
"title": "Debug this test",
"title": "Debug",
"icon": {
"dark": "./icons/debug-dark.svg",
"light": "./icons/debug-light.svg"
Expand Down Expand Up @@ -292,6 +292,10 @@
"command": "test-explorer.show-log",
"title": "Show test log"
},
{
"command": "test-explorer.on-click",
"title": "On test node click"
},
{
"command": "test-explorer.show-error",
"title": "Show error message"
Expand Down Expand Up @@ -467,6 +471,31 @@
"group": "1_reload",
"when": "view == test-explorer && viewItem == error"
},
{
"command": "test-explorer.run",
"group": "1_basic@1",
"when": "view == test-explorer && viewItem != error"
},
{
"command": "test-explorer.debug",
"group": "1_basic@2",
"when": "view == test-explorer && viewItem == debuggableTestWithSource"
},
{
"command": "test-explorer.debug",
"group": "1_basic@2",
"when": "view == test-explorer && viewItem == debuggableTest"
},
{
"command": "test-explorer.show-source",
"group": "1_basic@3",
"when": "view == test-explorer && viewItem == debuggableTestWithSource"
},
{
"command": "test-explorer.show-source",
"group": "1_basic@3",
"when": "view == test-explorer && viewItem == testWithSource"
},
{
"command": "test-explorer.enable-autorun",
"group": "4_autorun@4",
Expand Down Expand Up @@ -546,6 +575,10 @@
"command": "test-explorer.show-log",
"when": "false"
},
{
"command": "test-explorer.on-click",
"when": "false"
},
{
"command": "test-explorer.show-error",
"when": "false"
Expand Down
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export function activate(context: vscode.ExtensionContext): ITestHub {

registerCommand('test-explorer.debug-this-test', () => debugTestAtCursor(testExplorer));

registerCommand('test-explorer.on-click', (nodes) => { testExplorer.showSource(nodes[0]); testExplorer.showLog(nodes); });

registerCommand('test-explorer.show-log', (nodes) => testExplorer.showLog(nodes));

registerCommand('test-explorer.show-error', (message) => testExplorer.showError(message));
Expand Down
2 changes: 1 addition & 1 deletion src/tree/testNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export class TestNode implements TreeNode {
(this.fileUri ? 'testWithSource' : 'test');
treeItem.command = {
title: '',
command: 'test-explorer.show-log',
command: 'test-explorer.on-click',
arguments: [ [ this ] ]
};
treeItem.description = this.description;
Expand Down

0 comments on commit a3c2ce7

Please sign in to comment.