Skip to content
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

Conversation

jonathanj-square
Copy link
Contributor

No description provided.

@jonathanj-square jonathanj-square requested review from a team and deniseli and removed request for a team June 26, 2024 20:43
@ftl-robot ftl-robot mentioned this pull request Jun 26, 2024
@jonathanj-square jonathanj-square marked this pull request as draft June 26, 2024 20:44
Comment on lines 27 to 26
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',
Copy link
Collaborator

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.
Copy link
Collaborator

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)
Copy link
Collaborator

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

@wesbillman wesbillman force-pushed the hackathon-extension-tree branch from 5cb264b to a52228b Compare June 27, 2024 17:39
@jonathanj-square jonathanj-square deleted the jonathanj/het/templatized-node-insert branch October 28, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants