Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b3316577
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,发现更多精彩内容 >>
提交
b3316577
编写于
6月 21, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
multi root - adopt more folder specific settings
上级
a49a4268
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
51 addition
and
49 deletion
+51
-49
src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts
...rkbench/api/electron-browser/mainThreadSaveParticipant.ts
+1
-1
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+7
-9
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
...bench/parts/codeEditor/electron-browser/toggleWordWrap.ts
+9
-8
src/vs/workbench/parts/files/browser/files.contribution.ts
src/vs/workbench/parts/files/browser/files.contribution.ts
+2
-14
src/vs/workbench/services/backup/test/node/backupFileService.test.ts
...bench/services/backup/test/node/backupFileService.test.ts
+2
-1
src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts
...nfiguration/test/node/configurationEditingService.test.ts
+2
-1
src/vs/workbench/services/files/electron-browser/fileService.ts
.../workbench/services/files/electron-browser/fileService.ts
+1
-3
src/vs/workbench/services/files/node/fileService.ts
src/vs/workbench/services/files/node/fileService.ts
+18
-7
src/vs/workbench/services/files/test/node/fileService.test.ts
...vs/workbench/services/files/test/node/fileService.test.ts
+7
-4
src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts
...h/services/keybinding/test/node/keybindingEditing.test.ts
+2
-1
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts
浏览文件 @
b3316577
...
...
@@ -142,7 +142,7 @@ class FormatOnSaveParticipant implements INamedSaveParticpant {
const
model
=
editorModel
.
textEditorModel
;
if
(
env
.
reason
===
SaveReason
.
AUTO
||
!
this
.
_configurationService
.
lookup
(
'
editor.formatOnSave
'
,
model
.
getLanguageIdentifier
().
language
).
value
)
{
||
!
this
.
_configurationService
.
lookup
(
'
editor.formatOnSave
'
,
{
overrideIdentifier
:
model
.
getLanguageIdentifier
().
language
,
resource
:
editorModel
.
getResource
()
}
).
value
)
{
return
undefined
;
}
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
b3316577
...
...
@@ -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
{
IFilesConfiguration
,
SUPPORTED_ENCODINGS
,
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
SUPPORTED_ENCODINGS
,
IFileService
}
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
'
;
...
...
@@ -1099,20 +1099,18 @@ export class ChangeEncodingAction extends Action {
return
undefined
;
}
const
resource
=
toResource
(
activeEditor
.
input
,
{
filter
:
'
file
'
,
supportSideBySide
:
true
});
if
(
!
resource
)
{
return
TPromise
.
as
(
null
);
}
return
TPromise
.
timeout
(
50
/* quick open is sensitive to being opened so soon after another */
)
.
then
(()
=>
{
const
resource
=
toResource
(
activeEditor
.
input
,
{
filter
:
'
file
'
,
supportSideBySide
:
true
});
if
(
!
resource
)
{
return
TPromise
.
as
(
null
);
}
return
this
.
fileService
.
resolveContent
(
resource
,
{
autoGuessEncoding
:
true
,
acceptTextOnly
:
true
}).
then
(
content
=>
content
.
encoding
,
err
=>
null
);
})
.
then
((
guessedEncoding
:
string
)
=>
{
const
configuration
=
this
.
configurationService
.
getConfiguration
<
IFilesConfiguration
>
();
const
isReopenWithEncoding
=
(
action
===
reopenWithEncodingPick
);
const
configuredEncoding
=
configuration
&&
configuration
.
files
&&
configuration
.
files
.
encoding
;
const
configuredEncoding
=
this
.
configurationService
.
lookup
(
'
files.encoding
'
,
{
resource
}).
value
;
let
directMatchIndex
:
number
;
let
aliasMatchIndex
:
number
;
...
...
src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts
浏览文件 @
b3316577
...
...
@@ -10,7 +10,6 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import
{
ICommonCodeEditor
,
IEditorContribution
,
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
editorAction
,
ServicesAccessor
,
EditorAction
,
commonEditorContribution
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/common/services/codeEditorService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
MenuRegistry
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ContextKeyExpr
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -18,6 +17,7 @@ import { IMessageService } from 'vs/platform/message/common/message';
import
Severity
from
'
vs/base/common/severity
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
InternalEditorOptions
,
EDITOR_DEFAULTS
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
ITextResourceConfigurationService
}
from
"
vs/editor/common/services/resourceConfiguration
"
;
const
transientWordWrapState
=
'
transientWordWrapState
'
;
const
isWordWrapMinifiedKey
=
'
isWordWrapMinified
'
;
...
...
@@ -52,8 +52,9 @@ function readTransientState(model: IModel, codeEditorService: ICodeEditorService
return
codeEditorService
.
getTransientModelProperty
(
model
,
transientWordWrapState
);
}
function
readWordWrapState
(
model
:
IModel
,
configurationService
:
IConfigurationService
,
codeEditorService
:
ICodeEditorService
):
IWordWrapState
{
let
_configuredWordWrap
=
configurationService
.
lookup
<
'
on
'
|
'
off
'
|
'
wordWrapColumn
'
|
'
bounded
'
>
(
'
editor.wordWrap
'
,
model
.
getLanguageIdentifier
().
language
).
value
;
function
readWordWrapState
(
model
:
IModel
,
configurationService
:
ITextResourceConfigurationService
,
codeEditorService
:
ICodeEditorService
):
IWordWrapState
{
const
editorConfig
=
configurationService
.
getConfiguration
(
model
.
uri
,
'
editor
'
)
as
{
wordWrap
:
'
on
'
|
'
off
'
|
'
wordWrapColumn
'
|
'
bounded
'
;
wordWrapMinified
:
boolean
};
let
_configuredWordWrap
=
editorConfig
&&
typeof
editorConfig
.
wordWrap
===
'
string
'
?
editorConfig
.
wordWrap
:
void
0
;
// Compatibility with old true or false values
if
(
<
any
>
_configuredWordWrap
===
true
)
{
...
...
@@ -62,11 +63,11 @@ function readWordWrapState(model: IModel, configurationService: IConfigurationSe
_configuredWordWrap
=
'
off
'
;
}
const
_configuredWordWrapMinified
=
configurationService
.
lookup
<
boolean
>
(
'
editor.wordWrapMinified
'
,
model
.
getLanguageIdentifier
().
language
)
;
const
_configuredWordWrapMinified
=
editorConfig
&&
typeof
editorConfig
.
wordWrapMinified
===
'
boolean
'
?
editorConfig
.
wordWrapMinified
:
void
0
;
const
_transientState
=
readTransientState
(
model
,
codeEditorService
);
return
{
configuredWordWrap
:
_configuredWordWrap
,
configuredWordWrapMinified
:
(
typeof
_configuredWordWrapMinified
.
value
===
'
undefined
'
?
EDITOR_DEFAULTS
.
wordWrapMinified
:
_configuredWordWrapMinified
.
value
),
configuredWordWrapMinified
:
(
typeof
_configuredWordWrapMinified
===
'
boolean
'
?
_configuredWordWrapMinified
:
EDITOR_DEFAULTS
.
wordWrapMinified
),
transientState
:
_transientState
};
}
...
...
@@ -154,7 +155,7 @@ class ToggleWordWrapAction extends EditorAction {
return
;
}
const
configurationService
=
accessor
.
get
(
I
ConfigurationService
);
const
textResourceConfigurationService
=
accessor
.
get
(
ITextResource
ConfigurationService
);
const
codeEditorService
=
accessor
.
get
(
ICodeEditorService
);
const
model
=
editor
.
getModel
();
...
...
@@ -163,7 +164,7 @@ class ToggleWordWrapAction extends EditorAction {
}
// Read the current state
const
currentState
=
readWordWrapState
(
model
,
c
onfigurationService
,
codeEditorService
);
const
currentState
=
readWordWrapState
(
model
,
textResourceC
onfigurationService
,
codeEditorService
);
// Compute the new state
const
newState
=
toggleWordWrap
(
editor
,
currentState
);
// Write the new state
...
...
@@ -181,7 +182,7 @@ class ToggleWordWrapController extends Disposable implements IEditorContribution
constructor
(
private
readonly
editor
:
ICommonCodeEditor
,
@
IContextKeyService
readonly
contextKeyService
:
IContextKeyService
,
@
I
ConfigurationService
readonly
configurationService
:
I
ConfigurationService
,
@
I
TextResourceConfigurationService
readonly
configurationService
:
ITextResource
ConfigurationService
,
@
ICodeEditorService
readonly
codeEditorService
:
ICodeEditorService
)
{
super
();
...
...
src/vs/workbench/parts/files/browser/files.contribution.ts
浏览文件 @
b3316577
...
...
@@ -14,7 +14,7 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/common/actionRegistry
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
IEditorRegistry
,
Extensions
as
EditorExtensions
,
IEditorInputFactory
,
EditorInput
,
IFileEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
AutoSaveConfiguration
,
HotExitConfiguration
,
SUPPORTED_ENCODINGS
,
IFilesConfiguration
}
from
'
vs/platform/files/common/files
'
;
import
{
AutoSaveConfiguration
,
HotExitConfiguration
,
SUPPORTED_ENCODINGS
}
from
'
vs/platform/files/common/files
'
;
import
{
EditorDescriptor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
FILE_EDITOR_INPUT_ID
,
VIEWLET_ID
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
FileEditorTracker
}
from
'
vs/workbench/parts/files/common/editors/fileEditorTracker
'
;
...
...
@@ -111,22 +111,10 @@ interface ISerializedFileInput {
// Register Editor Input Factory
class
FileEditorInputFactory
implements
IEditorInputFactory
{
private
configuredEncoding
:
string
;
constructor
(
@
IWorkspaceConfigurationService
private
configurationService
:
IWorkspaceConfigurationService
)
{
this
.
onConfiguration
(
configurationService
.
getConfiguration
<
IFilesConfiguration
>
());
this
.
registerListeners
();
}
private
registerListeners
():
void
{
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
this
.
onConfiguration
(
this
.
configurationService
.
getConfiguration
<
IFilesConfiguration
>
()));
}
private
onConfiguration
(
config
:
IFilesConfiguration
):
void
{
this
.
configuredEncoding
=
config
.
files
&&
config
.
files
.
encoding
;
}
public
serialize
(
editorInput
:
EditorInput
):
string
{
...
...
@@ -138,7 +126,7 @@ class FileEditorInputFactory implements IEditorInputFactory {
};
const
encoding
=
fileEditorInput
.
getPreferredEncoding
();
if
(
encoding
&&
encoding
!==
this
.
configur
edEncoding
)
{
if
(
encoding
&&
encoding
!==
this
.
configur
ationService
.
lookup
(
'
files.encoding
'
,
{
resource
}).
value
)
{
fileInput
.
encoding
=
encoding
;
}
...
...
src/vs/workbench/services/backup/test/node/backupFileService.test.ts
浏览文件 @
b3316577
...
...
@@ -21,6 +21,7 @@ import { parseArgs } from 'vs/platform/environment/node/argv';
import
{
RawTextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
TestContextService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
Workspace
}
from
"
vs/platform/workspace/common/workspace
"
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
class
TestEnvironmentService
extends
EnvironmentService
{
...
...
@@ -49,7 +50,7 @@ const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', crypto.cre
class
TestBackupFileService
extends
BackupFileService
{
constructor
(
workspace
:
Uri
,
backupHome
:
string
,
workspacesJsonPath
:
string
)
{
const
fileService
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
workspace
.
fsPath
,
workspace
.
fsPath
,
[
workspace
])),
{
disableWatcher
:
true
});
const
fileService
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
workspace
.
fsPath
,
workspace
.
fsPath
,
[
workspace
])),
new
TestConfigurationService
(),
{
disableWatcher
:
true
});
super
(
workspaceBackupPath
,
fileService
);
}
...
...
src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts
浏览文件 @
b3316577
...
...
@@ -45,6 +45,7 @@ import { IModelService } from 'vs/editor/common/services/modelService';
import
{
ModelServiceImpl
}
from
'
vs/editor/common/services/modelServiceImpl
'
;
import
{
IChoiceService
,
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
class
SettingsTestEnvironmentService
extends
EnvironmentService
{
...
...
@@ -125,7 +126,7 @@ suite('ConfigurationEditingService', () => {
instantiationService
.
stub
(
ITelemetryService
,
NullTelemetryService
);
instantiationService
.
stub
(
IModeService
,
ModeServiceImpl
);
instantiationService
.
stub
(
IModelService
,
instantiationService
.
createInstance
(
ModelServiceImpl
));
instantiationService
.
stub
(
IFileService
,
new
FileService
(
workspaceService
,
{
disableWatcher
:
true
}));
instantiationService
.
stub
(
IFileService
,
new
FileService
(
workspaceService
,
new
TestConfigurationService
(),
{
disableWatcher
:
true
}));
instantiationService
.
stub
(
IUntitledEditorService
,
instantiationService
.
createInstance
(
UntitledEditorService
));
instantiationService
.
stub
(
IStorageService
,
new
TestStorageService
());
instantiationService
.
stub
(
IChoiceService
,
{
...
...
src/vs/workbench/services/files/electron-browser/fileService.ts
浏览文件 @
b3316577
...
...
@@ -73,8 +73,6 @@ export class FileService implements IFileService {
// build config
const
fileServiceConfig
:
IFileServiceOptions
=
{
errorLogger
:
(
msg
:
string
)
=>
this
.
onFileServiceError
(
msg
),
encoding
:
configuration
.
files
&&
configuration
.
files
.
encoding
,
autoGuessEncoding
:
configuration
.
files
&&
configuration
.
files
.
autoGuessEncoding
,
encodingOverride
:
this
.
getEncodingOverrides
(),
watcherIgnoredPatterns
,
verboseLogging
:
environmentService
.
verbose
,
...
...
@@ -82,7 +80,7 @@ export class FileService implements IFileService {
};
// create service
this
.
raw
=
new
NodeFileService
(
contextService
,
fileServiceConfig
);
this
.
raw
=
new
NodeFileService
(
contextService
,
configurationService
,
fileServiceConfig
);
// Listeners
this
.
registerListeners
();
...
...
src/vs/workbench/services/files/node/fileService.ts
浏览文件 @
b3316577
...
...
@@ -11,7 +11,7 @@ import os = require('os');
import
crypto
=
require
(
'
crypto
'
);
import
assert
=
require
(
'
assert
'
);
import
{
isParent
,
FileOperation
,
FileOperationEvent
,
IContent
,
IFileService
,
IResolveFileOptions
,
IResolveContentOptions
,
IFileStat
,
IStreamContent
,
IFileOperationResult
,
FileOperationResult
,
IUpdateContentOptions
,
FileChangeType
,
IImportResult
,
MAX_FILE_SIZE
,
FileChangesEvent
}
from
'
vs/platform/files/common/files
'
;
import
{
isParent
,
FileOperation
,
FileOperationEvent
,
IContent
,
IFileService
,
IResolveFileOptions
,
IResolveContentOptions
,
IFileStat
,
IStreamContent
,
IFileOperationResult
,
FileOperationResult
,
IUpdateContentOptions
,
FileChangeType
,
IImportResult
,
MAX_FILE_SIZE
,
FileChangesEvent
,
IFilesConfiguration
}
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
'
);
...
...
@@ -36,6 +36,7 @@ import { FileWatcher as WindowsWatcherService } from 'vs/workbench/services/file
import
{
toFileChangesEvent
,
normalize
,
IRawFileChange
}
from
'
vs/workbench/services/files/node/watcher/common
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
FileWatcher
as
NsfwWatcherService
}
from
'
vs/workbench/services/files/node/watcher/nsfw/watcherService
'
;
import
{
IConfigurationService
}
from
"
vs/platform/configuration/common/configuration
"
;
export
interface
IEncodingOverride
{
resource
:
uri
;
...
...
@@ -45,9 +46,6 @@ export interface IEncodingOverride {
export
interface
IFileServiceOptions
{
tmpDir
?:
string
;
errorLogger
?:
(
msg
:
string
)
=>
void
;
encoding
?:
string
;
autoGuessEncoding
?:
boolean
;
bom
?:
string
;
encodingOverride
?:
IEncodingOverride
[];
watcherIgnoredPatterns
?:
string
[];
disableWatcher
?:
boolean
;
...
...
@@ -93,6 +91,7 @@ export class FileService implements IFileService {
constructor
(
private
contextService
:
IWorkspaceContextService
,
private
configurationService
:
IConfigurationService
,
options
:
IFileServiceOptions
,
)
{
this
.
toDispose
=
[];
...
...
@@ -214,7 +213,7 @@ export class FileService implements IFileService {
}
// 2.) detect mimes
const
autoGuessEncoding
=
(
options
&&
options
.
autoGuessEncoding
)
||
(
this
.
options
&&
this
.
options
.
autoGuessEncoding
);
const
autoGuessEncoding
=
(
options
&&
options
.
autoGuessEncoding
)
||
this
.
configuredAutoGuessEncoding
(
resource
);
return
detectMimesFromFile
(
absolutePath
,
{
autoGuessEncoding
}).
then
((
detected
:
IMimeAndEncoding
)
=>
{
const
isText
=
detected
.
mimes
.
indexOf
(
baseMime
.
MIME_BINARY
)
===
-
1
;
...
...
@@ -239,7 +238,7 @@ export class FileService implements IFileService {
}
else
{
preferredEncoding
=
detected
.
encoding
;
}
}
else
if
(
this
.
options
.
encoding
===
encoding
.
UTF8_with_bom
)
{
}
else
if
(
this
.
configuredEncoding
(
resource
)
===
encoding
.
UTF8_with_bom
)
{
preferredEncoding
=
encoding
.
UTF8
;
// if we did not detect UTF 8 BOM before, this can only be UTF 8 then
}
...
...
@@ -592,7 +591,7 @@ export class FileService implements IFileService {
}
else
if
(
preferredEncoding
)
{
fileEncoding
=
preferredEncoding
;
}
else
{
fileEncoding
=
this
.
options
.
encoding
;
fileEncoding
=
this
.
configuredEncoding
(
resource
)
;
}
if
(
!
fileEncoding
||
!
encoding
.
encodingExists
(
fileEncoding
))
{
...
...
@@ -602,6 +601,18 @@ export class FileService implements IFileService {
return
fileEncoding
;
}
private
configuredAutoGuessEncoding
(
resource
:
uri
):
boolean
{
const
config
=
this
.
configurationService
.
getConfiguration
(
void
0
,
{
resource
})
as
IFilesConfiguration
;
return
config
&&
config
.
files
&&
config
.
files
.
autoGuessEncoding
===
true
;
}
private
configuredEncoding
(
resource
:
uri
):
string
{
const
config
=
this
.
configurationService
.
getConfiguration
(
void
0
,
{
resource
})
as
IFilesConfiguration
;
return
config
&&
config
.
files
&&
config
.
files
.
encoding
;
}
private
getEncodingOverride
(
resource
:
uri
):
string
{
if
(
resource
&&
this
.
options
.
encodingOverride
&&
this
.
options
.
encodingOverride
.
length
)
{
for
(
let
i
=
0
;
i
<
this
.
options
.
encodingOverride
.
length
;
i
++
)
{
...
...
src/vs/workbench/services/files/test/node/fileService.test.ts
浏览文件 @
b3316577
...
...
@@ -21,6 +21,7 @@ import utils = require('vs/workbench/services/files/test/node/utils');
import
{
onError
}
from
'
vs/base/test/common/utils
'
;
import
{
TestContextService
}
from
"
vs/workbench/test/workbenchTestServices
"
;
import
{
Workspace
}
from
"
vs/platform/workspace/common/workspace
"
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
suite
(
'
FileService
'
,
()
=>
{
let
service
:
FileService
;
...
...
@@ -37,7 +38,7 @@ suite('FileService', () => {
return
onError
(
error
,
done
);
}
service
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
testDir
,
testDir
,
[
uri
.
file
(
testDir
)])),
{
disableWatcher
:
true
});
service
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
testDir
,
testDir
,
[
uri
.
file
(
testDir
)])),
new
TestConfigurationService
(),
{
disableWatcher
:
true
});
done
();
});
});
...
...
@@ -753,8 +754,10 @@ suite('FileService', () => {
encoding
:
'
utf16le
'
});
let
_service
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
_testDir
,
_testDir
,
[
uri
.
file
(
_testDir
)])),
{
encoding
:
'
windows1252
'
,
let
configurationService
=
new
TestConfigurationService
();
configurationService
.
setUserConfiguration
(
'
files
'
,
{
encoding
:
'
windows1252
'
});
let
_service
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
_testDir
,
_testDir
,
[
uri
.
file
(
_testDir
)])),
configurationService
,
{
encodingOverride
,
disableWatcher
:
true
});
...
...
@@ -781,7 +784,7 @@ suite('FileService', () => {
let
_sourceDir
=
require
.
toUrl
(
'
./fixtures/service
'
);
let
resource
=
uri
.
file
(
path
.
join
(
testDir
,
'
index.html
'
));
let
_service
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
_testDir
,
_testDir
,
[
uri
.
file
(
_testDir
)])),
{
let
_service
=
new
FileService
(
new
TestContextService
(
new
Workspace
(
_testDir
,
_testDir
,
[
uri
.
file
(
_testDir
)])),
new
TestConfigurationService
(),
{
disableWatcher
:
true
});
...
...
src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts
浏览文件 @
b3316577
...
...
@@ -44,6 +44,7 @@ import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybindin
import
{
ResolvedKeybindingItem
}
from
'
vs/platform/keybinding/common/resolvedKeybindingItem
'
;
import
{
IChoiceService
}
from
'
vs/platform/message/common/message
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
TestConfigurationService
}
from
"
vs/platform/configuration/test/common/testConfigurationService
"
;
interface
Modifiers
{
metaKey
?:
boolean
;
...
...
@@ -81,7 +82,7 @@ suite('Keybindings Editing', () => {
instantiationService
.
stub
(
ITelemetryService
,
NullTelemetryService
);
instantiationService
.
stub
(
IModeService
,
ModeServiceImpl
);
instantiationService
.
stub
(
IModelService
,
instantiationService
.
createInstance
(
ModelServiceImpl
));
instantiationService
.
stub
(
IFileService
,
new
FileService
(
new
TestContextService
(
new
Workspace
(
testDir
,
testDir
,
[
uri
.
file
(
testDir
)])),
{
disableWatcher
:
true
}));
instantiationService
.
stub
(
IFileService
,
new
FileService
(
new
TestContextService
(
new
Workspace
(
testDir
,
testDir
,
[
uri
.
file
(
testDir
)])),
new
TestConfigurationService
(),
{
disableWatcher
:
true
}));
instantiationService
.
stub
(
IUntitledEditorService
,
instantiationService
.
createInstance
(
UntitledEditorService
));
instantiationService
.
stub
(
ITextFileService
,
instantiationService
.
createInstance
(
TestTextFileService
));
instantiationService
.
stub
(
ITextModelService
,
<
ITextModelService
>
instantiationService
.
createInstance
(
TextModelResolverService
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录