How to add line class to a specific line dynamically

Hi, I previously used v5 addLineClass and removeLineClass to some specific line to mark/remove error line.
I just switched to v6. I’ve read the zebra stripes example. But I don’t understand how to add the extra class to a specific line dynamically.

You set up an extension, similar to the zebra stripe example, that maintains line decorations for the lines that you want to style, and updates them as appropriate on transactions.

Thanks, I’ve tried and it works. But how can I also add the same decoration for the line number part of the same line?

Screenshot 2023-04-11 at 09.59.29

That can be done separately with gutterLineClass.