diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 22efae7b65e089886b30790f4dc9d229f8c91ccb..58c1ca9269a85805fe2bb7a0d1355669e2ec97b4 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -30,7 +30,7 @@ import { IPosition } from 'vs/editor/common/core/position'; import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; import { CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder } from 'vs/editor/common/view/editorColorRegistry'; +import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder, editorInfoBorder, editorInfoForeground } from 'vs/editor/common/view/editorColorRegistry'; import { Color } from 'vs/base/common/color'; import { IMouseEvent } from 'vs/base/browser/mouseEvent'; @@ -518,19 +518,28 @@ function getSquigglySVGData(color: Color) { registerThemingParticipant((theme, collector) => { let errorBorderColor = theme.getColor(editorErrorBorder); if (errorBorderColor) { - collector.addRule(`.monaco-editor .redsquiggly { border-bottom: 4px double ${errorBorderColor}; }`); + collector.addRule(`.monaco-editor .errorsquiggly { border-bottom: 4px double ${errorBorderColor}; }`); } let errorForeground = theme.getColor(editorErrorForeground); if (errorForeground) { - collector.addRule(`.monaco-editor .redsquiggly { background: url("data:image/svg+xml,${getSquigglySVGData(errorForeground)}") repeat-x bottom left; }`); + collector.addRule(`.monaco-editor .errorsquiggly { background: url("data:image/svg+xml,${getSquigglySVGData(errorForeground)}") repeat-x bottom left; }`); } let warningBorderColor = theme.getColor(editorWarningBorder); if (warningBorderColor) { - collector.addRule(`.monaco-editor .greensquiggly { border-bottom: 4px double ${warningBorderColor}; }`); + collector.addRule(`.monaco-editor .warningsquiggly { border-bottom: 4px double ${warningBorderColor}; }`); } let warningForeground = theme.getColor(editorWarningForeground); if (warningForeground) { - collector.addRule(`.monaco-editor .greensquiggly { background: url("data:image/svg+xml;utf8,${getSquigglySVGData(warningForeground)}") repeat-x bottom left; }`); + collector.addRule(`.monaco-editor .warningsquiggly { background: url("data:image/svg+xml;utf8,${getSquigglySVGData(warningForeground)}") repeat-x bottom left; }`); + } + + let infoBorderColor = theme.getColor(editorInfoBorder); + if (warningBorderColor) { + collector.addRule(`.monaco-editor .infosquiggly { border-bottom: 4px double ${infoBorderColor}; }`); + } + let infoForeground = theme.getColor(editorInfoForeground); + if (warningForeground) { + collector.addRule(`.monaco-editor .infosquiggly { background: url("data:image/svg+xml;utf8,${getSquigglySVGData(infoForeground)}") repeat-x bottom left; }`); } }); \ No newline at end of file diff --git a/src/vs/editor/common/model/textModelWithDecorations.ts b/src/vs/editor/common/model/textModelWithDecorations.ts index c66247c0b6a275688b121485c68d265d15bb0c29..d86288a6b2cf94ada44221a100b7f2d754396eea 100644 --- a/src/vs/editor/common/model/textModelWithDecorations.ts +++ b/src/vs/editor/common/model/textModelWithDecorations.ts @@ -19,8 +19,9 @@ import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; import { ThemeColor } from 'vs/platform/theme/common/themeService'; export const ClassName = { - EditorWarningDecoration: 'greensquiggly', - EditorErrorDecoration: 'redsquiggly' + EditorInfoDecoration: 'infosquiggly', + EditorWarningDecoration: 'warningsquiggly', + EditorErrorDecoration: 'errorsquiggly' }; class DecorationsTracker { diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index 3436b8653c48afc448fbb3ab97d85865b5de2432..7eb325a67618aa7a99feb1dede4f3f7a5a6415d5 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -30,7 +30,7 @@ import { ClassName } from 'vs/editor/common/model/textModelWithDecorations'; import { ISequence, LcsDiff } from 'vs/base/common/diff/diff'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { themeColorFromId, ThemeColor } from 'vs/platform/theme/common/themeService'; -import { overviewRulerWarning, overviewRulerError } from 'vs/editor/common/view/editorColorRegistry'; +import { overviewRulerWarning, overviewRulerError, overviewRulerInfo } from 'vs/editor/common/view/editorColorRegistry'; function MODEL_ID(resource: URI): string { return resource.toString(); @@ -125,11 +125,15 @@ class ModelMarkerHandler { // do something break; case Severity.Warning: - case Severity.Info: className = ClassName.EditorWarningDecoration; color = themeColorFromId(overviewRulerWarning); darkColor = themeColorFromId(overviewRulerWarning); break; + case Severity.Info: + className = ClassName.EditorInfoDecoration; + color = themeColorFromId(overviewRulerInfo); + darkColor = themeColorFromId(overviewRulerInfo); + break; case Severity.Error: default: className = ClassName.EditorErrorDecoration; diff --git a/src/vs/editor/common/view/editorColorRegistry.ts b/src/vs/editor/common/view/editorColorRegistry.ts index 794b815d4fd7ecce51f9148f7264d30a62acd17e..3fae633c29bfe3dff64dbf42b9e68b24257e4b82 100644 --- a/src/vs/editor/common/view/editorColorRegistry.ts +++ b/src/vs/editor/common/view/editorColorRegistry.ts @@ -36,6 +36,9 @@ export const editorErrorBorder = registerColor('editorError.border', { dark: nul export const editorWarningForeground = registerColor('editorWarning.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('warningForeground', 'Foreground color of warning squigglies in the editor.')); export const editorWarningBorder = registerColor('editorWarning.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('warningBorder', 'Border color of warning squigglies in the editor.')); +export const editorInfoForeground = registerColor('editorInfo.foreground', { dark: '#008000', light: '#008000', hc: null }, nls.localize('infoForeground', 'Foreground color of info squigglies in the editor.')); +export const editorInfoBorder = registerColor('editorInfo.border', { dark: null, light: null, hc: Color.fromHex('#71B771').transparent(0.8) }, nls.localize('infoBorder', 'Border color of info squigglies in the editor.')); + const rulerRangeDefault = new Color(new RGBA(0, 122, 204, 0.6)); export const overviewRulerRangeHighlight = registerColor('editorOverviewRuler.rangeHighlightForeground', { dark: rulerRangeDefault, light: rulerRangeDefault, hc: rulerRangeDefault }, nls.localize('overviewRulerRangeHighlight', 'Overview ruler marker color for range highlights.')); export const overviewRulerError = registerColor('editorOverviewRuler.errorForeground', { dark: new Color(new RGBA(255, 18, 18, 0.7)), light: new Color(new RGBA(255, 18, 18, 0.7)), hc: new Color(new RGBA(255, 50, 50, 1)) }, nls.localize('overviewRuleError', 'Overview ruler marker color for errors.')); diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index 7c05ecdbc3f9fdbe703d96b0b8858734e5fd253f..70077a344ca29a8fdf4e7ce511e33b0625101293 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -28,7 +28,7 @@ import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { AccessibilitySupport } from 'vs/base/common/platform'; -import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder } from 'vs/editor/common/view/editorColorRegistry'; +import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder, editorInfoForeground, editorInfoBorder } from 'vs/editor/common/view/editorColorRegistry'; import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; @@ -283,7 +283,13 @@ class MarkerNavigationWidget extends ZoneWidget { private _applyTheme(theme: ITheme) { this._backgroundColor = theme.getColor(editorMarkerNavigationBackground); - let frameColor = theme.getColor(this._severity === Severity.Error ? editorMarkerNavigationError : editorMarkerNavigationWarning); + let colorId = editorMarkerNavigationError; + if (this._severity === Severity.Warning) { + colorId = editorMarkerNavigationWarning; + } else if (this._severity === Severity.Info) { + colorId = editorMarkerNavigationInfo; + } + let frameColor = theme.getColor(colorId); this.style({ arrowColor: frameColor, frameColor: frameColor @@ -541,7 +547,9 @@ CommonEditorRegistry.registerEditorCommand(new MarkerCommand({ let errorDefault = oneOf(editorErrorForeground, editorErrorBorder); let warningDefault = oneOf(editorWarningForeground, editorWarningBorder); +let infoDefault = oneOf(editorInfoForeground, editorInfoBorder); export const editorMarkerNavigationError = registerColor('editorMarkerNavigationError.background', { dark: errorDefault, light: errorDefault, hc: errorDefault }, nls.localize('editorMarkerNavigationError', 'Editor marker navigation widget error color.')); export const editorMarkerNavigationWarning = registerColor('editorMarkerNavigationWarning.background', { dark: warningDefault, light: warningDefault, hc: warningDefault }, nls.localize('editorMarkerNavigationWarning', 'Editor marker navigation widget warning color.')); +export const editorMarkerNavigationInfo = registerColor('editorMarkerNavigationInfo.background', { dark: infoDefault, light: infoDefault, hc: infoDefault }, nls.localize('editorMarkerNavigationInfo', 'Editor marker navigation widget info color.')); export const editorMarkerNavigationBackground = registerColor('editorMarkerNavigation.background', { dark: '#2D2D30', light: Color.white, hc: '#0C141F' }, nls.localize('editorMarkerNavigationBackground', 'Editor marker navigation widget background.')); diff --git a/src/vs/editor/standalone/browser/standalone-tokens.css b/src/vs/editor/standalone/browser/standalone-tokens.css index 09fa35644b2bb19d7d375a21f69a5fe0e036403c..0bea05f216410802d13523e63dd6a24d43f505a7 100644 --- a/src/vs/editor/standalone/browser/standalone-tokens.css +++ b/src/vs/editor/standalone/browser/standalone-tokens.css @@ -192,13 +192,17 @@ } /* squiggles */ - .monaco-editor.vs .redsquiggly, - .monaco-editor.vs-dark .redsquiggly { + .monaco-editor.vs .errorsquiggly, + .monaco-editor.vs-dark .errorsquiggly { background: transparent !important; border-bottom: 4px double #E47777; } - .monaco-editor.vs .greensquiggly, - .monaco-editor.vs-dark .greensquiggly { + .monaco-editor.vs .warningsquiggly, + .monaco-editor.vs-dark .warningsquiggly { + border-bottom: 4px double #71B771; + } + .monaco-editor.vs .infosquiggly, + .monaco-editor.vs-dark .infosquiggly { border-bottom: 4px double #71B771; } diff --git a/test/smoke/src/areas/problems/problems.ts b/test/smoke/src/areas/problems/problems.ts index 43548fc490a249009685aad10e4e7343f0ab58c4..2e6f7bc1e5a2ba31bc948840b64cb843e168cd67 100644 --- a/test/smoke/src/areas/problems/problems.ts +++ b/test/smoke/src/areas/problems/problems.ts @@ -47,7 +47,7 @@ export class Problems { } public static getSelectorInEditor(problemType: ProblemSeverity): string { - let selector = problemType === ProblemSeverity.WARNING ? 'greensquiggly' : 'redsquiggly'; + let selector = problemType === ProblemSeverity.WARNING ? 'warningsquiggly' : 'errorsquiggly'; return `.view-overlays .cdr.${selector}`; } } \ No newline at end of file