Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d452f8d2
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,发现更多精彩内容 >>
提交
d452f8d2
编写于
6月 28, 2016
作者:
D
Don Jayamanne
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changes to replace settings variables in launch config #8042
上级
e170425f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
4 deletion
+33
-4
src/vs/base/common/parsers.ts
src/vs/base/common/parsers.ts
+4
-4
src/vs/workbench/parts/debug/node/debugConfigurationManager.ts
...s/workbench/parts/debug/node/debugConfigurationManager.ts
+9
-0
src/vs/workbench/parts/lib/node/settingsVariables.ts
src/vs/workbench/parts/lib/node/settingsVariables.ts
+20
-0
未找到文件。
src/vs/base/common/parsers.ts
浏览文件 @
d452f8d2
...
...
@@ -130,7 +130,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables {
public
resolve
(
value
:
IStringDictionary
<
IStringDictionary
<
string
>>
):
IStringDictionary
<
IStringDictionary
<
string
>>
;
public
resolve
(
value
:
any
):
any
{
if
(
Types
.
isString
(
value
))
{
return
this
.
__
resolveString
(
value
);
return
this
.
resolveString
(
value
);
}
else
if
(
Types
.
isArray
(
value
))
{
return
this
.
__resolveArray
(
value
);
}
else
if
(
Types
.
isObject
(
value
))
{
...
...
@@ -143,7 +143,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables {
resolveAny
<
T
>
(
value
:
T
):
T
;
resolveAny
<
T
>
(
value
:
any
):
any
{
if
(
Types
.
isString
(
value
))
{
return
this
.
__
resolveString
(
value
);
return
this
.
resolveString
(
value
);
}
else
if
(
Types
.
isArray
(
value
))
{
return
this
.
__resolveAnyArray
(
value
);
}
else
if
(
Types
.
isObject
(
value
))
{
...
...
@@ -153,7 +153,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables {
return
value
;
}
pr
ivate
__
resolveString
(
value
:
string
):
string
{
pr
otected
resolveString
(
value
:
string
):
string
{
let
regexp
=
/
\$\{(
.*
?)\}
/g
;
return
value
.
replace
(
regexp
,
(
match
:
string
,
name
:
string
)
=>
{
let
newValue
=
(
<
any
>
this
)[
name
];
...
...
@@ -185,7 +185,7 @@ export abstract class AbstractSystemVariables implements ISystemVariables {
}
private
__resolveArray
(
value
:
string
[]):
string
[]
{
return
value
.
map
(
s
=>
this
.
__
resolveString
(
s
));
return
value
.
map
(
s
=>
this
.
resolveString
(
s
));
}
private
__resolveAnyArray
<
T
>
(
value
:
T
[]):
T
[];
...
...
src/vs/workbench/parts/debug/node/debugConfigurationManager.ts
浏览文件 @
d452f8d2
...
...
@@ -30,6 +30,7 @@ import { Adapter } from 'vs/workbench/parts/debug/node/debugAdapter';
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
SettingsVariables
}
from
'
vs/workbench/parts/lib/node/settingsVariables
'
;
// debuggers extension point
...
...
@@ -155,6 +156,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
public
configuration
:
debug
.
IConfig
;
private
systemVariables
:
SystemVariables
;
private
settingsVariables
:
SettingsVariables
;
private
adapters
:
Adapter
[];
private
allModeIdsForBreakpoints
:
{
[
key
:
string
]:
boolean
};
private
_onDidConfigurationChange
:
Emitter
<
string
>
;
...
...
@@ -171,6 +173,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
)
{
this
.
_onDidConfigurationChange
=
new
Emitter
<
string
>
();
this
.
systemVariables
=
this
.
contextService
.
getWorkspace
()
?
new
SystemVariables
(
this
.
editorService
,
this
.
contextService
)
:
null
;
this
.
settingsVariables
=
new
SettingsVariables
(
this
.
configurationService
.
getConfiguration
<
any
>
());
this
.
setConfiguration
(
configName
);
this
.
adapters
=
[];
this
.
registerListeners
();
...
...
@@ -326,6 +329,12 @@ export class ConfigurationManager implements debug.IConfigurationManager {
this
.
configuration
[
key
]
=
this
.
systemVariables
.
resolveAny
(
this
.
configuration
[
key
]);
});
}
// massage configuration attributes - substitute settings (from settings.json) variables.
if
(
this
.
systemVariables
)
{
Object
.
keys
(
this
.
configuration
).
forEach
(
key
=>
{
this
.
configuration
[
key
]
=
this
.
settingsVariables
.
resolveAny
(
this
.
configuration
[
key
]);
});
}
}
}).
then
(()
=>
this
.
_onDidConfigurationChange
.
fire
(
this
.
configurationName
));
}
...
...
src/vs/workbench/parts/lib/node/settingsVariables.ts
0 → 100644
浏览文件 @
d452f8d2
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
AbstractSystemVariables
}
from
'
vs/base/common/parsers
'
;
export
class
SettingsVariables
extends
AbstractSystemVariables
{
constructor
(
private
configuration
:
any
)
{
super
();
}
protected
resolveString
(
value
:
string
):
string
{
let
regexp
=
/
\$
{settings.
(
.+
)
}/g
;
return
value
.
replace
(
regexp
,
(
match
:
string
,
name
:
string
)
=>
{
return
new
Function
(
'
_
'
,
'
return _.
'
+
name
)(
this
.
configuration
);
});
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录