Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5830f685
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5830f685
编写于
2月 04, 2019
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
auto select theme under development (fixes #62582)
上级
9af78e6f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
35 addition
and
4 deletion
+35
-4
src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts
...bench/services/themes/electron-browser/colorThemeStore.ts
+12
-2
src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts
...ch/services/themes/electron-browser/fileIconThemeStore.ts
+9
-0
src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts
...services/themes/electron-browser/workbenchThemeService.ts
+14
-2
未找到文件。
src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts
浏览文件 @
5830f685
...
...
@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import
*
as
types
from
'
vs/base/common/types
'
;
import
*
as
resources
from
'
vs/base/common/resources
'
;
import
{
ExtensionsRegistry
,
ExtensionMessageCollector
}
from
'
vs/workbench/services/extensions/common/extensionsRegistry
'
;
import
{
IColorTheme
,
ExtensionData
,
IThemeExtensionPoint
,
VS_LIGHT_THEME
,
VS_DARK_THEME
,
VS_HC_THEME
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
ExtensionData
,
IThemeExtensionPoint
,
VS_LIGHT_THEME
,
VS_DARK_THEME
,
VS_HC_THEME
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
ColorThemeData
}
from
'
vs/workbench/services/themes/electron-browser/colorThemeData
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
...
...
@@ -155,7 +155,17 @@ export class ColorThemeStore {
});
}
public
getColorThemes
():
Promise
<
IColorTheme
[]
>
{
public
findThemeDataByParentLocation
(
parentLocation
:
URI
):
Promise
<
ColorThemeData
[]
>
{
if
(
parentLocation
)
{
return
this
.
getColorThemes
().
then
(
allThemes
=>
{
return
allThemes
.
filter
(
t
=>
t
.
location
&&
resources
.
isEqualOrParent
(
t
.
location
,
parentLocation
));
});
}
return
Promise
.
resolve
([]);
}
public
getColorThemes
():
Promise
<
ColorThemeData
[]
>
{
return
this
.
extensionService
.
whenInstalledExtensionsRegistered
().
then
(
_
=>
{
return
this
.
extensionsColorThemes
;
});
...
...
src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts
浏览文件 @
5830f685
...
...
@@ -154,6 +154,15 @@ export class FileIconThemeStore {
});
}
public
findThemeDataByParentLocation
(
parentLocation
:
URI
):
any
{
if
(
parentLocation
)
{
return
this
.
getFileIconThemes
().
then
(
allThemes
=>
{
return
allThemes
.
filter
(
t
=>
t
.
location
&&
resources
.
isEqualOrParent
(
t
.
location
,
parentLocation
));
});
}
return
Promise
.
resolve
([]);
}
public
getFileIconThemes
():
Promise
<
FileIconThemeData
[]
>
{
return
this
.
extensionService
.
whenInstalledExtensionsRegistered
().
then
(
isReady
=>
{
return
this
.
knownIconThemes
;
...
...
src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts
浏览文件 @
5830f685
...
...
@@ -257,10 +257,22 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
return
Promise
.
all
([
this
.
colorThemeStore
.
findThemeDataBySettingsId
(
colorThemeSetting
,
DEFAULT_THEME_ID
).
then
(
theme
=>
{
return
this
.
setColorTheme
(
theme
&&
theme
.
id
,
undefined
);
return
this
.
colorThemeStore
.
findThemeDataByParentLocation
(
this
.
environmentService
.
extensionDevelopmentLocationURI
).
then
(
devThemes
=>
{
if
(
devThemes
.
length
)
{
return
this
.
setColorTheme
(
devThemes
[
0
].
id
,
ConfigurationTarget
.
MEMORY
);
}
else
{
return
this
.
setColorTheme
(
theme
&&
theme
.
id
,
undefined
);
}
});
}),
this
.
iconThemeStore
.
findThemeBySettingsId
(
iconThemeSetting
).
then
(
theme
=>
{
return
this
.
setFileIconTheme
(
theme
&&
theme
.
id
,
undefined
);
return
this
.
iconThemeStore
.
findThemeDataByParentLocation
(
this
.
environmentService
.
extensionDevelopmentLocationURI
).
then
(
devThemes
=>
{
if
(
devThemes
.
length
)
{
return
this
.
setFileIconTheme
(
devThemes
[
0
].
id
,
ConfigurationTarget
.
MEMORY
);
}
else
{
return
this
.
setFileIconTheme
(
theme
&&
theme
.
id
,
undefined
);
}
});
}),
]);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录