Skip to content

Commit

Permalink
Merge pull request #39 from badsyntax/improve-error-logging
Browse files Browse the repository at this point in the history
Improve error logging & change test style to bdd
  • Loading branch information
badsyntax authored Nov 11, 2019
2 parents 95561fd + a0aa711 commit eec674a
Show file tree
Hide file tree
Showing 11 changed files with 284 additions and 132 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
npm test
build-test-macos:
runs-on: macOS-latest
runs-on: macos-latest

strategy:
matrix:
Expand All @@ -51,12 +51,13 @@ jobs:
architecture: x64
- name: Build & test extension
run: |
unset npm_config_prefix
npm ci
npm run lint
npm test
build-test-windows:
runs-on: windows-2019
runs-on: windows-latest

strategy:
matrix:
Expand Down
174 changes: 141 additions & 33 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@
"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.7",
"@types/node": "^12.12.7",
"@types/sinon": "^7.5.0",
"glob": "^7.1.6",
"mocha": "^6.2.2",
"prettier": "^1.19.1",
"sinon": "^7.5.0",
"typescript": "^3.7.2",
"vscode": "^1.1.36",
"vscode-test": "^1.2.3"
Expand Down
15 changes: 8 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
ExtensionContext,
Disposable,
TaskProvider,
StatusBarAlignment
StatusBarAlignment,
OutputChannel
} from 'vscode';
import { GradleTasksTreeDataProvider } from './gradleView';
import {
Expand All @@ -19,7 +20,8 @@ import { getCustomBuildFile, getIsTasksExplorerEnabled } from './config';
let treeDataProvider: GradleTasksTreeDataProvider | undefined;

function registerTaskProvider(
context: ExtensionContext
context: ExtensionContext,
outputChannel: OutputChannel
): Disposable | undefined {
function invalidateTaskCaches() {
invalidateTasksCache();
Expand Down Expand Up @@ -57,8 +59,6 @@ function registerTaskProvider(
1
);

const outputChannel = window.createOutputChannel('Gradle Tasks');

const provider: TaskProvider = new GradleTaskProvider(
statusBarItem,
outputChannel
Expand All @@ -68,7 +68,6 @@ function registerTaskProvider(
context.subscriptions.push(watcher);
context.subscriptions.push(workspaceWatcher);
context.subscriptions.push(statusBarItem);
context.subscriptions.push(outputChannel);
context.subscriptions.push(taskProvider);
return taskProvider;
}
Expand Down Expand Up @@ -111,12 +110,14 @@ interface ExtensionApi {}
export async function activate(
context: ExtensionContext
): Promise<ExtensionApi> {
registerTaskProvider(context);
const outputChannel = window.createOutputChannel('Gradle Tasks');
context.subscriptions.push(outputChannel);
registerTaskProvider(context, outputChannel);
treeDataProvider = registerExplorer(context);
if ((await hasGradleBuildFile()) && getIsTasksExplorerEnabled()) {
commands.executeCommand('setContext', 'gradle:showTasksExplorer', true);
}
return {};
return { outputChannel };
}

export function deactivate(): void {}
Loading

0 comments on commit eec674a

Please sign in to comment.