[vscode-spring-cli] command add support
This commit is contained in:
35
vscode-extensions/vscode-spring-cli/src/command.ts
Normal file
35
vscode-extensions/vscode-spring-cli/src/command.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { Uri, window } from "vscode";
|
||||
import { enterText } from "./utils";
|
||||
import { CLI } from "./extension";
|
||||
|
||||
export async function handleCommandAdd() {
|
||||
let url;
|
||||
try {
|
||||
url = await enterText({
|
||||
title: "URL",
|
||||
prompt: "Enter Repository URL",
|
||||
placeholder: "https://github.com/my-org/my-command",
|
||||
validate: async v => {
|
||||
try {
|
||||
Uri.parse(v, true);
|
||||
} catch (error) {
|
||||
return "Invalid URL value";
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
// Cancelled - ignore the error
|
||||
}
|
||||
|
||||
if (url) {
|
||||
CLI.commandAdd({url});
|
||||
}
|
||||
}
|
||||
|
||||
export async function handleCommandRemove() {
|
||||
window.showErrorMessage("Not Implemented!");
|
||||
}
|
||||
|
||||
export async function handleCommandNew() {
|
||||
window.showErrorMessage("Not Implemented!");
|
||||
}
|
||||
Reference in New Issue
Block a user