Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
00400d8f
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,体验更适合开发者的 AI 搜索 >>
“62065a6cb54b2a3d4f4662aa8244a68b3a0fa8d5”上不存在“git@gitcode.net:openeuler/libvirt.git”
提交
00400d8f
编写于
6月 15, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#28538 API to get settings by override identifiers
- language - resource
上级
69fd57e4
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
23 addition
and
50 deletion
+23
-50
src/vs/editor/common/services/editorWorkerServiceImpl.ts
src/vs/editor/common/services/editorWorkerServiceImpl.ts
+2
-3
src/vs/editor/common/services/modelServiceImpl.ts
src/vs/editor/common/services/modelServiceImpl.ts
+1
-1
src/vs/platform/configuration/common/configuration.ts
src/vs/platform/configuration/common/configuration.ts
+7
-9
src/vs/platform/configuration/node/configurationService.ts
src/vs/platform/configuration/node/configurationService.ts
+3
-15
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
+1
-1
src/vs/workbench/browser/parts/editor/textEditor.ts
src/vs/workbench/browser/parts/editor/textEditor.ts
+1
-1
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
...s/welcome/walkThrough/electron-browser/walkThroughPart.ts
+1
-1
src/vs/workbench/services/configuration/node/configuration.ts
...vs/workbench/services/configuration/node/configuration.ts
+6
-18
src/vs/workbench/services/keybinding/common/keybindingEditing.ts
...workbench/services/keybinding/common/keybindingEditing.ts
+1
-1
未找到文件。
src/vs/editor/common/services/editorWorkerServiceImpl.ts
浏览文件 @
00400d8f
...
...
@@ -17,7 +17,7 @@ import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerServ
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
EditorSimpleWorkerImpl
}
from
'
vs/editor/common/services/editorSimpleWorker
'
;
import
{
LanguageConfigurationRegistry
}
from
'
vs/editor/common/modes/languageConfigurationRegistry
'
;
import
{
IConfigurationService
,
IConfigurationOptions
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IRange
}
from
'
vs/editor/common/core/range
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
...
...
@@ -93,8 +93,7 @@ class WordBasedCompletionItemProvider implements modes.ISuggestSupport {
provideCompletionItems
(
model
:
editorCommon
.
IModel
,
position
:
Position
):
TPromise
<
modes
.
ISuggestResult
>
{
const
{
language
}
=
this
.
_modeService
.
getLanguageIdentifier
(
model
.
getLanguageIdAtPosition
(
position
.
lineNumber
,
position
.
column
));
const
options
=
<
IConfigurationOptions
>
{
section
:
'
editor
'
,
overrideIdentifier
:
language
};
const
{
wordBasedSuggestions
}
=
this
.
_configurationService
.
getConfiguration
<
IEditorOptions
>
(
options
);
const
{
wordBasedSuggestions
}
=
this
.
_configurationService
.
getConfiguration
<
IEditorOptions
>
(
'
editor
'
,
{
language
});
if
(
!
wordBasedSuggestions
)
{
return
undefined
;
}
...
...
src/vs/editor/common/services/modelServiceImpl.ts
浏览文件 @
00400d8f
...
...
@@ -267,7 +267,7 @@ export class ModelServiceImpl implements IModelService {
public
getCreationOptions
(
language
:
string
):
editorCommon
.
ITextModelCreationOptions
{
let
creationOptions
=
this
.
_modelCreationOptionsByLanguage
[
language
];
if
(
!
creationOptions
)
{
creationOptions
=
ModelServiceImpl
.
_readModelOptions
(
this
.
_configurationService
.
getConfiguration
(
{
overrideIdentifier
:
language
}));
creationOptions
=
ModelServiceImpl
.
_readModelOptions
(
this
.
_configurationService
.
getConfiguration
(
null
,
{
language
}));
this
.
_modelCreationOptionsByLanguage
[
language
]
=
creationOptions
;
}
return
creationOptions
;
...
...
src/vs/platform/configuration/common/configuration.ts
浏览文件 @
00400d8f
...
...
@@ -14,10 +14,9 @@ import Event from 'vs/base/common/event';
export
const
IConfigurationService
=
createDecorator
<
IConfigurationService
>
(
'
configurationService
'
);
export
interface
IConfigurationO
ption
s
{
overrideIdentifier
?:
string
;
export
interface
IConfigurationO
verride
s
{
language
?:
string
;
resource
?:
URI
;
section
?:
string
;
}
export
type
IConfigurationValues
=
{
[
key
:
string
]:
IConfigurationValue
<
any
>
};
...
...
@@ -31,8 +30,7 @@ export interface IConfigurationService {
* Fetches the appropriate section of the configuration JSON file.
* This will be an object keyed off the section name.
*/
getConfiguration
<
T
>
(
section
?:
string
):
T
;
getConfiguration
<
T
>
(
options
?:
IConfigurationOptions
):
T
;
getConfiguration
<
T
>
(
section
?:
string
,
overrides
?:
IConfigurationOverrides
):
T
;
/**
* Resolves a configuration key to its values in the different scopes
...
...
@@ -243,9 +241,9 @@ export class Configuration<T> {
}
}
getValue
<
C
>
(
options
:
IConfigurationOption
s
=
{}):
C
{
getValue
<
C
>
(
section
:
string
=
''
,
options
:
IConfigurationOverride
s
=
{}):
C
{
const
configModel
=
this
.
getConfigurationModel
(
options
);
return
options
.
section
?
configModel
.
getContentsFor
<
C
>
(
options
.
section
)
:
configModel
.
contents
;
return
section
?
configModel
.
getContentsFor
<
C
>
(
section
)
:
configModel
.
contents
;
}
lookup
<
C
>
(
key
:
string
,
overrideIdentifier
?:
string
):
IConfigurationValue
<
C
>
{
...
...
@@ -298,9 +296,9 @@ export class Configuration<T> {
return
result
;
}
private
getConfigurationModel
<
C
>
(
options
:
IConfigurationO
ption
s
):
ConfigurationModel
<
any
>
{
private
getConfigurationModel
<
C
>
(
options
:
IConfigurationO
verride
s
):
ConfigurationModel
<
any
>
{
let
configurationModel
=
(
options
.
resource
?
this
.
_foldersConsolidated
.
get
(
options
.
resource
)
:
this
.
_workspace
)
||
new
ConfigurationModel
();
return
options
.
overrideIdentifier
?
configurationModel
.
override
<
T
>
(
options
.
overrideIdentifier
)
:
configurationModel
;
return
options
.
language
?
configurationModel
.
override
<
T
>
(
options
.
language
)
:
configurationModel
;
}
public
toData
():
IConfigurationData
<
any
>
{
...
...
src/vs/platform/configuration/node/configurationService.ts
浏览文件 @
00400d8f
...
...
@@ -9,7 +9,7 @@ import { ConfigWatcher } from 'vs/base/node/config';
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
IConfigurationRegistry
,
Extensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IDisposable
,
toDisposable
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ConfigurationSource
,
IConfigurationService
,
IConfigurationServiceEvent
,
IConfigurationValue
,
IConfigurationKeys
,
ConfigurationModel
,
IConfigurationO
ption
s
,
Configuration
,
IConfigurationValues
,
IConfigurationData
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ConfigurationSource
,
IConfigurationService
,
IConfigurationServiceEvent
,
IConfigurationValue
,
IConfigurationKeys
,
ConfigurationModel
,
IConfigurationO
verride
s
,
Configuration
,
IConfigurationValues
,
IConfigurationData
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
CustomConfigurationModel
,
DefaultConfigurationModel
}
from
'
vs/platform/configuration/common/model
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
...
...
@@ -67,10 +67,8 @@ export class ConfigurationService<T> extends Disposable implements IConfiguratio
});
}
public
getConfiguration
<
C
>
(
section
?:
string
):
C
public
getConfiguration
<
C
>
(
options
?:
IConfigurationOptions
):
C
public
getConfiguration
<
C
>
(
arg
?:
any
):
C
{
return
this
.
configuration
().
getValue
<
C
>
(
this
.
toOptions
(
arg
));
public
getConfiguration
<
C
>
(
section
?:
string
,
options
?:
IConfigurationOverrides
):
C
{
return
this
.
configuration
().
getValue
<
C
>
(
section
,
options
);
}
public
lookup
<
C
>
(
key
:
string
,
overrideIdentifier
?:
string
):
IConfigurationValue
<
C
>
{
...
...
@@ -93,16 +91,6 @@ export class ConfigurationService<T> extends Disposable implements IConfiguratio
this
.
_configuration
=
this
.
consolidateConfigurations
();
}
private
toOptions
(
arg
:
any
):
IConfigurationOptions
{
if
(
typeof
arg
===
'
string
'
)
{
return
{
section
:
arg
};
}
if
(
typeof
arg
===
'
object
'
)
{
return
arg
;
}
return
{};
}
private
consolidateConfigurations
():
Configuration
<
T
>
{
const
defaults
=
new
DefaultConfigurationModel
<
T
>
();
const
user
=
this
.
userConfigModelWatcher
.
getConfig
();
...
...
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
浏览文件 @
00400d8f
...
...
@@ -217,7 +217,7 @@ export class TextDiffEditor extends BaseTextEditor {
const
language
=
this
.
getLanguage
();
if
(
language
)
{
objects
.
assign
(
editorConfiguration
,
this
.
configurationService
.
getConfiguration
<
IEditorConfiguration
>
(
{
overrideIdentifier
:
language
,
section
:
'
diffEditor
'
}));
objects
.
assign
(
editorConfiguration
,
this
.
configurationService
.
getConfiguration
<
IEditorConfiguration
>
(
'
diffEditor
'
,
{
language
}));
}
return
editorConfiguration
;
...
...
src/vs/workbench/browser/parts/editor/textEditor.ts
浏览文件 @
00400d8f
...
...
@@ -119,7 +119,7 @@ export abstract class BaseTextEditor extends BaseEditor {
const
overrides
=
{};
const
resource
=
this
.
getResource
();
if
(
resource
)
{
objects
.
assign
(
overrides
,
this
.
configurationService
.
getConfiguration
<
IEditorConfiguration
>
(
{
/*resource: this.getResource(), */
overrideIdentifier
:
this
.
getLanguage
(),
section
:
'
editor
'
}));
objects
.
assign
(
overrides
,
this
.
configurationService
.
getConfiguration
<
IEditorConfiguration
>
(
'
editor
'
,
{
language
:
this
.
getLanguage
(),
/*resource: this.getResource(), */
}));
}
objects
.
assign
(
overrides
,
{
...
...
src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts
浏览文件 @
00400d8f
...
...
@@ -419,7 +419,7 @@ export class WalkThroughPart extends BaseEditor {
}
private
getEditorOptions
(
language
:
string
):
IEditorOptions
{
const
config
=
this
.
configurationService
.
getConfiguration
<
IEditorOptions
>
(
{
overrideIdentifier
:
language
,
section
:
'
editor
'
});
const
config
=
this
.
configurationService
.
getConfiguration
<
IEditorOptions
>
(
'
editor
'
,
{
language
});
return
{
...
isObject
(
config
)
?
config
:
Object
.
create
(
null
),
scrollBeyondLastLine
:
false
,
...
...
src/vs/workbench/services/configuration/node/configuration.ts
浏览文件 @
00400d8f
...
...
@@ -24,7 +24,7 @@ import { isLinux } from 'vs/base/common/platform';
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
CustomConfigurationModel
}
from
'
vs/platform/configuration/common/model
'
;
import
{
ScopedConfigurationModel
,
FolderConfigurationModel
,
FolderSettingsModel
}
from
'
vs/workbench/services/configuration/common/configurationModels
'
;
import
{
IConfigurationServiceEvent
,
ConfigurationSource
,
IConfigurationKeys
,
IConfigurationValue
,
ConfigurationModel
,
IConfigurationO
ption
s
,
Configuration
as
BaseConfiguration
,
IConfigurationValues
,
IConfigurationData
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationServiceEvent
,
ConfigurationSource
,
IConfigurationKeys
,
IConfigurationValue
,
ConfigurationModel
,
IConfigurationO
verride
s
,
Configuration
as
BaseConfiguration
,
IConfigurationValues
,
IConfigurationData
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkspaceConfigurationService
,
WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME
,
WORKSPACE_STANDALONE_CONFIGURATIONS
,
WORKSPACE_CONFIG_DEFAULT_PATH
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
ConfigurationService
as
GlobalConfigurationService
}
from
'
vs/platform/configuration/node/configurationService
'
;
import
{
createHash
}
from
"
crypto
"
;
...
...
@@ -201,10 +201,8 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
return
this
.
_configuration
;
}
public
getConfiguration
<
C
>
(
section
?:
string
):
C
public
getConfiguration
<
C
>
(
options
?:
IConfigurationOptions
):
C
public
getConfiguration
<
C
>
(
arg
?:
any
):
C
{
return
this
.
_configuration
.
getValue
<
C
>
(
this
.
toOptions
(
arg
));
public
getConfiguration
<
C
>
(
section
?:
string
,
overrides
?:
IConfigurationOverrides
):
C
{
return
this
.
_configuration
.
getValue
<
C
>
(
section
,
overrides
);
}
public
lookup
<
C
>
(
key
:
string
,
overrideIdentifier
?:
string
):
IConfigurationValue
<
C
>
{
...
...
@@ -310,16 +308,6 @@ export class WorkspaceConfigurationService extends Disposable implements IWorksp
private
trigger
(
source
:
ConfigurationSource
,
sourceConfig
:
any
=
this
.
_configuration
.
getFolderConfigurationModel
(
this
.
workspace
.
roots
[
0
]).
contents
):
void
{
this
.
_onDidUpdateConfiguration
.
fire
({
source
,
sourceConfig
});
}
private
toOptions
(
arg
:
any
):
IConfigurationOptions
{
if
(
typeof
arg
===
'
string
'
)
{
return
{
section
:
arg
};
}
if
(
typeof
arg
===
'
object
'
)
{
return
arg
;
}
return
{};
}
}
class
FolderConfiguration
<
T
>
extends
Disposable
{
...
...
@@ -539,9 +527,9 @@ class Configuration<T> extends BaseConfiguration<T> {
updateFolderConfiguration
(
resource
:
URI
,
configuration
:
FolderConfigurationModel
<
T
>
):
boolean
{
this
.
folders
.
set
(
resource
,
configuration
);
const
current
=
this
.
getValue
({
resource
});
const
current
=
this
.
getValue
(
null
,
{
resource
});
this
.
mergeFolder
(
resource
);
return
!
objects
.
equals
(
current
,
this
.
getValue
({
resource
}));
return
!
objects
.
equals
(
current
,
this
.
getValue
(
null
,
{
resource
}));
}
deleteFolderConfiguration
(
folder
:
URI
):
boolean
{
...
...
@@ -572,7 +560,7 @@ class Configuration<T> extends BaseConfiguration<T> {
}
for
(
const
resource
of
this
.
_foldersConsolidated
.
keys
())
{
if
(
!
objects
.
equals
(
this
.
getValue
(
{
resource
}),
other
.
getValue
(
{
resource
})))
{
if
(
!
objects
.
equals
(
this
.
getValue
(
null
,
{
resource
}),
other
.
getValue
(
null
,
{
resource
})))
{
return
false
;
}
}
...
...
src/vs/workbench/services/keybinding/common/keybindingEditing.ts
浏览文件 @
00400d8f
...
...
@@ -215,7 +215,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding
private
resolveModelReference
():
TPromise
<
IReference
<
ITextEditorModel
>>
{
return
this
.
fileService
.
existsFile
(
this
.
resource
)
.
then
(
exists
=>
{
const
EOL
=
this
.
configurationService
.
getConfiguration
(
{
section
:
'
files
'
,
overrideIdentifier
:
'
json
'
})[
'
eol
'
];
const
EOL
=
this
.
configurationService
.
getConfiguration
(
'
files
'
,
{
language
:
'
json
'
})[
'
eol
'
];
const
result
=
exists
?
TPromise
.
as
(
null
)
:
this
.
fileService
.
updateContent
(
this
.
resource
,
this
.
getEmptyContent
(
EOL
),
{
encoding
:
'
utf8
'
});
return
result
.
then
(()
=>
this
.
textModelResolverService
.
createModelReference
(
this
.
resource
));
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录