Gruntfuggly / auto-snippet

A vscode extension to automatically insert a predefined snippet when a file is created, or an empty file is opened.
Other
14 stars 1 forks source link

Insert failed #10

Closed Andy-AO closed 3 years ago

Andy-AO commented 3 years ago

Can see the inserted information on the OutPut, but it didn't succeed.

The Snippet I want to insert is called re.

image

image

Gruntfuggly commented 3 years ago

Please can you post your snippets file and your settings so I can try to recreate it?

Andy-AO commented 3 years ago

Please can you post your snippets file and your settings so I can try to recreate it?

I'm sorry, but there was a mistake in my configuration.

I confused 'snippet name' with 'prefix',so re doesn't really exist.

It took me a long time to realize this.

sorry.

If there is a reminder in the output information when it cannot be found, it will be better.

Gruntfuggly commented 3 years ago

Unfortunately there is no real API for inserting the snippets - it just has to try. There is a timer which tries to check if something happened, but it probably doesn't work in all cases.

Gruntfuggly commented 3 years ago

I've just pushed an update which also tests to see if the file is empty after the insertion.

chrisbward commented 3 years ago

Also had the same issue until I switched prefix for name. This wasn't immediately obvious.