Options

Unable to save changes in snippet manager

Bobby_TablesBobby_Tables Posts: 12 Bronze 2
edited July 30, 2023 6:55AM in SQL Prompt
I have many snippets I've created the past few years and I was trying to clean up. If I delete any snippet I am unable to save changes (clicking Ok). I get the below modal. I have version: 10.13.12.1701



Stack trace from the logs.

2023-07-29 23:43:19.467 -07:00 [Error] Failed to save settings due to snippet error.
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at RedGate.SqlPrompt.CommonUI.Options.Pages.Snippets.ViewModels.SnippetsPageViewModel.SaveChangesToModel()
   at RedGate.SqlPrompt.CommonUI.Options.Pages.Suggestions.SnippetsPage.Save()
   at RedGate.SqlPrompt.CommonUI.Options.OptionsForm.OnOkButtonClicked(Object sender, EventArgs e)
Tagged:

Answers

  • Options
    Bobby_TablesBobby_Tables Posts: 12 Bronze 2
    I resoved the issue myself but had to review the json files in the snippets folder and it looked like some had duplicate names even though the guid was different. After removing the suspected files it started working again.
Sign In or Register to comment.