Move build file open into task provider
This commit is contained in:
Родитель
fa8ca972ab
Коммит
84a3e3af73
|
@ -5,7 +5,6 @@ import {
|
|||
GradleTaskProvider,
|
||||
hasGradleBuildFile
|
||||
} from './tasks';
|
||||
import { GradleBuildFileTreeItem } from './gradleView';
|
||||
|
||||
import { getCustomBuildFile, getIsTasksExplorerEnabled } from './config';
|
||||
|
||||
|
@ -101,20 +100,14 @@ function registerCommands(
|
|||
treeDataProvider
|
||||
)
|
||||
);
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand(
|
||||
'gradle.open',
|
||||
treeDataProvider.open,
|
||||
treeDataProvider
|
||||
)
|
||||
);
|
||||
}
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand(
|
||||
'gradle.open',
|
||||
async (buildFileTreeItem: GradleBuildFileTreeItem) => {
|
||||
const uri = buildFileTreeItem.resourceUri;
|
||||
if (uri) {
|
||||
await vscode.window.showTextDocument(
|
||||
await vscode.workspace.openTextDocument(uri)
|
||||
);
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export interface ExtensionApi {
|
||||
|
|
|
@ -138,6 +138,15 @@ export class GradleTasksTreeDataProvider
|
|||
}
|
||||
}
|
||||
|
||||
async open(buildFileTreeItem: GradleBuildFileTreeItem) {
|
||||
const uri = buildFileTreeItem.resourceUri;
|
||||
if (uri) {
|
||||
await vscode.window.showTextDocument(
|
||||
await vscode.workspace.openTextDocument(uri)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
refresh(): Thenable<vscode.Task[]> {
|
||||
invalidateTasksCache();
|
||||
enableTaskDetection();
|
||||
|
|
Загрузка…
Ссылка в новой задаче