Snippets not saved by the Snippet Manager in SQL Prompt 10 (latest version)
eisaacs
Posts: 6 New member
I created a snippet in the Snippet Manager, providing a snippet, description, and code and clicking SAVE. After doing so, the snippet didn't show in the available list of snippets. I did it multiple times repeating it and each time it seemed to save ok, but the snippet wasn't showing. I checked the snippet folder and the json file wasn't there. I then copied another JSON file, edited it, gave it a new GUID inside and out and created the snippet I was trying to save in the snippet manager via JSON instead, saved the file, and then I was able to use my snippet in SQL Prompt. Why would the Snippet Manager fail to create the JSON file when there are no conflicts in the snippet name and no errors in the UI when hitting save? Some of the snippets I created a few days ago were in the folder but it seemed like a few were missing besides the one I had to repeatedly try to create and it kept failing.
Tagged:
Answers
I'm sorry you are seeing this issue with snippets in SQL Prompt! Thanks for reaching out to us.
If you could please answer the following initial questions, that would be greatly appreciated:
- Has this behavior only started happening since you updated to the latest version of SQL Prompt (10.11.9)?
- Does this only happen when you are using specific code within the snippet?, or does it happen with any snippet you try to create?
- When you initially save a snippet does it show in the list? Does it disappear only after you close and re-open the SQL Prompt options box?
- Is your snippets folder saved locally, or on a shared location?
Dan Jary | Redgate Software
Have you visited our Help Center?
I was able to save a more simple example just now, so it seems that it only happens some of the time.
When I attempted the problem snippet, it kept looking like it worked in the Snippet Manager UI, but wouldn't show in the list. I checked the files in the folder and the Snippet JSON file was not created.
I eventually just manually created the JSON file and then it appeared in the list immediately and worked correctly.
The Snippet folder is the default local location. It isn't a permissions issue since I was able to save the file manually.
I'm wondering if it's something specific within my snippet that caused it.
I'm able to successfully edit the problem snippet though.
I deleted it and successfully recreated it too just now.
I created a bunch the first day I used it and it seems that a few are missing that I expected to have been there.
I'm at a loss currently as to what could have caused it. I just know it didn't get completed the first time I tried. When I attempted to use it the first time a few days later, I realized it wasn't in my list. I then tried multiple times to create the Snippet, each time the Snippet Manager seemed to work, but each time the JSON file wasn't written. So I confirmed the issue was with the Snippet Manager writing the JSON file, but I can't repeat it now. I could repeat it multiple times that day though.
The snippet folder is located in : C:\Users\(MyUserName)\AppData\Local\Red Gate\SQL Prompt 10\Snippets. The only snippets I have in the folder were the original snippets plus 6 I created 30 minutes after installing based on the Date Modified. It seems I'm missing all the snippets created after that point. This is bizarre.
Thank you for all your updates on this! My apology for the delay in coming back to you.
This behavior is very strange, I'm confused at to why the JSON files wouldn't be written immediately, or that they're being deleted automatically. Clearly this shouldn't be happening.
I have been trying to replicate what you are seeing here with multiple snippets, however so far the JSON files are written immediately after I save them in Snippet Manager, and non have been deleted.
I'm a little stumped as to why you are seeing this issue and so I am going to engage with our development team to get their input on this. In the mean time, if you haven't done so already, would it be possible for you to update to the latest version of SQL Prompt (v.10.11.11 - https://download.red-gate.com/checkforupdates/SQLPrompt/SQLPrompt_10.11.11.27632.exe) to see if you continue to see this issue?
Dan Jary | Redgate Software
Have you visited our Help Center?
Dan Jary | Redgate Software
Have you visited our Help Center?