vscode-logfile-highlighter
vscode-logfile-highlighter copied to clipboard
Highlighting when not matching a regular expression
Is it possible to highlight the whole line when the line doesn't match a regular expression?
Not sure I understand what you want to indicate. I have no setting for this but VS Code highlights the entire line by default. Do you want to disable this?
Sorry, what I meant was to highlight all lines that do not match a regular expression. Thank you.
Well, a custom pattern like this should work:
"logFileHighlighter.customPatterns": [
// Color line that does not contain "foo" using negative lookahead
{
"pattern": "^.*(?!bar).*$",
"foreground": "#ff0000"
},
],
But unfortunately, it doesn't. It seems we get an infinite recursion or something like that, because the vs code extension hosts crashes. I'll treat this as a bug.
I will close this issue now as I don't see a way to solve it. Also, it is a bit an edge case.