Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
6f033676
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,发现更多精彩内容 >>
提交
6f033676
编写于
11月 10, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#35996 Use getValue in ResourceConfigurationService
上级
e4af77b2
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
82 addition
and
55 deletion
+82
-55
src/vs/editor/common/services/editorWorkerServiceImpl.ts
src/vs/editor/common/services/editorWorkerServiceImpl.ts
+1
-1
src/vs/editor/common/services/resourceConfiguration.ts
src/vs/editor/common/services/resourceConfiguration.ts
+4
-4
src/vs/editor/common/services/resourceConfigurationImpl.ts
src/vs/editor/common/services/resourceConfigurationImpl.ts
+4
-4
src/vs/editor/standalone/browser/simpleServices.ts
src/vs/editor/standalone/browser/simpleServices.ts
+10
-4
src/vs/platform/configuration/common/configuration.ts
src/vs/platform/configuration/common/configuration.ts
+12
-1
src/vs/platform/configuration/common/configurationModels.ts
src/vs/platform/configuration/common/configurationModels.ts
+2
-2
src/vs/platform/configuration/node/configurationService.ts
src/vs/platform/configuration/node/configurationService.ts
+8
-2
src/vs/platform/configuration/test/common/testConfigurationService.ts
...orm/configuration/test/common/testConfigurationService.ts
+5
-2
src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts
.../telemetry/test/electron-browser/telemetryService.test.ts
+4
-2
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+2
-3
src/vs/workbench/browser/parts/editor/textEditor.ts
src/vs/workbench/browser/parts/editor/textEditor.ts
+3
-3
src/vs/workbench/common/editor/untitledEditorModel.ts
src/vs/workbench/common/editor/untitledEditorModel.ts
+3
-6
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
...bench/parts/codeEditor/electron-browser/toggleWordWrap.ts
+1
-1
src/vs/workbench/parts/output/browser/outputPanel.ts
src/vs/workbench/parts/output/browser/outputPanel.ts
+5
-3
src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts
...rminal/test/electron-browser/terminalConfigHelper.test.ts
+1
-1
src/vs/workbench/services/configuration/node/configurationService.ts
...bench/services/configuration/node/configurationService.ts
+8
-2
src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts
...onResolver/test/node/configurationResolverService.test.ts
+1
-1
src/vs/workbench/services/files/node/fileService.ts
src/vs/workbench/services/files/node/fileService.ts
+3
-7
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+5
-6
未找到文件。
src/vs/editor/common/services/editorWorkerServiceImpl.ts
浏览文件 @
6f033676
...
...
@@ -125,7 +125,7 @@ class WordBasedCompletionItemProvider implements modes.ISuggestSupport {
}
provideCompletionItems
(
model
:
editorCommon
.
IModel
,
position
:
Position
):
TPromise
<
modes
.
ISuggestResult
>
{
const
{
wordBasedSuggestions
}
=
this
.
_configurationService
.
get
Configuration
<
IEditorOptions
>
(
model
.
uri
,
position
,
'
editor
'
);
const
{
wordBasedSuggestions
}
=
this
.
_configurationService
.
get
Value
<
IEditorOptions
>
(
model
.
uri
,
position
,
'
editor
'
);
if
(
!
wordBasedSuggestions
)
{
return
undefined
;
}
...
...
src/vs/editor/common/services/resourceConfiguration.ts
浏览文件 @
6f033676
...
...
@@ -21,15 +21,15 @@ export interface ITextResourceConfigurationService {
onDidChangeConfiguration
:
Event
<
IConfigurationChangeEvent
>
;
/**
* Fetches the
appropriate section of the for the given resource with appropriate overrides (e.g. language)
.
*
This will be
an object keyed off the section name.
* Fetches the
value of the section for the given resource by applying language overrides
.
*
Value can be of native type or
an object keyed off the section name.
*
* @param resource - Resource for which the configuration has to be fetched. Can be `null` or `undefined`.
* @param postion - Position in the resource for which configuration has to be fetched. Can be `null` or `undefined`.
* @param section - Section of the configuraion. Can be `null` or `undefined`.
*
*/
get
Configuration
<
T
>
(
resource
:
URI
,
section
?:
string
):
T
;
get
Configuration
<
T
>
(
resource
:
URI
,
position
?:
IPosition
,
section
?:
string
):
T
;
get
Value
<
T
>
(
resource
:
URI
,
section
?:
string
):
T
;
get
Value
<
T
>
(
resource
:
URI
,
position
?:
IPosition
,
section
?:
string
):
T
;
}
\ No newline at end of file
src/vs/editor/common/services/resourceConfigurationImpl.ts
浏览文件 @
6f033676
...
...
@@ -28,13 +28,13 @@ export class TextResourceConfigurationService extends Disposable implements ITex
this
.
_register
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
this
.
_onDidChangeConfiguration
.
fire
(
e
)));
}
get
Configuration
<
T
>
(
resource
:
URI
,
section
?:
string
):
T
;
get
Configuration
<
T
>
(
resource
:
URI
,
at
?:
IPosition
,
section
?:
string
):
T
;
get
Configuration
<
T
>
(
resource
:
URI
,
arg2
?:
any
,
arg3
?:
any
):
T
{
get
Value
<
T
>
(
resource
:
URI
,
section
?:
string
):
T
;
get
Value
<
T
>
(
resource
:
URI
,
at
?:
IPosition
,
section
?:
string
):
T
;
get
Value
<
T
>
(
resource
:
URI
,
arg2
?:
any
,
arg3
?:
any
):
T
{
const
position
:
IPosition
=
Position
.
isIPosition
(
arg2
)
?
arg2
:
null
;
const
section
:
string
=
position
?
(
typeof
arg3
===
'
string
'
?
arg3
:
void
0
)
:
(
typeof
arg2
===
'
string
'
?
arg2
:
void
0
);
const
language
=
resource
?
this
.
getLanguage
(
resource
,
position
)
:
void
0
;
return
this
.
configurationService
.
get
Configuration
<
T
>
(
section
,
{
resource
,
overrideIdentifier
:
language
});
return
this
.
configurationService
.
get
Value
<
T
>
(
section
,
{
resource
,
overrideIdentifier
:
language
});
}
private
getLanguage
(
resource
:
URI
,
position
:
IPosition
):
string
{
...
...
src/vs/editor/standalone/browser/simpleServices.ts
浏览文件 @
6f033676
...
...
@@ -468,8 +468,14 @@ export class SimpleConfigurationService implements IConfigurationService {
return
this
.
configuration
().
getSection
(
section
,
overrides
,
null
);
}
public
getValue
<
C
>
(
key
:
string
,
options
:
IConfigurationOverrides
=
{}):
C
{
return
this
.
configuration
().
getValue
(
key
,
options
,
null
);
getValue
<
T
>
():
T
;
getValue
<
T
>
(
section
:
string
):
T
;
getValue
<
T
>
(
overrides
:
IConfigurationOverrides
):
T
;
getValue
<
T
>
(
section
:
string
,
overrides
:
IConfigurationOverrides
):
T
;
getValue
(
arg1
?:
any
,
arg2
?:
any
):
any
{
const
section
=
typeof
arg1
===
'
string
'
?
arg1
:
void
0
;
const
overrides
=
isConfigurationOverrides
(
arg1
)
?
arg1
:
isConfigurationOverrides
(
arg2
)
?
arg2
:
{};
return
this
.
configuration
().
getValue
(
section
,
overrides
,
null
);
}
public
updateValue
(
key
:
string
,
value
:
any
,
arg3
?:
any
,
arg4
?:
any
):
TPromise
<
void
>
{
...
...
@@ -512,8 +518,8 @@ export class SimpleResourceConfigurationService implements ITextResourceConfigur
});
}
public
get
Configuration
<
T
>
():
T
{
return
this
.
configurationService
.
get
Configuration
<
T
>
();
public
get
Value
<
T
>
():
T
{
return
this
.
configurationService
.
get
Value
<
T
>
();
}
}
...
...
src/vs/platform/configuration/common/configuration.ts
浏览文件 @
6f033676
...
...
@@ -62,7 +62,18 @@ export interface IConfigurationService {
getConfiguration
<
T
>
(
overrides
:
IConfigurationOverrides
):
T
;
getConfiguration
<
T
>
(
section
:
string
,
overrides
:
IConfigurationOverrides
):
T
;
getValue
<
T
>
(
key
:
string
,
overrides
?:
IConfigurationOverrides
):
T
;
/**
* Fetches the value of the section for the given overrides.
* Value can be of native type or an object keyed off the section name.
*
* @param section - Section of the configuraion. Can be `null` or `undefined`.
* @param overrides - Overrides that has to be applied while fetching
*
*/
getValue
<
T
>
():
T
;
getValue
<
T
>
(
section
:
string
):
T
;
getValue
<
T
>
(
overrides
:
IConfigurationOverrides
):
T
;
getValue
<
T
>
(
section
:
string
,
overrides
:
IConfigurationOverrides
):
T
;
updateValue
(
key
:
string
,
value
:
any
):
TPromise
<
void
>
;
updateValue
(
key
:
string
,
value
:
any
,
overrides
:
IConfigurationOverrides
):
TPromise
<
void
>
;
...
...
src/vs/platform/configuration/common/configurationModels.ts
浏览文件 @
6f033676
...
...
@@ -303,9 +303,9 @@ export class Configuration {
return
section
?
configModel
.
getSectionContents
<
C
>
(
section
)
:
configModel
.
contents
;
}
getValue
(
key
:
string
,
overrides
:
IConfigurationOverrides
,
workspace
:
Workspace
):
any
{
getValue
(
section
:
string
,
overrides
:
IConfigurationOverrides
,
workspace
:
Workspace
):
any
{
const
consolidateConfigurationModel
=
this
.
getConsolidateConfigurationModel
(
overrides
,
workspace
);
return
getConfigurationValue
<
any
>
(
consolidateConfigurationModel
.
contents
,
key
)
;
return
section
?
getConfigurationValue
<
any
>
(
consolidateConfigurationModel
.
contents
,
section
)
:
consolidateConfigurationModel
.
contents
;
}
updateValue
(
key
:
string
,
value
:
any
,
overrides
:
IConfigurationOverrides
=
{}):
void
{
...
...
src/vs/platform/configuration/node/configurationService.ts
浏览文件 @
6f033676
...
...
@@ -58,8 +58,14 @@ export class ConfigurationService extends Disposable implements IConfigurationSe
return
this
.
configuration
.
getSection
(
section
,
overrides
,
null
);
}
getValue
(
key
:
string
,
overrides
:
IConfigurationOverrides
=
{}):
any
{
return
this
.
configuration
.
getValue
(
key
,
overrides
,
null
);
getValue
<
T
>
():
T
;
getValue
<
T
>
(
section
:
string
):
T
;
getValue
<
T
>
(
overrides
:
IConfigurationOverrides
):
T
;
getValue
<
T
>
(
section
:
string
,
overrides
:
IConfigurationOverrides
):
T
;
getValue
(
arg1
?:
any
,
arg2
?:
any
):
any
{
const
section
=
typeof
arg1
===
'
string
'
?
arg1
:
void
0
;
const
overrides
=
isConfigurationOverrides
(
arg1
)
?
arg1
:
isConfigurationOverrides
(
arg2
)
?
arg2
:
{};
return
this
.
configuration
.
getValue
(
section
,
overrides
,
null
);
}
updateValue
(
key
:
string
,
value
:
any
):
TPromise
<
void
>
;
...
...
src/vs/platform/configuration/test/common/testConfigurationService.ts
浏览文件 @
6f033676
...
...
@@ -32,8 +32,11 @@ export class TestConfigurationService extends EventEmitter implements IConfigura
return
this
.
configuration
;
}
public
getValue
(
key
:
string
,
overrides
?:
IConfigurationOverrides
):
any
{
return
this
.
inspect
(
key
).
value
;
public
getValue
(
arg1
?:
any
,
arg2
?:
any
):
any
{
if
(
arg1
&&
typeof
arg1
===
'
string
'
)
{
return
this
.
inspect
(
<
string
>
arg1
).
value
;
}
return
this
.
getConfiguration
(
arg1
,
arg2
);
}
public
updateValue
(
key
:
string
,
overrides
?:
IConfigurationOverrides
):
TPromise
<
void
>
{
...
...
src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts
浏览文件 @
6f033676
...
...
@@ -681,8 +681,10 @@ suite('TelemetryService', () => {
enableTelemetry
:
enableTelemetry
}
as
any
;
},
getValue
(
key
)
{
return
getConfigurationValue
(
this
.
getConfiguration
(),
key
);
getValue
()
{
return
{
enableTelemetry
:
enableTelemetry
}
as
any
;
},
updateValue
():
TPromise
<
void
>
{
return
null
;
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
6f033676
...
...
@@ -33,7 +33,7 @@ import { IEditor as IBaseEditor, IEditorInput } from 'vs/platform/editor/common/
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IQuickOpenService
,
IPickOpenEntry
,
IFilePickOpenEntry
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
IWorkspaceConfigurationService
}
from
'
vs/workbench/services/configuration/common/configuration
'
;
import
{
SUPPORTED_ENCODINGS
,
IFileService
,
IFilesConfiguration
,
FILES_ASSOCIATIONS_CONFIG
}
from
'
vs/platform/files/common/files
'
;
import
{
SUPPORTED_ENCODINGS
,
IFileService
,
FILES_ASSOCIATIONS_CONFIG
}
from
'
vs/platform/files/common/files
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
...
...
@@ -1159,8 +1159,7 @@ export class ChangeEncodingAction extends Action {
.
then
((
guessedEncoding
:
string
)
=>
{
const
isReopenWithEncoding
=
(
action
===
reopenWithEncodingPick
);
const
config
=
this
.
textResourceConfigurationService
.
getConfiguration
(
resource
)
as
IFilesConfiguration
;
const
configuredEncoding
=
config
&&
config
.
files
&&
config
.
files
.
encoding
;
const
configuredEncoding
=
this
.
textResourceConfigurationService
.
getValue
(
resource
,
'
files.encoding
'
);
let
directMatchIndex
:
number
;
let
aliasMatchIndex
:
number
;
...
...
src/vs/workbench/browser/parts/editor/textEditor.ts
浏览文件 @
6f033676
...
...
@@ -59,7 +59,7 @@ export abstract class BaseTextEditor extends BaseEditor {
)
{
super
(
id
,
telemetryService
,
themeService
);
this
.
toUnbind
.
push
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
this
.
handleConfigurationChangeEvent
(
this
.
configurationService
.
get
Configuration
<
IEditorConfiguration
>
(
this
.
getResource
()))));
this
.
toUnbind
.
push
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
this
.
handleConfigurationChangeEvent
(
this
.
configurationService
.
get
Value
<
IEditorConfiguration
>
(
this
.
getResource
()))));
}
protected
get
instantiationService
():
IInstantiationService
{
...
...
@@ -127,7 +127,7 @@ export abstract class BaseTextEditor extends BaseEditor {
// Editor for Text
this
.
_editorContainer
=
parent
;
this
.
editorControl
=
this
.
createEditorControl
(
parent
,
this
.
computeConfiguration
(
this
.
configurationService
.
get
Configuration
<
IEditorConfiguration
>
(
this
.
getResource
())));
this
.
editorControl
=
this
.
createEditorControl
(
parent
,
this
.
computeConfiguration
(
this
.
configurationService
.
get
Value
<
IEditorConfiguration
>
(
this
.
getResource
())));
// Model & Language changes
const
codeEditor
=
getCodeEditor
(
this
);
...
...
@@ -280,7 +280,7 @@ export abstract class BaseTextEditor extends BaseEditor {
return
null
;
}
private
updateEditorConfiguration
(
configuration
=
this
.
configurationService
.
get
Configuration
<
IEditorConfiguration
>
(
this
.
getResource
())):
void
{
private
updateEditorConfiguration
(
configuration
=
this
.
configurationService
.
get
Value
<
IEditorConfiguration
>
(
this
.
getResource
())):
void
{
if
(
!
this
.
editorControl
)
{
return
;
}
...
...
src/vs/workbench/common/editor/untitledEditorModel.ts
浏览文件 @
6f033676
...
...
@@ -11,7 +11,7 @@ import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'
import
URI
from
'
vs/base/common/uri
'
;
import
{
PLAINTEXT_MODE_ID
}
from
'
vs/editor/common/modes/modesRegistry
'
;
import
{
EndOfLinePreference
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IFilesConfiguration
,
CONTENT_CHANGE_EVENT_BUFFER_DELAY
}
from
'
vs/platform/files/common/files
'
;
import
{
CONTENT_CHANGE_EVENT_BUFFER_DELAY
}
from
'
vs/platform/files/common/files
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IMode
}
from
'
vs/editor/common/modes
'
;
...
...
@@ -98,8 +98,7 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin
}
private
onConfigurationChange
():
void
{
const
configuration
=
this
.
configurationService
.
getConfiguration
<
IFilesConfiguration
>
(
this
.
resource
);
const
configuredEncoding
=
configuration
&&
configuration
.
files
&&
configuration
.
files
.
encoding
;
const
configuredEncoding
=
this
.
configurationService
.
getValue
<
string
>
(
this
.
resource
,
'
files.encoding
'
);
if
(
this
.
configuredEncoding
!==
configuredEncoding
)
{
this
.
configuredEncoding
=
configuredEncoding
;
...
...
@@ -185,10 +184,8 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin
this
.
setDirty
(
this
.
hasAssociatedFilePath
||
!!
backupContent
);
return
this
.
doLoad
(
backupContent
||
this
.
initialValue
||
''
).
then
(
model
=>
{
const
configuration
=
this
.
configurationService
.
getConfiguration
<
IFilesConfiguration
>
(
this
.
resource
);
// Encoding
this
.
configuredEncoding
=
configuration
&&
configuration
.
files
&&
configuration
.
files
.
encoding
;
this
.
configuredEncoding
=
this
.
configurationService
.
getValue
<
string
>
(
this
.
resource
,
'
files.encoding
'
)
;
// Listen to content changes
this
.
toDispose
.
push
(
this
.
textEditorModel
.
onDidChangeContent
(()
=>
this
.
onModelContentChanged
()));
...
...
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
浏览文件 @
6f033676
...
...
@@ -54,7 +54,7 @@ function readTransientState(model: IModel, codeEditorService: ICodeEditorService
}
function
readWordWrapState
(
model
:
IModel
,
configurationService
:
ITextResourceConfigurationService
,
codeEditorService
:
ICodeEditorService
):
IWordWrapState
{
const
editorConfig
=
configurationService
.
get
Configuration
(
model
.
uri
,
'
editor
'
)
as
{
wordWrap
:
'
on
'
|
'
off
'
|
'
wordWrapColumn
'
|
'
bounded
'
;
wordWrapMinified
:
boolean
};
const
editorConfig
=
configurationService
.
get
Value
(
model
.
uri
,
'
editor
'
)
as
{
wordWrap
:
'
on
'
|
'
off
'
|
'
wordWrapColumn
'
|
'
bounded
'
;
wordWrapMinified
:
boolean
};
let
_configuredWordWrap
=
editorConfig
&&
(
typeof
editorConfig
.
wordWrap
===
'
string
'
||
typeof
editorConfig
.
wordWrap
===
'
boolean
'
)
?
editorConfig
.
wordWrap
:
void
0
;
// Compatibility with old true or false values
...
...
src/vs/workbench/parts/output/browser/outputPanel.ts
浏览文件 @
6f033676
...
...
@@ -23,6 +23,7 @@ import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOu
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IEditorGroupService
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
export
class
OutputPanel
extends
TextResourceEditor
{
private
actions
:
IAction
[];
...
...
@@ -32,14 +33,15 @@ export class OutputPanel extends TextResourceEditor {
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IStorageService
storageService
:
IStorageService
,
@
ITextResourceConfigurationService
configurationService
:
ITextResourceConfigurationService
,
@
IConfigurationService
private
baseConfigurationService
:
IConfigurationService
,
@
ITextResourceConfigurationService
textResourceConfigurationService
:
ITextResourceConfigurationService
,
@
IThemeService
themeService
:
IThemeService
,
@
IOutputService
private
outputService
:
IOutputService
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
@
IEditorGroupService
editorGroupService
:
IEditorGroupService
,
@
ITextFileService
textFileService
:
ITextFileService
)
{
super
(
telemetryService
,
instantiationService
,
storageService
,
c
onfigurationService
,
themeService
,
editorGroupService
,
textFileService
);
super
(
telemetryService
,
instantiationService
,
storageService
,
textResourceC
onfigurationService
,
themeService
,
editorGroupService
,
textFileService
);
this
.
scopedInstantiationService
=
instantiationService
;
}
...
...
@@ -84,7 +86,7 @@ export class OutputPanel extends TextResourceEditor {
options
.
renderLineHighlight
=
'
none
'
;
options
.
minimap
=
{
enabled
:
false
};
const
outputConfig
=
this
.
configurationService
.
getConfiguration
(
null
,
'
[Log]
'
);
const
outputConfig
=
this
.
baseConfigurationService
.
getValue
(
'
[Log]
'
);
if
(
outputConfig
&&
outputConfig
[
'
editor.minimap.enabled
'
])
{
options
.
minimap
=
{
enabled
:
true
};
}
...
...
src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts
浏览文件 @
6f033676
...
...
@@ -19,7 +19,7 @@ class MockConfigurationService implements IConfigurationService {
public
inspect
<
T
>
(
key
:
string
,
overrides
?:
IConfigurationOverrides
):
any
{
return
{
value
:
getConfigurationValue
<
T
>
(
this
.
getConfiguration
(),
key
),
default
:
getConfigurationValue
<
T
>
(
this
.
getConfiguration
(),
key
),
user
:
getConfigurationValue
<
T
>
(
this
.
getConfiguration
(),
key
),
workspace
:
void
0
,
workspaceFolder
:
void
0
};
}
public
keys
()
{
return
{
default
:
[]
as
string
[],
user
:
[]
as
string
[],
workspace
:
[]
as
string
[],
workspaceFolder
:
[]
as
string
[]
};
}
public
getConfiguration
():
any
{
return
this
.
configuration
;
}
public
getValue
<
T
>
(
key
:
string
,
overrides
?:
IConfigurationOverrides
):
T
{
return
getConfigurationValue
<
T
>
(
this
.
getConfiguration
(),
key
)
;
}
public
getValue
():
any
{
return
this
.
configuration
;
}
public
updateValue
():
TPromise
<
void
>
{
return
null
;
}
public
getConfigurationData
():
any
{
return
null
;
}
public
onDidChangeConfiguration
()
{
return
{
dispose
()
{
}
};
}
...
...
src/vs/workbench/services/configuration/node/configurationService.ts
浏览文件 @
6f033676
...
...
@@ -235,8 +235,14 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
return
this
.
_configuration
.
getSection
(
section
,
overrides
);
}
getValue
<
T
>
(
key
:
string
,
overrides
?:
IConfigurationOverrides
):
T
{
return
this
.
_configuration
.
getValue
(
key
,
overrides
);
getValue
<
T
>
():
T
;
getValue
<
T
>
(
section
:
string
):
T
;
getValue
<
T
>
(
overrides
:
IConfigurationOverrides
):
T
;
getValue
<
T
>
(
section
:
string
,
overrides
:
IConfigurationOverrides
):
T
;
getValue
(
arg1
?:
any
,
arg2
?:
any
):
any
{
const
section
=
typeof
arg1
===
'
string
'
?
arg1
:
void
0
;
const
overrides
=
isConfigurationOverrides
(
arg1
)
?
arg1
:
isConfigurationOverrides
(
arg2
)
?
arg2
:
void
0
;
return
this
.
_configuration
.
getValue
(
section
,
overrides
);
}
updateValue
(
key
:
string
,
value
:
any
):
TPromise
<
void
>
;
...
...
src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts
浏览文件 @
6f033676
...
...
@@ -351,7 +351,7 @@ class MockConfigurationService implements IConfigurationService {
public
inspect
<
T
>
(
key
:
string
,
overrides
?:
IConfigurationOverrides
):
any
{
return
{
value
:
getConfigurationValue
<
T
>
(
this
.
getConfiguration
(),
key
),
default
:
getConfigurationValue
<
T
>
(
this
.
getConfiguration
(),
key
),
user
:
getConfigurationValue
<
T
>
(
this
.
getConfiguration
(),
key
),
workspaceFolder
:
void
0
,
folder
:
void
0
};
}
public
keys
()
{
return
{
default
:
[],
user
:
[],
workspace
:
[],
workspaceFolder
:
[]
};
}
public
getConfiguration
():
any
{
return
this
.
configuration
;
}
public
getValue
(
key
:
string
):
any
{
return
getConfigurationValue
<
any
>
(
this
.
getConfiguration
(),
key
)
;
}
public
getValue
(
):
any
{
return
this
.
configuration
;
}
public
updateValue
():
TPromise
<
void
>
{
return
null
;
}
public
getConfigurationData
():
any
{
return
null
;
}
public
onDidChangeConfiguration
()
{
return
{
dispose
()
{
}
};
}
...
...
src/vs/workbench/services/files/node/fileService.ts
浏览文件 @
6f033676
...
...
@@ -11,7 +11,7 @@ import os = require('os');
import
crypto
=
require
(
'
crypto
'
);
import
assert
=
require
(
'
assert
'
);
import
{
isParent
,
FileOperation
,
FileOperationEvent
,
IContent
,
IFileService
,
IResolveFileOptions
,
IResolveFileResult
,
IResolveContentOptions
,
IFileStat
,
IStreamContent
,
FileOperationError
,
FileOperationResult
,
IUpdateContentOptions
,
FileChangeType
,
IImportResult
,
MAX_FILE_SIZE
,
FileChangesEvent
,
I
FilesConfiguration
,
I
CreateFileOptions
}
from
'
vs/platform/files/common/files
'
;
import
{
isParent
,
FileOperation
,
FileOperationEvent
,
IContent
,
IFileService
,
IResolveFileOptions
,
IResolveFileResult
,
IResolveContentOptions
,
IFileStat
,
IStreamContent
,
FileOperationError
,
FileOperationResult
,
IUpdateContentOptions
,
FileChangeType
,
IImportResult
,
MAX_FILE_SIZE
,
FileChangesEvent
,
ICreateFileOptions
}
from
'
vs/platform/files/common/files
'
;
import
{
isEqualOrParent
}
from
'
vs/base/common/paths
'
;
import
{
ResourceMap
}
from
'
vs/base/common/map
'
;
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
...
...
@@ -643,15 +643,11 @@ export class FileService implements IFileService {
}
private
configuredAutoGuessEncoding
(
resource
:
uri
):
boolean
{
const
config
=
this
.
textResourceConfigurationService
.
getConfiguration
(
resource
)
as
IFilesConfiguration
;
return
config
&&
config
.
files
&&
config
.
files
.
autoGuessEncoding
===
true
;
return
this
.
textResourceConfigurationService
.
getValue
(
resource
,
'
files.autoGuessEncoding
'
);
}
private
configuredEncoding
(
resource
:
uri
):
string
{
const
config
=
this
.
textResourceConfigurationService
.
getConfiguration
(
resource
)
as
IFilesConfiguration
;
return
config
&&
config
.
files
&&
config
.
files
.
encoding
;
return
this
.
textResourceConfigurationService
.
getValue
(
resource
,
'
files.encoding
'
);
}
private
getEncodingOverride
(
resource
:
uri
):
string
{
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
6f033676
...
...
@@ -57,7 +57,7 @@ import { TestThemeService } from 'vs/platform/theme/test/common/testThemeService
import
{
IWorkspaceIdentifier
,
ISingleFolderWorkspaceIdentifier
,
isSingleFolderWorkspaceIdentifier
,
IWorkspaceFolderCreationData
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IRecentlyOpened
}
from
'
vs/platform/history/common/history
'
;
import
{
ITextResourceConfigurationService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
IPosition
,
Position
as
EditorPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
ICommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
import
{
notImplemented
}
from
'
vs/base/common/errors
'
;
...
...
@@ -1229,11 +1229,10 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig
return
{
dispose
()
{
}
};
}
public
getConfiguration
(
resource
:
URI
,
section
?:
string
):
any
;
public
getConfiguration
(
resource
:
URI
,
position
?:
IPosition
,
section
?:
string
):
any
;
public
getConfiguration
(
resource
:
any
,
position
?:
any
,
section
?:
any
):
any
;
public
getConfiguration
(
resource
:
any
,
position
?:
any
,
section
?:
any
):
any
{
return
this
.
configurationService
.
getConfiguration
(
section
,
{
resource
});
getValue
<
T
>
(
resource
:
URI
,
arg2
?:
any
,
arg3
?:
any
):
T
{
const
position
:
IPosition
=
EditorPosition
.
isIPosition
(
arg2
)
?
arg2
:
null
;
const
section
:
string
=
position
?
(
typeof
arg3
===
'
string
'
?
arg3
:
void
0
)
:
(
typeof
arg2
===
'
string
'
?
arg2
:
void
0
);
return
this
.
configurationService
.
getValue
(
section
,
{
resource
});
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录