microsoft/vscode-mssql

Creating connection profile through command palette will format and remove all comments from user setttings in settings.json

heresmike opened this issue · 4 comments

  • MSSQL Extension Version: 1.1.0
  • VSCode Version: 1.14.1
  • OS Version: Windows 7 Enterprise SP1

Steps to Reproduce:

  1. In Visual Studio Code, type CTRL + , to open the settings.json file
  2. On the right pane within the curly braces on a new line (e.g., the user settings), type //This is a test
  3. Type CTRL + S to save the settings.json file
  4. Follow the steps "Connect to SQL Server" as described in tutorial to create a new valid connection
  5. In Visual Studio Code, type CTRL + , to open the settings.json file
  6. Observe that the comment line has been removed

@madlovin do you know if this just started occurring in 1.1? I think this is likely due to the fact we read in all the JSON and use a serializer to print it out again. That's where we're losing comments. We have some work tagged for the next release to start using the VSCode APIs for reading/writing settings again, which should help with this overall. We can take a look at this when doing that.

@kevcunnane I just installed the extension yesterday, so I have no prior experience to share.

Thanks for confirming. I believe this is a long-standing issue in that case. We'll look at it for our next update, hopefully we can fit it in.

llali commented

fixed in #991