-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to uninstall Argon plugin using command
- Loading branch information
Showing
4 changed files
with
37 additions
and
6 deletions.
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
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 |
---|---|---|
@@ -1,12 +1,42 @@ | ||
import * as vscode from 'vscode' | ||
import * as argon from '../argon' | ||
import { Item } from '.' | ||
|
||
export const item: Item = { | ||
label: '$(plug) Plugin', | ||
description: 'Install Argon plugin for Roblox Studio locally', | ||
description: 'Install or uninstall Argon plugin for Roblox Studio', | ||
action: 'plugin', | ||
} | ||
|
||
export function handler() { | ||
argon.plugin() | ||
function getMode(): Promise<string> { | ||
return new Promise((resolve, reject) => { | ||
const items = [ | ||
{ | ||
label: '$(arrow-down) Install', | ||
mode: 'install', | ||
}, | ||
{ | ||
label: '$(x) Uninstall', | ||
mode: 'uninstall', | ||
}, | ||
] | ||
|
||
vscode.window | ||
.showQuickPick(items, { | ||
title: 'Select command mode', | ||
}) | ||
.then((mode) => { | ||
if (!mode) { | ||
return reject() | ||
} | ||
|
||
resolve(mode.mode) | ||
}) | ||
}) | ||
} | ||
|
||
export async function handler() { | ||
const mode = await getMode() | ||
|
||
argon.plugin(mode) | ||
} |