SQL Prompt ADS is erasing the contents of %appdata%\azuredatastudio\User\snippets

When loading Azure Data Studio SQL Prompt comes up with the following message

Failed to import snippets from SSMS: Error: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. Path: $ | LineNumber: 0 | BytePositionInLine: 0.

The snippets file did have snippets in it before starting ADS.  When this error appear I review the snippts file and it is completely empty - o bytes.  The log for sql prompt is as follows.

2021-04-28 08:35:36.932 -04:00 [INF] ------------------------------------------------------------------------------------------------------------------------
2021-04-28 08:35:37.060 -04:00 [INF] Supplied locations:
  SSMS: C:\QSync\SSMS\SQLPromptSnippets
  ADS:  Default
2021-04-28 08:35:37.060 -04:00 [INF] Finding default ADS snippets location
2021-04-28 08:35:37.067 -04:00 [INF] Default ADS snippets location: C:\Users\Chris Styve\AppData\Roaming\azuredatastudio\User\Snippets\sql.json
2021-04-28 08:35:37.068 -04:00 [INF] Converting snippets
2021-04-28 08:35:37.229 -04:00 [INF] Loaded 181 SSMS snippets
2021-04-28 08:35:37.244 -04:00 [INF] Loaded 54 ADS snippets
2021-04-28 08:35:37.246 -04:00 [INF] Snippets merged to give 125 total ADS snippets
2021-04-28 08:35:37.250 -04:00 [ERR] Error converting snippets
System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](List`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
   at RedGate.SqlPrompt.SnippetConverter.Ads.AdsSnippetSerializer.Serialize(Stream stream, IEnumerable`1 snippets) in D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Ads\AdsSnippetSerializer.cs:line 13
   at RedGate.SqlPrompt.SnippetConverter.Ads.AdsSnippets.Save(String snippetsFile, IEnumerable`1 snippets) in D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Ads\AdsSnippets.cs:line 23
   at RedGate.SqlPrompt.SnippetConverter.SsmsToAdsSnippetConverter.Convert(String ssmsSnippetsFolder, String adsSnippetsFile) in D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\SsmsToAdsSnippetConverter.cs:line 32
   at RedGate.SqlPrompt.SnippetConverter.Program.Run(Logger logger, Options options) in D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Program.cs:line 67
   at RedGate.SqlPrompt.SnippetConverter.Program.<>c__DisplayClass2_0.<Main>b__0(Options options) in D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Program.cs:line 30
   at CommandLine.ParserResultExtensions.WithParsed[T](ParserResult`1 result, Action`1 action)
   at RedGate.SqlPrompt.SnippetConverter.Program.Main(String[] args) in D:\BuildAgentA\work\dc5fefc0dc183d00\SnippetConverter\Program.cs:line 28





Tagged:

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file