statelyai / xstate-tools

Public monorepo for XState tooling
183 stars 39 forks source link

Ability to create a new machine #304

Open gkiely opened 1 year ago

gkiely commented 1 year ago

It would be great if it were possible to create a new state chart using the VSCode extension, just like in the stately editor.

Current: Xstate > Open Visual Editor in a blank file shows an error "Could not find a machine at the current cursor error".

Expected: Ability to create a new machine in the visual editor.

Ideally via a separate command, and/or the visual editor shows a button to create a new state machine.

Andarist commented 1 year ago

Yeah, that makes sense and I was actually thinking about something similar recently. I was thinking about a command though and it seems that perhaps you'd like to have a button in the visual editor.

gkiely commented 1 year ago

Command works fine for me.

davidkpiano commented 1 year ago

You can also use the xsm snippet to easily create new machines in the code, although I agree, having a dedicated command would be a good experience.