-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline decorations can conflict with one another #33852
Comments
@eamodio we applied CSS for decorations to the elements so if there are two decorators on the same character, we don't decide which one should be shown, which one should not. But for this particular case, there is a workaround to make it look better Both the first rule and third rule are from GitLens while Import Cost put them in the same rule. I suppose GitLens tries to add a new decoration for current selected line, that's why it has the top priority. A workaround is merging them
|
I debugged this a bit from the GitLens side and I see that I am setting a few decorations (1 for the trailing content, 1 for the commit details hover, 1 for the commit changes hover). It seems like the trailing content decoration is the issue here. This is what I am setting: {
range,
renderOptions: {
after: {
contentText: "context goes here"
},
dark: {
after: {
backgroundColor: undefined,
color: "rgba(153, 153, 153, 0.35)"
}
}.
light: {
after: {
backgroundColor: undefined,
color: "rgba(153, 153, 153, 0.35)"
}
}
}
} So I think the splitting of the css is because of the use of theme blocks. |
@rebornix I'm not sure what the resolution is or where this needs to go. Can I assign back to you? |
Mark it under-discussion first. Decorations provided by extensions don't have priorities and we merge them and let browser do the merging/overriding/etc. |
VSCode has a long-standing bug microsoft/vscode#33852: multiple decorators on the same line are resolved by whichever was inserted *last*. So you set the **color** in the decoration **type** and the **contentText** in the decoration **options**, another extension might insert its own style in between. This PR implements the suggested workaround: set the `contentText` and `color` at the same time so they'll always appear together. It does so setting everything in the decoration **options**, instead of only a sparse `contentText`. Related: usernamehw#25
Long standing vscode bug "Inline decorations can interfere with one another" microsoft/vscode#33852
* update: typescript to latest * add: ts bundling with ts-loader * add: KiteCodeLensProvider skeleton * change: wip codelens -> prototype inline decoration * update: rm vscode devDep in favor of @types/vscode and vscode-test See https://code.visualstudio.com/updates/v1_36#_splitting-vscode-package-into-typesvscode-and-vscodetest * improve: consolidate after block to avoid conflicting styles Long standing vscode bug "Inline decorations can interfere with one another" microsoft/vscode#33852 * remove: post-install since now using @types/vscode * update: webpack and webpack-cli to latest * migrate: to using vscode-test via webpack transpiling * improve: fix various tests and improve dev test experience * improve: use link theme color for inline message * improve: bump kite-api and use getLineDecoration * add: source-map and typescript test support * migrate: expect.js -> chai for assertion style testing * remove: unused deps + update sinon * test: codenav-decoration
I have both GitLens and Import Cost extensions installed and the decorators added to the end of the line by both seem to conflict as can be seen below.
I would have either expected the GitLens decoration to no appear at all (less than ideal imo) or that the GitLens decoration (since it was being added last) would win (and once it was removed it would revert to the previous one). But currently it looks like some properties between the 2 decorators get merged which looks far less than ideal 😄
Originally reported here: gitkraken/vscode-gitlens#131
Reproduces without extensions: No
The text was updated successfully, but these errors were encountered: