jgclark/vscode-todo-highlight

Issues with regex in todohighlight.keywords

Closed this issue · 1 comments

Following the example configuration on the project homepage, I created the following custom config:

"todohighlight.keywords": [
			{	
				"regex": {
					"pattern": "(<h2>.*?<\/h2>)"
				},
				"color": "white",
				"backgroundColor": "#8A4400",
				"isWholeLine": false
			},
			{
				"regex": {
					"pattern": "\\(screenshot: ([^)]+)\\)"
				},
				"color": "White",
				"backgroundColor": "Red",
				"isWholeLine": false
			}
		]

both regex are ignored. The expressions are not wrong, they simply are not picked up.

However, if I use this variant, everything works as expected:

"todohighlight.keywords": [
			{	
				"text": "test1",
				"color": "white",
				"backgroundColor": "#8A4400",
				"isWholeLine": false
			},
			{
				"text": "test2",
				"color": "White",
				"backgroundColor": "Red",
				"isWholeLine": false
			}
		]

I'd really prefer to specify a series of regex rather than an endless list of strings, so any help would be greatly appreciated.

Thank you

I just had to install TODO Highlight v2 and it fixed it. Sorry.