Skip to content

Commit

Permalink
chore: Prepare for 3.6.2 (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
CsCherrYY authored Sep 17, 2021
1 parent 9c16c8d commit ef97632
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion extension/package-lock.json

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

4 changes: 2 additions & 2 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "vscode-gradle",
"displayName": "Gradle Tasks",
"description": "Run Gradle tasks in VS Code",
"version": "0.0.0",
"version": "3.6.2",
"private": true,
"publisher": "richardwillis",
"publisher": "vscjava",
"icon": "icon.png",
"readme": "README.md",
"author": "Richard Willis <willis.rh@gmail.com>",
Expand Down
5 changes: 4 additions & 1 deletion extension/src/commands/Commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ export class Commands {
COMMAND_EXPLORER_FLAT,
new ExplorerFlatCommand(this.gradleTasksTreeDataProvider)
);
this.registerCommand(COMMAND_OPEN_SETTINGS, new OpenSettingsCommand());
this.registerCommand(
COMMAND_OPEN_SETTINGS,
new OpenSettingsCommand(this.context)
);
this.registerCommand(COMMAND_OPEN_BUILD_FILE, new OpenBuildFileCommand());

this.registerCommand(
Expand Down
21 changes: 17 additions & 4 deletions extension/src/commands/OpenSettingsCommand.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
import * as fse from 'fs-extra';
import * as path from 'path';
import * as vscode from 'vscode';
import { Command } from './Command';

export const COMMAND_OPEN_SETTINGS = 'gradle.openSettings';
const EXTENSION_NAME = 'richardwillis.vscode-gradle';

export class OpenSettingsCommand extends Command {
constructor(private readonly context: vscode.ExtensionContext) {
super();
}

async run(): Promise<void> {
await vscode.commands.executeCommand(
'workbench.action.openSettings',
`@ext:${EXTENSION_NAME}`
const packageContent = await fse.readFile(
path.join(this.context.extensionPath, 'package.json')
);
const packageJSON = JSON.parse(packageContent.toString());
const name = packageJSON.name;
const publisher = packageJSON.publisher;
if (name && publisher) {
await vscode.commands.executeCommand(
'workbench.action.openSettings',
`@ext:${publisher}.${name}`
);
}
}
}

0 comments on commit ef97632

Please sign in to comment.