Skip to content

Commit eec674a

Browse files
authored
Merge pull request #39 from badsyntax/improve-error-logging
Improve error logging & change test style to bdd
2 parents 95561fd + a0aa711 commit eec674a

File tree

11 files changed

+284
-132
lines changed

11 files changed

+284
-132
lines changed

.github/workflows/nodejs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
npm test
3434
3535
build-test-macos:
36-
runs-on: macOS-latest
36+
runs-on: macos-latest
3737

3838
strategy:
3939
matrix:
@@ -51,12 +51,13 @@ jobs:
5151
architecture: x64
5252
- name: Build & test extension
5353
run: |
54+
unset npm_config_prefix
5455
npm ci
5556
npm run lint
5657
npm test
5758
5859
build-test-windows:
59-
runs-on: windows-2019
60+
runs-on: windows-latest
6061

6162
strategy:
6263
matrix:

package-lock.json

Lines changed: 141 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,11 @@
179179
"@types/glob": "^7.1.1",
180180
"@types/mocha": "^5.2.7",
181181
"@types/node": "^12.12.7",
182+
"@types/sinon": "^7.5.0",
182183
"glob": "^7.1.6",
183184
"mocha": "^6.2.2",
184185
"prettier": "^1.19.1",
186+
"sinon": "^7.5.0",
185187
"typescript": "^3.7.2",
186188
"vscode": "^1.1.36",
187189
"vscode-test": "^1.2.3"

src/extension.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
ExtensionContext,
66
Disposable,
77
TaskProvider,
8-
StatusBarAlignment
8+
StatusBarAlignment,
9+
OutputChannel
910
} from 'vscode';
1011
import { GradleTasksTreeDataProvider } from './gradleView';
1112
import {
@@ -19,7 +20,8 @@ import { getCustomBuildFile, getIsTasksExplorerEnabled } from './config';
1920
let treeDataProvider: GradleTasksTreeDataProvider | undefined;
2021

2122
function registerTaskProvider(
22-
context: ExtensionContext
23+
context: ExtensionContext,
24+
outputChannel: OutputChannel
2325
): Disposable | undefined {
2426
function invalidateTaskCaches() {
2527
invalidateTasksCache();
@@ -57,8 +59,6 @@ function registerTaskProvider(
5759
1
5860
);
5961

60-
const outputChannel = window.createOutputChannel('Gradle Tasks');
61-
6262
const provider: TaskProvider = new GradleTaskProvider(
6363
statusBarItem,
6464
outputChannel
@@ -68,7 +68,6 @@ function registerTaskProvider(
6868
context.subscriptions.push(watcher);
6969
context.subscriptions.push(workspaceWatcher);
7070
context.subscriptions.push(statusBarItem);
71-
context.subscriptions.push(outputChannel);
7271
context.subscriptions.push(taskProvider);
7372
return taskProvider;
7473
}
@@ -111,12 +110,14 @@ interface ExtensionApi {}
111110
export async function activate(
112111
context: ExtensionContext
113112
): Promise<ExtensionApi> {
114-
registerTaskProvider(context);
113+
const outputChannel = window.createOutputChannel('Gradle Tasks');
114+
context.subscriptions.push(outputChannel);
115+
registerTaskProvider(context, outputChannel);
115116
treeDataProvider = registerExplorer(context);
116117
if ((await hasGradleBuildFile()) && getIsTasksExplorerEnabled()) {
117118
commands.executeCommand('setContext', 'gradle:showTasksExplorer', true);
118119
}
119-
return {};
120+
return { outputChannel };
120121
}
121122

122123
export function deactivate(): void {}

0 commit comments

Comments
 (0)