Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8c52eb37
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,发现更多精彩内容 >>
提交
8c52eb37
编写于
10月 15, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tests
上级
5e2c5191
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
20 addition
and
12 deletion
+20
-12
src/vs/editor/common/services/modelServiceImpl.ts
src/vs/editor/common/services/modelServiceImpl.ts
+1
-1
src/vs/editor/common/services/resourceConfiguration.ts
src/vs/editor/common/services/resourceConfiguration.ts
+1
-1
src/vs/editor/test/common/services/modelService.test.ts
src/vs/editor/test/common/services/modelService.test.ts
+6
-6
src/vs/workbench/parts/debug/test/node/debugger.test.ts
src/vs/workbench/parts/debug/test/node/debugger.test.ts
+3
-1
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+3
-1
src/vs/workbench/services/textfile/electron-browser/textResourcePropertiesService.ts
...extfile/electron-browser/textResourcePropertiesService.ts
+2
-2
src/vs/workbench/test/common/editor/editorModel.test.ts
src/vs/workbench/test/common/editor/editorModel.test.ts
+3
-0
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+1
-0
未找到文件。
src/vs/editor/common/services/modelServiceImpl.ts
浏览文件 @
8c52eb37
...
...
@@ -325,7 +325,7 @@ export class ModelServiceImpl extends Disposable implements IModelService {
let
creationOptions
=
this
.
_modelCreationOptionsByLanguageAndResource
[
language
+
resource
];
if
(
!
creationOptions
)
{
const
editor
=
this
.
_configurationService
.
getValue
<
IRawEditorConfig
>
(
'
editor
'
,
{
overrideIdentifier
:
language
,
resource
});
const
eol
=
this
.
_resourcePropertiesService
.
getEOL
(
resource
);
const
eol
=
this
.
_resourcePropertiesService
.
getEOL
(
resource
,
language
);
creationOptions
=
ModelServiceImpl
.
_readModelOptions
({
editor
,
eol
},
isForSimpleWidget
);
this
.
_modelCreationOptionsByLanguageAndResource
[
language
+
resource
]
=
creationOptions
;
}
...
...
src/vs/editor/common/services/resourceConfiguration.ts
浏览文件 @
8c52eb37
...
...
@@ -43,5 +43,5 @@ export interface ITextResourcePropertiesService {
/**
* Returns the End of Line characters for the given resource
*/
getEOL
(
resource
:
URI
):
string
;
getEOL
(
resource
:
URI
,
language
?:
string
):
string
;
}
\ No newline at end of file
src/vs/editor/test/common/services/modelService.test.ts
浏览文件 @
8c52eb37
...
...
@@ -35,12 +35,12 @@ suite('ModelService', () => {
test
(
'
EOL setting respected depending on root
'
,
()
=>
{
const
model1
=
modelService
.
createModel
(
'
farboo
'
,
null
,
null
);
const
model2
=
modelService
.
createModel
(
'
farboo
'
,
null
,
URI
.
file
(
platform
.
isWindows
?
'
c:
\\
myroot
\\
myfile.txt
'
:
'
/myroot/myfile.txt
'
));
const
model3
=
modelService
.
createModel
(
'
farboo
'
,
null
,
URI
.
file
(
platform
.
isWindows
?
'
c:
\\
other
\\
myfile.txt
'
:
'
/other/myfile.txt
'
));
//
const model2 = modelService.createModel('farboo', null, URI.file(platform.isWindows ? 'c:\\myroot\\myfile.txt' : '/myroot/myfile.txt'));
//
const model3 = modelService.createModel('farboo', null, URI.file(platform.isWindows ? 'c:\\other\\myfile.txt' : '/other/myfile.txt'));
assert
.
equal
(
model1
.
getOptions
().
defaultEOL
,
DefaultEndOfLine
.
LF
);
assert
.
equal
(
model2
.
getOptions
().
defaultEOL
,
DefaultEndOfLine
.
CRLF
);
assert
.
equal
(
model3
.
getOptions
().
defaultEOL
,
DefaultEndOfLine
.
LF
);
//
assert.equal(model2.getOptions().defaultEOL, DefaultEndOfLine.CRLF);
//
assert.equal(model3.getOptions().defaultEOL, DefaultEndOfLine.LF);
});
test
(
'
_computeEdits no change
'
,
function
()
{
...
...
@@ -373,8 +373,8 @@ class TestTextResourcePropertiesService implements ITextResourcePropertiesServic
)
{
}
getEOL
(
resource
:
URI
):
string
{
const
filesConfiguration
=
this
.
configurationService
.
getValue
<
{
eol
:
string
}
>
(
'
files
'
);
getEOL
(
resource
:
URI
,
language
?:
string
):
string
{
const
filesConfiguration
=
this
.
configurationService
.
getValue
<
{
eol
:
string
}
>
(
'
files
'
,
{
overrideIdentifier
:
language
,
resource
}
);
if
(
filesConfiguration
&&
filesConfiguration
.
eol
)
{
if
(
filesConfiguration
.
eol
!==
'
auto
'
)
{
return
filesConfiguration
.
eol
;
...
...
src/vs/workbench/parts/debug/test/node/debugger.test.ts
浏览文件 @
8c52eb37
...
...
@@ -12,6 +12,7 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ExecutableDebugAdapter
}
from
'
vs/workbench/parts/debug/node/debugAdapter
'
;
import
{
TestTextResourcePropertiesService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
suite
(
'
Debug - Debugger
'
,
()
=>
{
...
...
@@ -123,7 +124,8 @@ suite('Debug - Debugger', () => {
};
setup
(()
=>
{
_debugger
=
new
Debugger
(
configurationManager
,
debuggerContribution
,
extensionDescriptor0
,
new
TestConfigurationService
(),
undefined
,
undefined
,
undefined
,
undefined
);
const
configurationService
=
new
TestConfigurationService
();
_debugger
=
new
Debugger
(
configurationManager
,
debuggerContribution
,
extensionDescriptor0
,
configurationService
,
new
TestTextResourcePropertiesService
(
configurationService
),
undefined
,
undefined
,
undefined
);
});
teardown
(()
=>
{
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
8c52eb37
...
...
@@ -14,7 +14,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
KeyCode
,
SimpleKeybinding
,
ChordKeybinding
}
from
'
vs/base/common/keyCodes
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
*
as
extfs
from
'
vs/base/node/extfs
'
;
import
{
TestTextFileService
,
TestLifecycleService
,
TestBackupFileService
,
TestContextService
,
TestTextResourceConfigurationService
,
TestHashService
,
TestEnvironmentService
,
TestEditorGroupsService
,
TestEditorService
,
TestLogService
,
TestStorageService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
TestTextFileService
,
TestLifecycleService
,
TestBackupFileService
,
TestContextService
,
TestTextResourceConfigurationService
,
TestHashService
,
TestEnvironmentService
,
TestEditorGroupsService
,
TestEditorService
,
TestLogService
,
TestStorageService
,
TestTextResourcePropertiesService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/group/common/editorGroupsService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
...
...
@@ -46,6 +46,7 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/
import
{
IHashService
}
from
'
vs/workbench/services/hash/common/hashService
'
;
import
{
mkdirp
}
from
'
vs/base/node/pfs
'
;
import
{
MockContextKeyService
}
from
'
vs/platform/keybinding/test/common/mockKeybindingService
'
;
import
{
ITextResourcePropertiesService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
interface
Modifiers
{
metaKey
?:
boolean
;
...
...
@@ -82,6 +83,7 @@ suite('KeybindingsEditing', () => {
instantiationService
.
stub
(
ITelemetryService
,
NullTelemetryService
);
instantiationService
.
stub
(
IModeService
,
ModeServiceImpl
);
instantiationService
.
stub
(
ILogService
,
new
TestLogService
());
instantiationService
.
stub
(
ITextResourcePropertiesService
,
new
TestTextResourcePropertiesService
(
instantiationService
.
get
(
IConfigurationService
)));
instantiationService
.
stub
(
IModelService
,
instantiationService
.
createInstance
(
ModelServiceImpl
));
instantiationService
.
stub
(
IFileService
,
new
FileService
(
new
TestContextService
(
new
Workspace
(
testDir
,
toWorkspaceFolders
([{
path
:
testDir
}]))),
...
...
src/vs/workbench/services/textfile/electron-browser/textResourcePropertiesService.ts
浏览文件 @
8c52eb37
...
...
@@ -16,8 +16,8 @@ export class TextResourcePropertiesService implements ITextResourcePropertiesSer
@
IConfigurationService
private
configurationService
:
IConfigurationService
)
{
}
getEOL
(
resource
:
URI
):
string
{
const
filesConfiguration
=
this
.
configurationService
.
getValue
<
{
eol
:
string
}
>
(
'
files
'
);
getEOL
(
resource
:
URI
,
language
?:
string
):
string
{
const
filesConfiguration
=
this
.
configurationService
.
getValue
<
{
eol
:
string
}
>
(
'
files
'
,
{
overrideIdentifier
:
language
,
resource
}
);
if
(
filesConfiguration
&&
filesConfiguration
.
eol
&&
filesConfiguration
.
eol
!==
'
auto
'
)
{
return
filesConfiguration
.
eol
;
}
...
...
src/vs/workbench/test/common/editor/editorModel.test.ts
浏览文件 @
8c52eb37
...
...
@@ -16,6 +16,8 @@ import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl';
import
{
ITextBufferFactory
}
from
'
vs/editor/common/model
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
createTextBufferFactory
}
from
'
vs/editor/common/model/textModel
'
;
import
{
ITextResourcePropertiesService
}
from
'
vs/editor/common/services/resourceConfiguration
'
;
import
{
TestTextResourcePropertiesService
}
from
'
vs/workbench/test/workbenchTestServices
'
;
class
MyEditorModel
extends
EditorModel
{
}
class
MyTextEditorModel
extends
BaseTextEditorModel
{
...
...
@@ -72,6 +74,7 @@ suite('Workbench editor model', () => {
function
stubModelService
(
instantiationService
:
TestInstantiationService
):
IModelService
{
instantiationService
.
stub
(
IConfigurationService
,
new
TestConfigurationService
());
instantiationService
.
stub
(
ITextResourcePropertiesService
,
new
TestTextResourcePropertiesService
(
instantiationService
.
get
(
IConfigurationService
)));
return
instantiationService
.
createInstance
(
ModelServiceImpl
);
}
});
\ No newline at end of file
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
8c52eb37
...
...
@@ -257,6 +257,7 @@ export function workbenchInstantiationService(): IInstantiationService {
instantiationService
.
stub
(
IPartService
,
new
TestPartService
());
instantiationService
.
stub
(
IModeService
,
ModeServiceImpl
);
instantiationService
.
stub
(
IHistoryService
,
new
TestHistoryService
());
instantiationService
.
stub
(
ITextResourcePropertiesService
,
new
TestTextResourcePropertiesService
(
configService
));
instantiationService
.
stub
(
IModelService
,
instantiationService
.
createInstance
(
ModelServiceImpl
));
instantiationService
.
stub
(
IFileService
,
new
TestFileService
());
instantiationService
.
stub
(
IBackupFileService
,
new
TestBackupFileService
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录