Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5a622a99
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,发现更多精彩内容 >>
提交
5a622a99
编写于
7月 25, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implemente feedback
上级
06550ab0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
29 deletion
+29
-29
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+10
-10
src/vs/workbench/api/node/extHostConfiguration.ts
src/vs/workbench/api/node/extHostConfiguration.ts
+3
-3
src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts
...ch/test/electron-browser/api/extHostConfiguration.test.ts
+16
-16
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
5a622a99
...
...
@@ -2978,11 +2978,11 @@ declare module 'vscode' {
* - Workspace configuration (if available)
* - Workspace folder configuration of the requested resource (if available)
*
* *
*Global configuration*
* comes from User Settings and shadows Defaults.
* *
Global configuration
* comes from User Settings and shadows Defaults.
*
* *
*Workspace configuration*
* comes from Workspace Settings and shadows Global configuration.
* *
Workspace configuration
* comes from Workspace Settings and shadows Global configuration.
*
* *
*Workspace Folder configuration*
* comes from `.vscode` folder under one of the [workspace folders](#workspace.workspaceFolders).
* *
Workspace Folder configuration
* comes from `.vscode` folder under one of the [workspace folders](#workspace.workspaceFolders).
*
* *Note:* Workspace and Workspace Folder configurations contains `launch` and `tasks` settings. Their basename will be
* part of the section identifier. The following snippets shows how to retrieve all configurations
...
...
@@ -2990,7 +2990,7 @@ declare module 'vscode' {
*
* ```ts
* // launch.json configuration
* const config = workspace.getConfiguration(
workspace.workspaceFolders[1], 'launch'
);
* const config = workspace.getConfiguration(
'launch', vscode.window.activeTextEditor.document.uri
);
*
* // retrieve values
* const values = config.get('configurations');
...
...
@@ -3032,7 +3032,7 @@ declare module 'vscode' {
*
* The *effective* value (returned by [`get`](#WorkspaceConfiguration.get))
* is computed like this: `defaultValue` overwritten by `globalValue`,
* `globalValue` overwritten by `workspaceValue`. `workspaceValue` overwritten by `
f
olderValue`.
* `globalValue` overwritten by `workspaceValue`. `workspaceValue` overwritten by `
workspaceF
olderValue`.
* Refer to [Settings Inheritence](https://code.visualstudio.com/docs/getstarted/settings)
* for more information.
*
...
...
@@ -3042,7 +3042,7 @@ declare module 'vscode' {
* @param section Configuration name, supports _dotted_ names.
* @return Information about a configuration setting or `undefined`.
*/
inspect
<
T
>
(
section
:
string
):
{
key
:
string
;
defaultValue
?:
T
;
globalValue
?:
T
;
workspaceValue
?:
T
,
f
olderValue
?:
T
}
|
undefined
;
inspect
<
T
>
(
section
:
string
):
{
key
:
string
;
defaultValue
?:
T
;
globalValue
?:
T
;
workspaceValue
?:
T
,
workspaceF
olderValue
?:
T
}
|
undefined
;
/**
* Update a configuration value. The updated configuration values are persisted.
...
...
@@ -3064,11 +3064,11 @@ declare module 'vscode' {
*
* @param section Configuration name, supports _dotted_ names.
* @param value The new value.
* @param configurationTarget The [configuration target](#ConfigurationTarget)
* @param global When `true` changes the global configuration value otherwise workspace configuration value
* @param configurationTarget The [configuration target](#ConfigurationTarget) or a boolean value.
* If `undefined` or `null` or `false` configuration target is `ConfigurationTarget.Workspace`.
* If `true` configuration target is `ConfigurationTarget.Global`.
*/
update
(
section
:
string
,
value
:
any
,
configurationTarget
:
ConfigurationTarget
):
Thenable
<
void
>
;
update
(
section
:
string
,
value
:
any
,
global
?:
boolean
):
Thenable
<
void
>
;
update
(
section
:
string
,
value
:
any
,
configurationTarget
?:
ConfigurationTarget
|
boolean
):
Thenable
<
void
>
;
/**
* Readable dictionary that backs this configuration.
...
...
src/vs/workbench/api/node/extHostConfiguration.ts
浏览文件 @
5a622a99
...
...
@@ -30,7 +30,7 @@ type ConfigurationInspect<T> = {
defaultValue
?:
T
;
globalValue
?:
T
;
workspaceValue
?:
T
;
f
olderValue
?:
T
;
workspaceF
olderValue
?:
T
;
};
export
class
ExtHostConfiguration
extends
ExtHostConfigurationShape
{
...
...
@@ -87,7 +87,7 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
}
return
result
;
},
update
:
(
key
:
string
,
value
:
any
,
arg
:
boolean
|
ExtHostConfigurationTarget
)
=>
{
update
:
(
key
:
string
,
value
:
any
,
arg
:
ExtHostConfigurationTarget
|
boolean
)
=>
{
key
=
section
?
`
${
section
}
.
${
key
}
`
:
key
;
const
target
=
parseConfigurationTarget
(
arg
);
if
(
value
!==
void
0
)
{
...
...
@@ -105,7 +105,7 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape {
defaultValue
:
config
.
default
,
globalValue
:
config
.
user
,
workspaceValue
:
config
.
workspace
,
f
olderValue
:
config
.
folder
workspaceF
olderValue
:
config
.
folder
};
}
return
undefined
;
...
...
src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts
浏览文件 @
5a622a99
...
...
@@ -108,13 +108,13 @@ suite('ExtHostConfiguration', function () {
assert
.
equal
(
actual
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual
.
workspaceValue
,
undefined
);
assert
.
equal
(
actual
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual
.
workspaceF
olderValue
,
undefined
);
actual
=
testObject
.
getConfiguration
(
'
editor
'
).
inspect
(
'
wordWrap
'
);
assert
.
equal
(
actual
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual
.
workspaceValue
,
undefined
);
assert
.
equal
(
actual
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual
.
workspaceF
olderValue
,
undefined
);
});
test
(
'
inspect in single root context
'
,
function
()
{
...
...
@@ -153,25 +153,25 @@ suite('ExtHostConfiguration', function () {
assert
.
equal
(
actual1
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual1
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual1
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual1
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual1
.
workspaceF
olderValue
,
undefined
);
actual1
=
testObject
.
getConfiguration
(
'
editor
'
).
inspect
(
'
wordWrap
'
);
assert
.
equal
(
actual1
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual1
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual1
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual1
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual1
.
workspaceF
olderValue
,
undefined
);
let
actual2
=
testObject
.
getConfiguration
(
null
,
workspaceUri
).
inspect
(
'
editor.wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
f
olderValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
'
bounded
'
);
actual2
=
testObject
.
getConfiguration
(
'
editor
'
,
workspaceUri
).
inspect
(
'
wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
f
olderValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
'
bounded
'
);
});
test
(
'
inspect in multi root context
'
,
function
()
{
...
...
@@ -226,63 +226,63 @@ suite('ExtHostConfiguration', function () {
assert
.
equal
(
actual1
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual1
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual1
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual1
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual1
.
workspaceF
olderValue
,
undefined
);
actual1
=
testObject
.
getConfiguration
(
'
editor
'
).
inspect
(
'
wordWrap
'
);
assert
.
equal
(
actual1
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual1
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual1
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual1
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual1
.
workspaceF
olderValue
,
undefined
);
actual1
=
testObject
.
getConfiguration
(
'
editor
'
).
inspect
(
'
lineNumbers
'
);
assert
.
equal
(
actual1
.
defaultValue
,
'
on
'
);
assert
.
equal
(
actual1
.
globalValue
,
undefined
);
assert
.
equal
(
actual1
.
workspaceValue
,
undefined
);
assert
.
equal
(
actual1
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual1
.
workspaceF
olderValue
,
undefined
);
let
actual2
=
testObject
.
getConfiguration
(
null
,
firstRoot
).
inspect
(
'
editor.wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
f
olderValue
,
'
off
'
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
'
off
'
);
actual2
=
testObject
.
getConfiguration
(
'
editor
'
,
firstRoot
).
inspect
(
'
wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
f
olderValue
,
'
off
'
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
'
off
'
);
actual2
=
testObject
.
getConfiguration
(
'
editor
'
,
firstRoot
).
inspect
(
'
lineNumbers
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
on
'
);
assert
.
equal
(
actual2
.
globalValue
,
undefined
);
assert
.
equal
(
actual2
.
workspaceValue
,
undefined
);
assert
.
equal
(
actual2
.
f
olderValue
,
'
relative
'
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
'
relative
'
);
actual2
=
testObject
.
getConfiguration
(
null
,
secondRoot
).
inspect
(
'
editor.wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
f
olderValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
'
on
'
);
actual2
=
testObject
.
getConfiguration
(
'
editor
'
,
secondRoot
).
inspect
(
'
wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
equal
(
actual2
.
f
olderValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
'
on
'
);
actual2
=
testObject
.
getConfiguration
(
null
,
thirdRoot
).
inspect
(
'
editor.wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
ok
(
Object
.
keys
(
actual2
).
indexOf
(
'
folderValue
'
)
!==
-
1
);
assert
.
equal
(
actual2
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
undefined
);
actual2
=
testObject
.
getConfiguration
(
'
editor
'
,
thirdRoot
).
inspect
(
'
wordWrap
'
);
assert
.
equal
(
actual2
.
defaultValue
,
'
off
'
);
assert
.
equal
(
actual2
.
globalValue
,
'
on
'
);
assert
.
equal
(
actual2
.
workspaceValue
,
'
bounded
'
);
assert
.
ok
(
Object
.
keys
(
actual2
).
indexOf
(
'
folderValue
'
)
!==
-
1
);
assert
.
equal
(
actual2
.
f
olderValue
,
undefined
);
assert
.
equal
(
actual2
.
workspaceF
olderValue
,
undefined
);
});
test
(
'
getConfiguration vs get
'
,
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录