-
Notifications
You must be signed in to change notification settings - Fork 291
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
674 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module '*.svg' { | ||
const content: string; | ||
export default content; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...s/GutterFormatter/covered-gutter-icon.svg → ...e/Formatters/GutterFormatter/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
src/Coverage/Formatters/GutterFormatter/partially-covered-gutter-icon.svg
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/Coverage/Formatters/GutterFormatter/uncovered-gutter-icon.svg
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { | ||
window, | ||
OverviewRulerLane, | ||
DecorationRangeBehavior, | ||
ExtensionContext, | ||
TextEditorDecorationType, | ||
DecorationRenderOptions, | ||
} from 'vscode'; | ||
import passingIcon from 'vscode-codicons/src/icons/check.svg'; | ||
import failingIcon from 'vscode-codicons/src/icons/chrome-close.svg'; | ||
import skipIcon from 'vscode-codicons/src/icons/debug-step-over.svg'; | ||
import unknownIcon from './question.svg'; | ||
import prepareIconFile from './prepareIconFile'; | ||
|
||
export class TestStatus { | ||
public passing: TextEditorDecorationType; | ||
public failing: TextEditorDecorationType; | ||
public skip: TextEditorDecorationType; | ||
public unknown: TextEditorDecorationType; | ||
|
||
constructor(context: ExtensionContext) { | ||
this.passing = this.createStateDecoration([ | ||
prepareIconFile(context, 'passing', passingIcon, '#35A15E'), | ||
'green', | ||
]); | ||
this.failing = this.createStateDecoration([ | ||
prepareIconFile(context, 'failing', failingIcon, '#D6443C'), | ||
'red', | ||
]); | ||
this.skip = this.createStateDecoration([ | ||
prepareIconFile(context, 'skip', skipIcon, '#fed37f'), | ||
'yellow', | ||
]); | ||
this.unknown = this.createStateDecoration( | ||
[prepareIconFile(context, 'unknown', unknownIcon, '#BBBBBB'), 'darkgrey'], | ||
[prepareIconFile(context, 'unknown-light', unknownIcon, '#555555')] | ||
); | ||
} | ||
|
||
private createStateDecoration( | ||
dark: /* default */ [string, string?], | ||
light?: /* optional overrides */ [string, string?] | ||
): TextEditorDecorationType { | ||
const [icon, overviewRulerColor] = dark; | ||
const [iconLite, overviewRulerColorLite] = light ?? []; | ||
|
||
const options: DecorationRenderOptions = { | ||
gutterIconPath: icon, | ||
gutterIconSize: 'contain', | ||
overviewRulerLane: OverviewRulerLane.Left, | ||
rangeBehavior: DecorationRangeBehavior.ClosedClosed, | ||
dark: { | ||
gutterIconPath: icon, | ||
}, | ||
light: { | ||
gutterIconPath: iconLite || icon, | ||
}, | ||
}; | ||
|
||
if (overviewRulerColor) { | ||
options['overviewRulerColor'] = overviewRulerColor; | ||
options['dark']['overviewRulerColor'] = overviewRulerColor; | ||
} | ||
|
||
if (overviewRulerColorLite) { | ||
options['light']['overviewRulerColor'] = overviewRulerColorLite; | ||
} | ||
|
||
return window.createTextEditorDecorationType(options); | ||
} | ||
} |
Oops, something went wrong.