Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a5626315
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
a5626315
编写于
7月 25, 2021
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[themes] code assist insided extended syntax, remove experimental
上级
4feb4fd4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
13 addition
and
38 deletion
+13
-38
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
...orkbench/services/themes/browser/workbenchThemeService.ts
+2
-2
src/vs/workbench/services/themes/common/colorThemeData.ts
src/vs/workbench/services/themes/common/colorThemeData.ts
+3
-10
src/vs/workbench/services/themes/common/themeConfiguration.ts
...vs/workbench/services/themes/common/themeConfiguration.ts
+8
-25
src/vs/workbench/services/themes/common/workbenchThemeService.ts
...workbench/services/themes/common/workbenchThemeService.ts
+0
-1
未找到文件。
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
浏览文件 @
a5626315
...
...
@@ -271,8 +271,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
this
.
currentColorTheme
.
setCustomTokenColors
(
this
.
settings
.
tokenColorCustomizations
);
hasColorChanges
=
true
;
}
if
(
e
.
affectsConfiguration
(
ThemeSettings
.
SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS
)
||
e
.
affectsConfiguration
(
ThemeSettings
.
TOKEN_COLOR_CUSTOMIZATIONS_EXPERIMENTAL
)
)
{
this
.
currentColorTheme
.
setCustomSemanticTokenColors
(
this
.
settings
.
semanticTokenColorCustomizations
,
this
.
settings
.
experimentalSemanticTokenColorCustomizations
);
if
(
e
.
affectsConfiguration
(
ThemeSettings
.
SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS
))
{
this
.
currentColorTheme
.
setCustomSemanticTokenColors
(
this
.
settings
.
semanticTokenColorCustomizations
);
hasColorChanges
=
true
;
}
if
(
hasColorChanges
)
{
...
...
src/vs/workbench/services/themes/common/colorThemeData.ts
浏览文件 @
a5626315
...
...
@@ -6,7 +6,7 @@
import
{
basename
}
from
'
vs/base/common/path
'
;
import
*
as
Json
from
'
vs/base/common/json
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
ExtensionData
,
ITokenColorCustomizations
,
ITextMateThemingRule
,
IWorkbenchColorTheme
,
IColorMap
,
IThemeExtensionPoint
,
VS_LIGHT_THEME
,
VS_HC_THEME
,
IColorCustomizations
,
ISemanticTokenRules
,
ISemanticTokenColorizationSetting
,
ISemanticTokenColorCustomizations
,
I
ExperimentalSemanticTokenColorCustomizations
,
I
ThemeScopableCustomizations
,
IThemeScopedCustomizations
,
THEME_SCOPE_CLOSE_PAREN
,
THEME_SCOPE_OPEN_PAREN
,
themeScopeRegex
,
THEME_SCOPE_WILDCARD
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
ExtensionData
,
ITokenColorCustomizations
,
ITextMateThemingRule
,
IWorkbenchColorTheme
,
IColorMap
,
IThemeExtensionPoint
,
VS_LIGHT_THEME
,
VS_HC_THEME
,
IColorCustomizations
,
ISemanticTokenRules
,
ISemanticTokenColorizationSetting
,
ISemanticTokenColorCustomizations
,
IThemeScopableCustomizations
,
IThemeScopedCustomizations
,
THEME_SCOPE_CLOSE_PAREN
,
THEME_SCOPE_OPEN_PAREN
,
themeScopeRegex
,
THEME_SCOPE_WILDCARD
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
convertSettings
}
from
'
vs/workbench/services/themes/common/themeCompatibility
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
...
...
@@ -349,7 +349,7 @@ export class ColorThemeData implements IWorkbenchColorTheme {
public
setCustomizations
(
settings
:
ThemeConfiguration
)
{
this
.
setCustomColors
(
settings
.
colorCustomizations
);
this
.
setCustomTokenColors
(
settings
.
tokenColorCustomizations
);
this
.
setCustomSemanticTokenColors
(
settings
.
semanticTokenColorCustomizations
,
settings
.
experimentalSemanticTokenColorCustomizations
);
this
.
setCustomSemanticTokenColors
(
settings
.
semanticTokenColorCustomizations
);
}
public
setCustomColors
(
colors
:
IColorCustomizations
)
{
...
...
@@ -393,17 +393,10 @@ export class ColorThemeData implements IWorkbenchColorTheme {
this
.
customTokenScopeMatchers
=
undefined
;
}
public
setCustomSemanticTokenColors
(
semanticTokenColors
:
ISemanticTokenColorCustomizations
|
undefined
,
experimental
?:
IExperimentalSemanticTokenColorCustomizations
)
{
public
setCustomSemanticTokenColors
(
semanticTokenColors
:
ISemanticTokenColorCustomizations
|
undefined
)
{
this
.
customSemanticTokenRules
=
[];
this
.
customSemanticHighlighting
=
undefined
;
if
(
experimental
)
{
// apply deprecated settings first
this
.
readSemanticTokenRules
(
experimental
);
const
themeSpecificColors
=
this
.
getThemeSpecificColors
(
experimental
)
as
IExperimentalSemanticTokenColorCustomizations
;
if
(
types
.
isObject
(
themeSpecificColors
))
{
this
.
readSemanticTokenRules
(
themeSpecificColors
);
}
}
if
(
semanticTokenColors
)
{
this
.
customSemanticHighlighting
=
semanticTokenColors
.
enabled
;
if
(
semanticTokenColors
.
rules
)
{
...
...
src/vs/workbench/services/themes/common/themeConfiguration.ts
浏览文件 @
a5626315
...
...
@@ -12,7 +12,7 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema';
import
{
textmateColorsSchemaId
,
textmateColorGroupSchemaId
}
from
'
vs/workbench/services/themes/common/colorThemeSchema
'
;
import
{
workbenchColorsSchemaId
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
tokenStylingSchemaId
}
from
'
vs/platform/theme/common/tokenClassificationRegistry
'
;
import
{
ThemeSettings
,
IWorkbenchColorTheme
,
IWorkbenchFileIconTheme
,
IColorCustomizations
,
ITokenColorCustomizations
,
IWorkbenchProductIconTheme
,
ISemanticTokenColorCustomizations
,
IExperimentalSemanticTokenColorCustomizations
,
ThemeSettingTarget
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
ThemeSettings
,
IWorkbenchColorTheme
,
IWorkbenchFileIconTheme
,
IColorCustomizations
,
ITokenColorCustomizations
,
IWorkbenchProductIconTheme
,
ISemanticTokenColorCustomizations
,
ThemeSettingTarget
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
isMacintosh
,
isWeb
,
isWindows
}
from
'
vs/base/common/platform
'
;
...
...
@@ -144,6 +144,8 @@ function tokenGroupSettings(description: string): IJSONSchema {
};
}
const
themeSpecificSettingKey
=
'
^
\\
[[^
\\
]]*(
\\
]
\\
s*
\\
[[^
\\
]]*)*
\\
]$
'
;
const
tokenColorSchema
:
IJSONSchema
=
{
type
:
'
object
'
,
properties
:
{
...
...
@@ -165,21 +167,13 @@ const tokenColorSchema: IJSONSchema = {
type
:
'
boolean
'
}
},
patternProperties
:
{
'
^
\\
[[^
\\
]]*(
\\
]
\\
s*
\\
[[^
\\
]]*)*
\\
]$
'
:
{
type
:
'
object
'
},
'
^[^
\\
[
\\
]]*$
'
:
{
type
:
'
object
'
}
},
additionalProperties
:
false
};
const
tokenColorCustomizationSchema
:
IConfigurationPropertySchema
=
{
description
:
nls
.
localize
(
'
editorColors
'
,
"
Overrides editor syntax colors and font style from the currently selected color theme.
"
),
default
:
{},
allOf
:
[
tokenColorSchema
]
allOf
:
[
{
...
tokenColorSchema
,
patternProperties
:
{
'
^
\\
[
'
:
{}
}
}
]
};
const
semanticTokenColorSchema
:
IJSONSchema
=
{
...
...
@@ -205,20 +199,13 @@ const semanticTokenColorCustomizationSchema: IConfigurationPropertySchema = {
allOf
:
[{
...
semanticTokenColorSchema
,
patternProperties
:
{
'
^
\\
[
'
:
{}
}
}]
};
const
experimentalTokenStylingCustomizationSchema
:
IConfigurationPropertySchema
=
{
deprecationMessage
:
nls
.
localize
(
'
editorColors.experimentalTokenStyling.deprecationMessage
'
,
'
Use `editor.semanticTokenColorCustomizations` instead.
'
),
markdownDeprecationMessage
:
nls
.
localize
(
'
editorColors.experimentalTokenStyling.deprecationMessageMarkdown
'
,
'
Use `#editor.semanticTokenColorCustomizations#` instead.
'
),
default
:
{},
allOf
:
[{
$ref
:
tokenStylingSchemaId
}],
};
const
tokenColorCustomizationConfiguration
:
IConfigurationNode
=
{
id
:
'
editor
'
,
order
:
7.2
,
type
:
'
object
'
,
properties
:
{
[
ThemeSettings
.
TOKEN_COLOR_CUSTOMIZATIONS
]:
tokenColorCustomizationSchema
,
[
ThemeSettings
.
SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS
]:
semanticTokenColorCustomizationSchema
,
[
ThemeSettings
.
TOKEN_COLOR_CUSTOMIZATIONS_EXPERIMENTAL
]:
experimentalTokenStylingCustomizationSchema
[
ThemeSettings
.
SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS
]:
semanticTokenColorCustomizationSchema
}
};
...
...
@@ -233,7 +220,6 @@ export function updateColorThemeConfigurationSchemas(themes: IWorkbenchColorThem
const
themeSpecificWorkbenchColors
:
IJSONSchema
=
{
properties
:
{}
};
const
themeSpecificTokenColors
:
IJSONSchema
=
{
properties
:
{}
};
const
themeSpecificSemanticTokenColors
:
IJSONSchema
=
{
properties
:
{}
};
const
experimentalThemeSpecificSemanticTokenColors
:
IJSONSchema
=
{
properties
:
{}
};
const
workbenchColors
=
{
$ref
:
workbenchColorsSchemaId
,
additionalProperties
:
false
};
const
tokenColors
=
{
properties
:
tokenColorSchema
.
properties
,
additionalProperties
:
false
};
...
...
@@ -243,13 +229,14 @@ export function updateColorThemeConfigurationSchemas(themes: IWorkbenchColorThem
themeSpecificWorkbenchColors
.
properties
!
[
themeId
]
=
workbenchColors
;
themeSpecificTokenColors
.
properties
!
[
themeId
]
=
tokenColors
;
themeSpecificSemanticTokenColors
.
properties
!
[
themeId
]
=
semanticTokenColorSchema
;
experimentalThemeSpecificSemanticTokenColors
.
properties
!
[
themeId
]
=
{
$ref
:
tokenStylingSchemaId
,
additionalProperties
:
false
};
}
themeSpecificWorkbenchColors
.
patternProperties
=
{
[
themeSpecificSettingKey
]:
workbenchColors
};
themeSpecificTokenColors
.
patternProperties
=
{
[
themeSpecificSettingKey
]:
tokenColors
};
themeSpecificSemanticTokenColors
.
patternProperties
=
{
[
themeSpecificSettingKey
]:
semanticTokenColorSchema
};
colorCustomizationsSchema
.
allOf
!
[
1
]
=
themeSpecificWorkbenchColors
;
tokenColorCustomizationSchema
.
allOf
!
[
1
]
=
themeSpecificTokenColors
;
semanticTokenColorCustomizationSchema
.
allOf
!
[
1
]
=
themeSpecificSemanticTokenColors
;
experimentalTokenStylingCustomizationSchema
.
allOf
!
[
1
]
=
experimentalThemeSpecificSemanticTokenColors
;
configurationRegistry
.
notifyConfigurationSchemaUpdated
(
themeSettingsConfiguration
,
tokenColorCustomizationConfiguration
);
}
...
...
@@ -299,10 +286,6 @@ export class ThemeConfiguration {
return
this
.
configurationService
.
getValue
<
ISemanticTokenColorCustomizations
>
(
ThemeSettings
.
SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS
);
}
public
get
experimentalSemanticTokenColorCustomizations
():
IExperimentalSemanticTokenColorCustomizations
|
undefined
{
return
this
.
configurationService
.
getValue
<
IExperimentalSemanticTokenColorCustomizations
>
(
ThemeSettings
.
TOKEN_COLOR_CUSTOMIZATIONS_EXPERIMENTAL
);
}
public
async
setColorTheme
(
theme
:
IWorkbenchColorTheme
,
settingsTarget
:
ThemeSettingTarget
):
Promise
<
IWorkbenchColorTheme
>
{
await
this
.
writeConfiguration
(
ThemeSettings
.
COLOR_THEME
,
theme
.
settingsId
,
settingsTarget
);
return
theme
;
...
...
src/vs/workbench/services/themes/common/workbenchThemeService.ts
浏览文件 @
a5626315
...
...
@@ -31,7 +31,6 @@ export enum ThemeSettings {
COLOR_CUSTOMIZATIONS
=
'
workbench.colorCustomizations
'
,
TOKEN_COLOR_CUSTOMIZATIONS
=
'
editor.tokenColorCustomizations
'
,
SEMANTIC_TOKEN_COLOR_CUSTOMIZATIONS
=
'
editor.semanticTokenColorCustomizations
'
,
TOKEN_COLOR_CUSTOMIZATIONS_EXPERIMENTAL
=
'
editor.tokenColorCustomizationsExperimental
'
,
PREFERRED_DARK_THEME
=
'
workbench.preferredDarkColorTheme
'
,
PREFERRED_LIGHT_THEME
=
'
workbench.preferredLightColorTheme
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录