fix: avoid duplicate decorations (fixes #1231)
Created by: lguychard
This fixes #1231 (closed), but the overall behaviour of decorations still leaves to be desired, notably when several extensions try to decorate the same line (eg git blame + codecov). For this to work well, we need something akin to vscode's DecorationType
Will write follow-up issues to decouple decoration merge/update logic from the DOM, and harmonize it between the website and the browser extension (currently the behaviour is different, but broken in both), and make sure adding decorations from several extensions, and toggling them, is handled gracefully.
The code changed here is currently hard to test due to high coupling in handleCodeHost (eg. it's not trivial to "setDecorations" from one or several mocked extension in unit tests). Will also work on making this more modular/testable.