statelyai / xstate-tools

Public monorepo for XState tooling
183 stars 36 forks source link

stately-xstate.edit not found #175

Open davidkpiano opened 2 years ago

davidkpiano commented 2 years ago

Discussed in https://github.com/statelyai/xstate/discussions/3441

Originally posted by **butlerpaul** July 3, 2022 After fresh install I get "Command 'XState: Open Visual Editor' resulted in an error. (command stately-xstate.edit not found)" Is there some dependency I need to install?
Andarist commented 1 year ago

This can happen when you try to use our commands in files with unsupported file extensions. VS Code tries to optimize which extensions it loads and activates at startup.

So if you try to use our commands through the command palette in, for example, a .json file then you might see this error because our extension has never been activated yet. But even if it did, we wouldn't be able to do anything with this command in a .json file.

We need to add when clauses in our manifest, here: https://github.com/statelyai/xstate-tools/blob/317b8f5baa7e4fa2ca4779ad6729251b1577daf1/apps/extension/client/package.json#L46-L57