ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
454 stars 88 forks source link

Set gutter colour with CSS #436

Closed verhovsky closed 4 months ago

verhovsky commented 6 months ago

This is actually possible as we can see from the VS Code source code:

https://github.com/microsoft/vscode/blob/12443ca030f93843ca5e9dfb5682ad92d2c6400c/src/vs/editor/browser/services/abstractCodeEditorService.ts#L801

https://github.com/microsoft/vscode/blob/12443ca030f93843ca5e9dfb5682ad92d2c6400c/src/vs/editor/browser/services/abstractCodeEditorService.ts#L591

This isn't explicitly documented (just the type says "string or Uri") but it is even tested:

https://github.com/microsoft/vscode/blob/12443ca030f93843ca5e9dfb5682ad92d2c6400c/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts#L113

See #432

ryanluker commented 5 months ago

@verhovsky Thanks for the PR, this will be sweet to have and is much better than the manual icon route. I do wonder, though, how we will go about releasing this without disrupting the backwards compatibility of the old solution?

I definitely think this should be the new way moving forward, but I wonder if we should leave in the old values (but maybe add deprecated to the description in the packag.json, with a mention of them going away in 3.0?

In the meantime, the extension could use an adaptor pattern to allow us to move forward with the better approach and still provide support for the old file method so we can release this in 2.x? (which will be much sooner than a hypothetical 3.0 heh).

verhovsky commented 5 months ago

This would only matter to people that have a different gutter color than the line highlight color and people that only set a gutter color and no line color. I can't imagine anyone going through the trouble of generating an image file just to change the color of a gutter in their code editor, surely not many people use this setting.

ryanluker commented 5 months ago

This would only matter to people that have a different gutter color than the line highlight color and people that only set a gutter color and no line color. I can't imagine anyone going through the trouble of generating an image file just to change the color of a gutter in their code editor, surely not many people use this setting.

Alright I agree with that logic, makes sense! We can also have an addition in extension marketplace readme mentioning a migration path.