zjffun / vscode-snippets-manager

Create and edit snippets easily.
https://marketplace.visualstudio.com/items?itemName=zjffun.snippetsmanager
MIT License
38 stars 7 forks source link

The dollar sign will not be inserted #22

Closed Matthias1372 closed 6 months ago

Matthias1372 commented 11 months ago

I'm using the snippets manager with powershell. Some little example code:

`# Define some variable $variable = 'Something'

if ($variable -eq 'something') { Write-Host $variable }`

I have selected the code and added it to the snippets using the context menu "Create Snippet" and "Create Snippet (Without Excape)". At this point everything seems ok, the $ sign will be shown, see screenshot. SnippetsManager1

When I'm adding the code snippet, the $ sign is missing, see also screenshots. SnippetsManager2

SnippetsManager3

It would be great, if this issue could be fixed. I'm looking forward to it! Otherwise, the Snippet Manager is a great tool, thank you for your work!

zjffun commented 11 months ago

It seems you can use "Create Snippet". The "Create Snippet" can auto escape the $ and create a snippet that output is just like what you selected.

https://github.com/zjffun/vscode-snippets-manager/assets/25266120/12b0a5ad-f533-4a5a-b9bf-1f4253cacd15

With "Create Snippet (Without Escape)" we can do some amazing things, like:

https://github.com/zjffun/vscode-snippets-manager/assets/25266120/1a3c2ccb-5cb5-49c1-99f2-77dd86e6cb97

Different:

Screen Shot 2023-12-04 at 22 12 37

See Snippet Syntax in Visual Studio Code and #17

zjffun commented 6 months ago

Closing this issue due to inactivity. Please feel free to reopen this issue if you are still running into issues and we would be happy to help troubleshoot further.