diff --git a/src/vs/base/browser/ui/hover/hover.css b/src/vs/base/browser/ui/hover/hover.css index c24fe23a8ca5d..a6e7e29854839 100644 --- a/src/vs/base/browser/ui/hover/hover.css +++ b/src/vs/base/browser/ui/hover/hover.css @@ -137,6 +137,11 @@ /** Hack to force underline to show **/ border-bottom: 1px solid transparent; text-underline-position: under; + color: var(--vscode-textLink-foreground); +} + +.monaco-hover .hover-contents a.code-link > span:hover { + color: var(--vscode-textLink-activeForeground); } /** Spans in markdown hovers need a margin-bottom to avoid looking cramped: https://github.com/microsoft/vscode/issues/101496 **/ diff --git a/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts b/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts index 492604659fb6d..7b156b6fc8fd3 100644 --- a/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts +++ b/src/vs/editor/contrib/hover/browser/markerHoverParticipant.ts @@ -25,8 +25,6 @@ import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; import { IMarker, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { Progress } from 'vs/platform/progress/common/progress'; -import { textLinkActiveForeground, textLinkForeground } from 'vs/platform/theme/common/colorRegistry'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures'; const $ = dom.$; @@ -253,14 +251,3 @@ export class MarkerHoverParticipant implements IEditorHoverParticipant { - const linkFg = theme.getColor(textLinkForeground); - if (linkFg) { - collector.addRule(`.monaco-hover .hover-contents a.code-link span { color: ${linkFg}; }`); - } - const activeLinkFg = theme.getColor(textLinkActiveForeground); - if (activeLinkFg) { - collector.addRule(`.monaco-hover .hover-contents a.code-link span:hover { color: ${activeLinkFg}; }`); - } -}); diff --git a/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.css b/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.css new file mode 100644 index 0000000000000..bdced2def7164 --- /dev/null +++ b/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.css @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +.codicon.codicon-symbol-array { color: var(--vscode-symbolIcon-arrayForeground); } +.codicon.codicon-symbol-boolean { color: var(--vscode-symbolIcon-booleanForeground); } +.codicon.codicon-symbol-class { color: var(--vscode-symbolIcon-classForeground); } +.codicon.codicon-symbol-method { color: var(--vscode-symbolIcon-methodForeground); } +.codicon.codicon-symbol-color { color: var(--vscode-symbolIcon-colorForeground); } +.codicon.codicon-symbol-constant { color: var(--vscode-symbolIcon-constantForeground); } +.codicon.codicon-symbol-constructor { color: var(--vscode-symbolIcon-constructorForeground); } +.codicon.codicon-symbol-value, +.codicon.codicon-symbol-enum { color: var(--vscode-symbolIcon-enumeratorForeground); } +.codicon.codicon-symbol-enum-member { color: var(--vscode-symbolIcon-enumeratorMemberForeground); } +.codicon.codicon-symbol-event { color: var(--vscode-symbolIcon-eventForeground); } +.codicon.codicon-symbol-field { color: var(--vscode-symbolIcon-fieldForeground); } +.codicon.codicon-symbol-file { color: var(--vscode-symbolIcon-fileForeground); } +.codicon.codicon-symbol-folder { color: var(--vscode-symbolIcon-folderForeground); } +.codicon.codicon-symbol-function { color: var(--vscode-symbolIcon-functionForeground); } +.codicon.codicon-symbol-interface { color: var(--vscode-symbolIcon-interfaceForeground); } +.codicon.codicon-symbol-key { color: var(--vscode-symbolIcon-keyForeground); } +.codicon.codicon-symbol-keyword { color: var(--vscode-symbolIcon-keywordForeground); } +.codicon.codicon-symbol-module { color: var(--vscode-symbolIcon-moduleForeground); } +.codicon.codicon-symbol-namespace { color: var(--vscode-symbolIcon-namespaceForeground); } +.codicon.codicon-symbol-null { color: var(--vscode-symbolIcon-nullForeground); } +.codicon.codicon-symbol-number { color: var(--vscode-symbolIcon-numberForeground); } +.codicon.codicon-symbol-object { color: var(--vscode-symbolIcon-objectForeground); } +.codicon.codicon-symbol-operator { color: var(--vscode-symbolIcon-operatorForeground); } +.codicon.codicon-symbol-package { color: var(--vscode-symbolIcon-packageForeground); } +.codicon.codicon-symbol-property { color: var(--vscode-symbolIcon-propertyForeground); } +.codicon.codicon-symbol-reference { color: var(--vscode-symbolIcon-referenceForeground); } +.codicon.codicon-symbol-snippet { color: var(--vscode-symbolIcon-snippetForeground); } +.codicon.codicon-symbol-string { color: var(--vscode-symbolIcon-stringForeground); } +.codicon.codicon-symbol-struct { color: var(--vscode-symbolIcon-structForeground); } +.codicon.codicon-symbol-text { color: var(--vscode-symbolIcon-textForeground); } +.codicon.codicon-symbol-type-parameter { color: var(--vscode-typeParameterForeground); } +.codicon.codicon-symbol-unit { color: var(--vscode-symbolIcon-unitForeground); } +.codicon.codicon-symbol-variable { color: var(--vscode-symbolIcon-variableForeground); } diff --git a/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts b/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts index 083a8ccdb5eac..64ccb1bc61897 100644 --- a/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts +++ b/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.ts @@ -3,10 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Codicon } from 'vs/base/common/codicons'; +import 'vs/css!./symbolIcons'; import { localize } from 'vs/nls'; import { foreground, registerColor } from 'vs/platform/theme/common/colorRegistry'; -import { IColorTheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; export const SYMBOL_ICON_ARRAY_FOREGROUND = registerColor('symbolIcon.arrayForeground', { dark: foreground, @@ -238,172 +237,3 @@ export const SYMBOL_ICON_VARIABLE_FOREGROUND = registerColor('symbolIcon.variabl hcDark: '#75BEFF', hcLight: '#007ACC', }, localize('symbolIcon.variableForeground', 'The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget.')); - -registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => { - - const symbolIconArrayColor = theme.getColor(SYMBOL_ICON_ARRAY_FOREGROUND); - if (symbolIconArrayColor) { - collector.addRule(`${Codicon.symbolArray.cssSelector} { color: ${symbolIconArrayColor}; }`); - } - - const symbolIconBooleanColor = theme.getColor(SYMBOL_ICON_BOOLEAN_FOREGROUND); - if (symbolIconBooleanColor) { - collector.addRule(`${Codicon.symbolBoolean.cssSelector} { color: ${symbolIconBooleanColor}; }`); - } - - const symbolIconClassColor = theme.getColor(SYMBOL_ICON_CLASS_FOREGROUND); - if (symbolIconClassColor) { - collector.addRule(`${Codicon.symbolClass.cssSelector} { color: ${symbolIconClassColor}; }`); - } - - const symbolIconMethodColor = theme.getColor(SYMBOL_ICON_METHOD_FOREGROUND); - if (symbolIconMethodColor) { - collector.addRule(`${Codicon.symbolMethod.cssSelector} { color: ${symbolIconMethodColor}; }`); - } - - const symbolIconColorColor = theme.getColor(SYMBOL_ICON_COLOR_FOREGROUND); - if (symbolIconColorColor) { - collector.addRule(`${Codicon.symbolColor.cssSelector} { color: ${symbolIconColorColor}; }`); - } - - const symbolIconConstantColor = theme.getColor(SYMBOL_ICON_CONSTANT_FOREGROUND); - if (symbolIconConstantColor) { - collector.addRule(`${Codicon.symbolConstant.cssSelector} { color: ${symbolIconConstantColor}; }`); - } - - const symbolIconConstructorColor = theme.getColor(SYMBOL_ICON_CONSTRUCTOR_FOREGROUND); - if (symbolIconConstructorColor) { - collector.addRule(`${Codicon.symbolConstructor.cssSelector} { color: ${symbolIconConstructorColor}; }`); - } - - const symbolIconEnumeratorColor = theme.getColor(SYMBOL_ICON_ENUMERATOR_FOREGROUND); - if (symbolIconEnumeratorColor) { - collector.addRule(` - ${Codicon.symbolValue.cssSelector},${Codicon.symbolEnum.cssSelector} { color: ${symbolIconEnumeratorColor}; }`); - } - - const symbolIconEnumeratorMemberColor = theme.getColor(SYMBOL_ICON_ENUMERATOR_MEMBER_FOREGROUND); - if (symbolIconEnumeratorMemberColor) { - collector.addRule(`${Codicon.symbolEnumMember.cssSelector} { color: ${symbolIconEnumeratorMemberColor}; }`); - } - - const symbolIconEventColor = theme.getColor(SYMBOL_ICON_EVENT_FOREGROUND); - if (symbolIconEventColor) { - collector.addRule(`${Codicon.symbolEvent.cssSelector} { color: ${symbolIconEventColor}; }`); - } - - const symbolIconFieldColor = theme.getColor(SYMBOL_ICON_FIELD_FOREGROUND); - if (symbolIconFieldColor) { - collector.addRule(`${Codicon.symbolField.cssSelector} { color: ${symbolIconFieldColor}; }`); - } - - const symbolIconFileColor = theme.getColor(SYMBOL_ICON_FILE_FOREGROUND); - if (symbolIconFileColor) { - collector.addRule(`${Codicon.symbolFile.cssSelector} { color: ${symbolIconFileColor}; }`); - } - - const symbolIconFolderColor = theme.getColor(SYMBOL_ICON_FOLDER_FOREGROUND); - if (symbolIconFolderColor) { - collector.addRule(`${Codicon.symbolFolder.cssSelector} { color: ${symbolIconFolderColor}; }`); - } - - const symbolIconFunctionColor = theme.getColor(SYMBOL_ICON_FUNCTION_FOREGROUND); - if (symbolIconFunctionColor) { - collector.addRule(`${Codicon.symbolFunction.cssSelector} { color: ${symbolIconFunctionColor}; }`); - } - - const symbolIconInterfaceColor = theme.getColor(SYMBOL_ICON_INTERFACE_FOREGROUND); - if (symbolIconInterfaceColor) { - collector.addRule(`${Codicon.symbolInterface.cssSelector} { color: ${symbolIconInterfaceColor}; }`); - } - - const symbolIconKeyColor = theme.getColor(SYMBOL_ICON_KEY_FOREGROUND); - if (symbolIconKeyColor) { - collector.addRule(`${Codicon.symbolKey.cssSelector} { color: ${symbolIconKeyColor}; }`); - } - - const symbolIconKeywordColor = theme.getColor(SYMBOL_ICON_KEYWORD_FOREGROUND); - if (symbolIconKeywordColor) { - collector.addRule(`${Codicon.symbolKeyword.cssSelector} { color: ${symbolIconKeywordColor}; }`); - } - - const symbolIconModuleColor = theme.getColor(SYMBOL_ICON_MODULE_FOREGROUND); - if (symbolIconModuleColor) { - collector.addRule(`${Codicon.symbolModule.cssSelector} { color: ${symbolIconModuleColor}; }`); - } - - const outlineNamespaceColor = theme.getColor(SYMBOL_ICON_NAMESPACE_FOREGROUND); - if (outlineNamespaceColor) { - collector.addRule(`${Codicon.symbolNamespace.cssSelector} { color: ${outlineNamespaceColor}; }`); - } - - const symbolIconNullColor = theme.getColor(SYMBOL_ICON_NULL_FOREGROUND); - if (symbolIconNullColor) { - collector.addRule(`${Codicon.symbolNull.cssSelector} { color: ${symbolIconNullColor}; }`); - } - - const symbolIconNumberColor = theme.getColor(SYMBOL_ICON_NUMBER_FOREGROUND); - if (symbolIconNumberColor) { - collector.addRule(`${Codicon.symbolNumber.cssSelector} { color: ${symbolIconNumberColor}; }`); - } - - const symbolIconObjectColor = theme.getColor(SYMBOL_ICON_OBJECT_FOREGROUND); - if (symbolIconObjectColor) { - collector.addRule(`${Codicon.symbolObject.cssSelector} { color: ${symbolIconObjectColor}; }`); - } - - const symbolIconOperatorColor = theme.getColor(SYMBOL_ICON_OPERATOR_FOREGROUND); - if (symbolIconOperatorColor) { - collector.addRule(`${Codicon.symbolOperator.cssSelector} { color: ${symbolIconOperatorColor}; }`); - } - - const symbolIconPackageColor = theme.getColor(SYMBOL_ICON_PACKAGE_FOREGROUND); - if (symbolIconPackageColor) { - collector.addRule(`${Codicon.symbolPackage.cssSelector} { color: ${symbolIconPackageColor}; }`); - } - - const symbolIconPropertyColor = theme.getColor(SYMBOL_ICON_PROPERTY_FOREGROUND); - if (symbolIconPropertyColor) { - collector.addRule(`${Codicon.symbolProperty.cssSelector} { color: ${symbolIconPropertyColor}; }`); - } - - const symbolIconReferenceColor = theme.getColor(SYMBOL_ICON_REFERENCE_FOREGROUND); - if (symbolIconReferenceColor) { - collector.addRule(`${Codicon.symbolReference.cssSelector} { color: ${symbolIconReferenceColor}; }`); - } - - const symbolIconSnippetColor = theme.getColor(SYMBOL_ICON_SNIPPET_FOREGROUND); - if (symbolIconSnippetColor) { - collector.addRule(`${Codicon.symbolSnippet.cssSelector} { color: ${symbolIconSnippetColor}; }`); - } - - const symbolIconStringColor = theme.getColor(SYMBOL_ICON_STRING_FOREGROUND); - if (symbolIconStringColor) { - collector.addRule(`${Codicon.symbolString.cssSelector} { color: ${symbolIconStringColor}; }`); - } - - const symbolIconStructColor = theme.getColor(SYMBOL_ICON_STRUCT_FOREGROUND); - if (symbolIconStructColor) { - collector.addRule(`${Codicon.symbolStruct.cssSelector} { color: ${symbolIconStructColor}; }`); - } - - const symbolIconTextColor = theme.getColor(SYMBOL_ICON_TEXT_FOREGROUND); - if (symbolIconTextColor) { - collector.addRule(`${Codicon.symbolText.cssSelector} { color: ${symbolIconTextColor}; }`); - } - - const symbolIconTypeParameterColor = theme.getColor(SYMBOL_ICON_TYPEPARAMETER_FOREGROUND); - if (symbolIconTypeParameterColor) { - collector.addRule(`${Codicon.symbolTypeParameter.cssSelector} { color: ${symbolIconTypeParameterColor}; }`); - } - - const symbolIconUnitColor = theme.getColor(SYMBOL_ICON_UNIT_FOREGROUND); - if (symbolIconUnitColor) { - collector.addRule(`${Codicon.symbolUnit.cssSelector} { color: ${symbolIconUnitColor}; }`); - } - - const symbolIconVariableColor = theme.getColor(SYMBOL_ICON_VARIABLE_FOREGROUND); - if (symbolIconVariableColor) { - collector.addRule(`${Codicon.symbolVariable.cssSelector} { color: ${symbolIconVariableColor}; }`); - } -}); diff --git a/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css b/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css index 3bf798683a7a1..ab44fb570a5d4 100644 --- a/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css +++ b/src/vs/workbench/contrib/typeHierarchy/browser/media/typeHierarchy.css @@ -25,6 +25,16 @@ height: 100%; } +.monaco-editor .type-hierarchy .tree { + background-color: var(--vscode-peekViewResult-background); + color: var(--vscode-peekViewResult-fileForeground); +} + +.monaco-editor .type-hierarchy .tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { + background-color: var(--vscode-peekViewResult-selectionBackground); + color: var(--vscode-peekViewResult-selectionForeground) !important; +} + .monaco-workbench .type-hierarchy .tree .typehierarchy-element { display: flex; flex: 1; @@ -35,3 +45,18 @@ .monaco-workbench .type-hierarchy .tree .typehierarchy-element .monaco-icon-label { padding-left: 4px; } + +.monaco-editor .type-hierarchy .type-decoration { + background-color: var(--vscode-peekViewEditor-matchHighlightBackground); + border: 2px solid var(--vscode-peekViewEditor-matchHighlightBorder); + box-sizing: border-box; +} + +.monaco-editor .type-hierarchy .editor .monaco-editor .monaco-editor-background, +.monaco-editor .type-hierarchy .editor .monaco-editor .inputarea.ime-input { + background-color: var(--vscode-peekViewEditor-background); +} + +.monaco-editor .type-hierarchy .editor .monaco-editor .margin { + background-color: var(--vscode-peekViewEditorGutter-background); +} diff --git a/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.ts b/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.ts index 5fa49e2ea7d06..a166eb0431ca6 100644 --- a/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.ts +++ b/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.ts @@ -30,7 +30,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IWorkbenchAsyncDataTreeOptions, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { IColorTheme, IThemeService, registerThemingParticipant, themeColorFromId } from 'vs/platform/theme/common/themeService'; +import { IColorTheme, IThemeService, themeColorFromId } from 'vs/platform/theme/common/themeService'; import * as typeHTree from 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree'; import { TypeHierarchyDirection, TypeHierarchyModel } from 'vs/workbench/contrib/typeHierarchy/common/typeHierarchy'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -421,47 +421,3 @@ export class TypeHierarchyTreePeekWidget extends peekView.PeekViewWidget { } } } - -registerThemingParticipant((theme, collector) => { - const referenceHighlightColor = theme.getColor(peekView.peekViewEditorMatchHighlight); - if (referenceHighlightColor) { - collector.addRule(`.monaco-editor .type-hierarchy .type-decoration { background-color: ${referenceHighlightColor}; }`); - } - const referenceHighlightBorder = theme.getColor(peekView.peekViewEditorMatchHighlightBorder); - if (referenceHighlightBorder) { - collector.addRule(`.monaco-editor .type-hierarchy .type-decoration { border: 2px solid ${referenceHighlightBorder}; box-sizing: border-box; }`); - } - const resultsBackground = theme.getColor(peekView.peekViewResultsBackground); - if (resultsBackground) { - collector.addRule(`.monaco-editor .type-hierarchy .tree { background-color: ${resultsBackground}; }`); - } - const resultsMatchForeground = theme.getColor(peekView.peekViewResultsFileForeground); - if (resultsMatchForeground) { - collector.addRule(`.monaco-editor .type-hierarchy .tree { color: ${resultsMatchForeground}; }`); - } - const resultsSelectedBackground = theme.getColor(peekView.peekViewResultsSelectionBackground); - if (resultsSelectedBackground) { - collector.addRule(`.monaco-editor .type-hierarchy .tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { background-color: ${resultsSelectedBackground}; }`); - } - const resultsSelectedForeground = theme.getColor(peekView.peekViewResultsSelectionForeground); - if (resultsSelectedForeground) { - collector.addRule(`.monaco-editor .type-hierarchy .tree .monaco-list:focus .monaco-list-rows > .monaco-list-row.selected:not(.highlighted) { color: ${resultsSelectedForeground} !important; }`); - } - const editorBackground = theme.getColor(peekView.peekViewEditorBackground); - if (editorBackground) { - collector.addRule( - `.monaco-editor .type-hierarchy .editor .monaco-editor .monaco-editor-background,` + - `.monaco-editor .type-hierarchy .editor .monaco-editor .inputarea.ime-input {` + - ` background-color: ${editorBackground};` + - `}` - ); - } - const editorGutterBackground = theme.getColor(peekView.peekViewEditorGutterBackground); - if (editorGutterBackground) { - collector.addRule( - `.monaco-editor .type-hierarchy .editor .monaco-editor .margin {` + - ` background-color: ${editorGutterBackground};` + - `}` - ); - } -});