statelyai / xstate-tools

Public monorepo for XState tooling
183 stars 39 forks source link

Bug: VSCode extension can't open visual editor #318

Open pixtron opened 1 year ago

pixtron commented 1 year ago

Description

When the machine is in a folder that starts with + the VSCode Extension can't open the Visual Editor. It fails with the message "Could not find a machine at the current cursor". When the + in the folder name is removed, the visual editor can be opened.

Steps to reproduce

  1. touch src/+xstate/machine.ts
  2. Create a simple machine with createMachine()
  3. Place the cursor into your machine
  4. Run XState: Open Visual Editor from the command palette

Expected result

Visual editor opens

Actual result

Visual Editor does not open. If the + in the folder name is removed, the machine opens.

Reproduction

none

Additional context

No response

davidkpiano commented 1 year ago

Very strange. What is the technical reason for prepending the name with + (just curious)?

pixtron commented 1 year ago

There is no technical reason. It's more for ordering purposes so +xstate is on top of the folder and not at the bottom. So tried a bit further:

Does not work: *, %, :

Does work: -, _, .