Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
41150cfa
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,发现更多精彩内容 >>
提交
41150cfa
编写于
6月 01, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Files: unable to "Save as.." with same name, different case (fix #98864)
上级
06524e63
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
34 addition
and
7 deletion
+34
-7
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+6
-0
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+3
-0
src/vs/workbench/services/textfile/browser/textFileService.ts
...vs/workbench/services/textfile/browser/textFileService.ts
+12
-1
src/vs/workbench/services/textfile/electron-browser/nativeTextFileService.ts
...rvices/textfile/electron-browser/nativeTextFileService.ts
+4
-2
src/vs/workbench/test/browser/workbenchTestServices.ts
src/vs/workbench/test/browser/workbenchTestServices.ts
+4
-2
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
.../workbench/test/electron-browser/workbenchTestServices.ts
+5
-2
未找到文件。
src/vs/workbench/common/editor.ts
浏览文件 @
41150cfa
...
@@ -163,8 +163,14 @@ export interface IEditorControl extends ICompositeControl { }
...
@@ -163,8 +163,14 @@ export interface IEditorControl extends ICompositeControl { }
export
interface
IFileEditorInputFactory
{
export
interface
IFileEditorInputFactory
{
/**
* Creates new new editor input capable of showing files.
*/
createFileEditorInput
(
resource
:
URI
,
encoding
:
string
|
undefined
,
mode
:
string
|
undefined
,
instantiationService
:
IInstantiationService
):
IFileEditorInput
;
createFileEditorInput
(
resource
:
URI
,
encoding
:
string
|
undefined
,
mode
:
string
|
undefined
,
instantiationService
:
IInstantiationService
):
IFileEditorInput
;
/**
* Check if the provided object is a file editor input.
*/
isFileEditorInput
(
obj
:
unknown
):
obj
is
IFileEditorInput
;
isFileEditorInput
(
obj
:
unknown
):
obj
is
IFileEditorInput
;
}
}
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
41150cfa
...
@@ -58,6 +58,8 @@ import { TestTextResourcePropertiesService, TestContextService, TestWorkingCopyS
...
@@ -58,6 +58,8 @@ import { TestTextResourcePropertiesService, TestContextService, TestWorkingCopyS
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
TestThemeService
}
from
'
vs/platform/theme/test/common/testThemeService
'
;
import
{
TestThemeService
}
from
'
vs/platform/theme/test/common/testThemeService
'
;
import
{
IPathService
}
from
'
vs/workbench/services/path/common/pathService
'
;
import
{
IPathService
}
from
'
vs/workbench/services/path/common/pathService
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
import
{
UriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentityService
'
;
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
class
TestEnvironmentService
extends
NativeWorkbenchEnvironmentService
{
...
@@ -117,6 +119,7 @@ suite('KeybindingsEditing', () => {
...
@@ -117,6 +119,7 @@ suite('KeybindingsEditing', () => {
fileService
.
registerProvider
(
Schemas
.
file
,
diskFileSystemProvider
);
fileService
.
registerProvider
(
Schemas
.
file
,
diskFileSystemProvider
);
fileService
.
registerProvider
(
Schemas
.
userData
,
new
FileUserDataProvider
(
environmentService
.
appSettingsHome
,
environmentService
.
backupHome
,
diskFileSystemProvider
,
environmentService
,
new
NullLogService
()));
fileService
.
registerProvider
(
Schemas
.
userData
,
new
FileUserDataProvider
(
environmentService
.
appSettingsHome
,
environmentService
.
backupHome
,
diskFileSystemProvider
,
environmentService
,
new
NullLogService
()));
instantiationService
.
stub
(
IFileService
,
fileService
);
instantiationService
.
stub
(
IFileService
,
fileService
);
instantiationService
.
stub
(
IUriIdentityService
,
new
UriIdentityService
(
fileService
));
instantiationService
.
stub
(
IWorkingCopyService
,
new
TestWorkingCopyService
());
instantiationService
.
stub
(
IWorkingCopyService
,
new
TestWorkingCopyService
());
instantiationService
.
stub
(
IWorkingCopyFileService
,
instantiationService
.
createInstance
(
WorkingCopyFileService
));
instantiationService
.
stub
(
IWorkingCopyFileService
,
instantiationService
.
createInstance
(
WorkingCopyFileService
));
instantiationService
.
stub
(
ITextFileService
,
instantiationService
.
createInstance
(
TestTextFileService
));
instantiationService
.
stub
(
ITextFileService
,
instantiationService
.
createInstance
(
TestTextFileService
));
...
...
src/vs/workbench/services/textfile/browser/textFileService.ts
浏览文件 @
41150cfa
...
@@ -34,6 +34,7 @@ import { suggestFilename } from 'vs/base/common/mime';
...
@@ -34,6 +34,7 @@ import { suggestFilename } from 'vs/base/common/mime';
import
{
IPathService
}
from
'
vs/workbench/services/path/common/pathService
'
;
import
{
IPathService
}
from
'
vs/workbench/services/path/common/pathService
'
;
import
{
isValidBasename
}
from
'
vs/base/common/extpath
'
;
import
{
isValidBasename
}
from
'
vs/base/common/extpath
'
;
import
{
IWorkingCopyFileService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyFileService
'
;
import
{
IWorkingCopyFileService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyFileService
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
/**
/**
* The workbench file service implementation implements the raw file service spec and adds additional methods on top.
* The workbench file service implementation implements the raw file service spec and adds additional methods on top.
...
@@ -69,7 +70,8 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
...
@@ -69,7 +70,8 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
@
ITextModelService
private
readonly
textModelService
:
ITextModelService
,
@
ITextModelService
private
readonly
textModelService
:
ITextModelService
,
@
ICodeEditorService
private
readonly
codeEditorService
:
ICodeEditorService
,
@
ICodeEditorService
private
readonly
codeEditorService
:
ICodeEditorService
,
@
IPathService
private
readonly
pathService
:
IPathService
,
@
IPathService
private
readonly
pathService
:
IPathService
,
@
IWorkingCopyFileService
private
readonly
workingCopyFileService
:
IWorkingCopyFileService
@
IWorkingCopyFileService
private
readonly
workingCopyFileService
:
IWorkingCopyFileService
,
@
IUriIdentityService
private
readonly
uriIdentitiyService
:
IUriIdentityService
)
{
)
{
super
();
super
();
...
@@ -226,6 +228,15 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
...
@@ -226,6 +228,15 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
return
this
.
save
(
source
,
options
);
return
this
.
save
(
source
,
options
);
}
}
// If the target is different but of same identity, we
// move the source to the target, knowing that the
// underlying file system cannot have both and then save.
if
(
this
.
fileService
.
canHandleResource
(
source
)
&&
this
.
uriIdentitiyService
.
extUri
.
isEqual
(
source
,
target
))
{
await
this
.
workingCopyFileService
.
move
(
source
,
target
);
return
this
.
save
(
target
,
options
);
}
// Do it
// Do it
return
this
.
doSaveAs
(
source
,
target
,
options
);
return
this
.
doSaveAs
(
source
,
target
,
options
);
}
}
...
...
src/vs/workbench/services/textfile/electron-browser/nativeTextFileService.ts
浏览文件 @
41150cfa
...
@@ -40,6 +40,7 @@ import { IPathService } from 'vs/workbench/services/path/common/pathService';
...
@@ -40,6 +40,7 @@ import { IPathService } from 'vs/workbench/services/path/common/pathService';
import
{
IWorkingCopyFileService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyFileService
'
;
import
{
IWorkingCopyFileService
}
from
'
vs/workbench/services/workingCopy/common/workingCopyFileService
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
import
{
INativeWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/electron-browser/environmentService
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
export
class
NativeTextFileService
extends
AbstractTextFileService
{
export
class
NativeTextFileService
extends
AbstractTextFileService
{
...
@@ -59,9 +60,10 @@ export class NativeTextFileService extends AbstractTextFileService {
...
@@ -59,9 +60,10 @@ export class NativeTextFileService extends AbstractTextFileService {
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
IPathService
pathService
:
IPathService
,
@
IPathService
pathService
:
IPathService
,
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
,
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
,
@
ILogService
private
readonly
logService
:
ILogService
@
ILogService
private
readonly
logService
:
ILogService
,
@
IUriIdentityService
uriIdentitiyService
:
IUriIdentityService
)
{
)
{
super
(
fileService
,
untitledTextEditorService
,
lifecycleService
,
instantiationService
,
modelService
,
environmentService
,
dialogService
,
fileDialogService
,
textResourceConfigurationService
,
filesConfigurationService
,
textModelService
,
codeEditorService
,
pathService
,
workingCopyFileService
);
super
(
fileService
,
untitledTextEditorService
,
lifecycleService
,
instantiationService
,
modelService
,
environmentService
,
dialogService
,
fileDialogService
,
textResourceConfigurationService
,
filesConfigurationService
,
textModelService
,
codeEditorService
,
pathService
,
workingCopyFileService
,
uriIdentitiyService
);
}
}
private
_encoding
:
EncodingOracle
|
undefined
;
private
_encoding
:
EncodingOracle
|
undefined
;
...
...
src/vs/workbench/test/browser/workbenchTestServices.ts
浏览文件 @
41150cfa
...
@@ -223,7 +223,8 @@ export class TestTextFileService extends BrowserTextFileService {
...
@@ -223,7 +223,8 @@ export class TestTextFileService extends BrowserTextFileService {
@
ITextModelService
textModelService
:
ITextModelService
,
@
ITextModelService
textModelService
:
ITextModelService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
IPathService
pathService
:
IPathService
,
@
IPathService
pathService
:
IPathService
,
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
,
@
IUriIdentityService
uriIdentitiyService
:
IUriIdentityService
)
{
)
{
super
(
super
(
fileService
,
fileService
,
...
@@ -239,7 +240,8 @@ export class TestTextFileService extends BrowserTextFileService {
...
@@ -239,7 +240,8 @@ export class TestTextFileService extends BrowserTextFileService {
textModelService
,
textModelService
,
codeEditorService
,
codeEditorService
,
pathService
,
pathService
,
workingCopyFileService
workingCopyFileService
,
uriIdentitiyService
);
);
}
}
...
...
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
浏览文件 @
41150cfa
...
@@ -38,6 +38,7 @@ import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/wo
...
@@ -38,6 +38,7 @@ import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/wo
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
INativeWindowConfiguration
}
from
'
vs/platform/windows/node/window
'
;
import
{
INativeWindowConfiguration
}
from
'
vs/platform/windows/node/window
'
;
import
{
TestContextService
}
from
'
vs/workbench/test/common/workbenchTestServices
'
;
import
{
TestContextService
}
from
'
vs/workbench/test/common/workbenchTestServices
'
;
import
{
IUriIdentityService
}
from
'
vs/workbench/services/uriIdentity/common/uriIdentity
'
;
export
const
TestWindowConfiguration
:
INativeWindowConfiguration
=
{
export
const
TestWindowConfiguration
:
INativeWindowConfiguration
=
{
windowId
:
0
,
windowId
:
0
,
...
@@ -74,7 +75,8 @@ export class TestTextFileService extends NativeTextFileService {
...
@@ -74,7 +75,8 @@ export class TestTextFileService extends NativeTextFileService {
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
ICodeEditorService
codeEditorService
:
ICodeEditorService
,
@
IPathService
athService
:
IPathService
,
@
IPathService
athService
:
IPathService
,
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
,
@
IWorkingCopyFileService
workingCopyFileService
:
IWorkingCopyFileService
,
@
ILogService
logService
:
ILogService
@
ILogService
logService
:
ILogService
,
@
IUriIdentityService
uriIdentitiyService
:
IUriIdentityService
)
{
)
{
super
(
super
(
fileService
,
fileService
,
...
@@ -92,7 +94,8 @@ export class TestTextFileService extends NativeTextFileService {
...
@@ -92,7 +94,8 @@ export class TestTextFileService extends NativeTextFileService {
codeEditorService
,
codeEditorService
,
athService
,
athService
,
workingCopyFileService
,
workingCopyFileService
,
logService
logService
,
uriIdentitiyService
);
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录