question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Settings writer looses comments

See original GitHub issue

Have a setting defined that is an array of literal (an example is the tasks.json with the tasks property). Try to update the array using the settings API with comments used for elements inside the array or on elements in the array.

Observe: comments are lost

tasks.json

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			// a comment
			"type": "gulp",
			"task": "build",
			"problemMatcher": [
				"$tsc"
			]
		}
	]
}

configure a second task using the configuration UI (the gear icon in the task quick open). You get:

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"type": "gulp",
			"task": "build",
			"problemMatcher": [
				"$tsc"
			]
		},
		{
			"type": "gulp",
			"task": "watch",
			"problemMatcher": []
		}
	]
}

I couldn’t find a way to preserve the comment.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
weinandcommented, Nov 10, 2020

@sandy081 Loosing comments is a “user data loss” that we must avoid. We need to fix this.

1reaction
Tarang74commented, Dec 21, 2021

Any progress on this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Review comments disappeared
Try the following: Go to the very end of your file (Ctrl+End), press Enter to add a new paragraph, copy everything except for...
Read more >
Is there a way to prevent the loss of comments in my web. ...
I'm using the settings editor in Visual Studio 2010 to add/edit/remove my settings from the section of my .NET 4 web.config file. Here's...
Read more >
Change your Notes settings on iPad
From the Home Screen or App Library, go to Settings > Notes, then adjust any of the settings. For example: Default Account: Choose...
Read more >
Comments and threads - GitLab Documentation
Select Comment or select the down arrow ( ) to select Start thread. Threads created this way are lost if the commit ID...
Read more >
Groups Tips and Tricks (FAQ)
On loseit.com, click Community > select the group from the lefthand sidebar > enter your post in the text box below “Write a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found