decorations: prevent interference from other lens extensions #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
VSCode has a long-standing bug microsoft/vscode#33852: multiple decorators on the same line are resolved by whichever was inserted last. If you set the color in the decoration type and the contentText in the decoration options, another extension might insert its own style in between, overriding your color.
This PR implements the suggested workaround: set the
contentText
andcolor
at the same time so they'll always appear together. It does so setting everything in the decoration options, instead of only a sparsecontentText
.I tested this out with the GitLens extension, and it seems to work pretty well! Let me know if you need anything changed. It's unfortunate there's no VSCode fix yet, but this PR seems like a reasonable workaround that makes this extension feel less buggy.
Before
After
Related: #25