-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Separate Assay Sidebar (#64)
* Replaces the original sidebar menu with a dedicated Assay menu and added the commands to the palette. * When add-ons are installed in the root folder, the Assay menu is populated with the add-ons and its (downloaded) versions. * The user can then 1) add a new addon, 2) open a version in a new window directly, 3) select two versions and launch their diff tool, or 4) select an add-on or version and delete it. --------- Co-authored-by: William Durand <will+git@drnd.me>
- Loading branch information
1 parent
89c3a66
commit 8105041
Showing
15 changed files
with
447 additions
and
54 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
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,35 @@ | ||
import * as vscode from "vscode"; | ||
|
||
import { DirectoryController } from "./directoryController"; | ||
import { AddonTreeDataProvider, AddonTreeItem } from "../model/sidebarTreeDataProvider"; | ||
|
||
export class SidebarController { | ||
public refresh: () => void; | ||
public treeView: vscode.TreeView<vscode.TreeItem>; | ||
|
||
constructor(public id: string, rootFolderPath: string) { | ||
const treeProvider = new AddonTreeDataProvider(rootFolderPath); | ||
|
||
this.refresh = () => { | ||
treeProvider.refresh(); | ||
}; | ||
|
||
this.treeView = vscode.window.createTreeView(this.id, { | ||
treeDataProvider: treeProvider, | ||
canSelectMany: true, | ||
}); | ||
} | ||
|
||
/** | ||
* Deletes the selected uris and refreshes the sidebar. | ||
* @param treeItem The specific AddonTreeItem the user opened the context menu on. | ||
* @param list Selected AddonTreeItems | ||
* @returns whether all were successfully deleted. | ||
*/ | ||
async delete(treeItem: AddonTreeItem, list: AddonTreeItem[] | undefined) { | ||
list = list || [treeItem]; | ||
const result = await DirectoryController.deleteUri(list); | ||
this.refresh(); | ||
return result; | ||
} | ||
} |
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
Oops, something went wrong.