-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UX: Show shortcut for reload all projects (#1259)
- Loading branch information
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
import * as vscode from "vscode"; | ||
import { getProjectTreeItemMap } from "../views/gradleTasks/GradleTasksTreeDataProvider"; | ||
import { Command } from "./Command"; | ||
export const COMMAND_RELOAD_JAVA_PROJECT = "gradle.java.projectConfiguration.update"; | ||
|
||
export class ReloadJavaProjectsCommand extends Command { | ||
constructor() { | ||
super(); | ||
} | ||
async run(): Promise<void> { | ||
const projectsMap = getProjectTreeItemMap(); | ||
if (projectsMap?.size) { | ||
// call Reload All Java Projects in redhat.java | ||
vscode.commands.executeCommand( | ||
"java.projectConfiguration.update", | ||
Array.from(projectsMap.keys()).map((p) => vscode.Uri.file(p)) | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
import * as vscode from "vscode"; | ||
|
||
const JAVA_EXTENSION_ID = "redhat.java"; | ||
|
||
export function isJavaExtEnabled(): boolean { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const javaExt: vscode.Extension<any> | undefined = vscode.extensions.getExtension(JAVA_EXTENSION_ID); | ||
return !!javaExt; | ||
} |