-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: templated node creation #1882
feat: templated node creation #1882
Conversation
adds: configs, enums, fsms, secrets, cron, pubsub, and databases
title: 'Which type of node would you like to add', | ||
const nodeType = await vscode.window.showQuickPick(['verb', 'enum', 'pubsub', 'pubsub:subscription', 'fsm', 'database', 'config:string', 'config:struct', 'secret', 'cron'], { title: 'Which type of node would you like to add', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave title
on a new line here.
@@ -55,11 +54,11 @@ export const nodeNewCommand = async (item: FtlTreeItem) => { | |||
editor.revealRange(lastLineRange, vscode.TextEditorRevealType.Default) | |||
} | |||
|
|||
const snippetForNodeType = (nodeType: string): string => { | |||
const snippetForNodeType = async (nodeType: string): Promise<string> => { | |||
//TODO: fill out for all node types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this now that you're filling them out :)
const name = await vscode.window.showInputBox(inputBoxOptions); | ||
|
||
if (name) { | ||
return verbSnippetTemplate.replace(/<name>/g, name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make verbSnippetTemplate
a func that takes in name
as an argument
5cb264b
to
a52228b
Compare
No description provided.