Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
779a1d31
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,发现更多精彩内容 >>
提交
779a1d31
编写于
3月 26, 2019
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dnd does not preserve authority
上级
e2183c19
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
22 deletion
+10
-22
src/vs/workbench/browser/dnd.ts
src/vs/workbench/browser/dnd.ts
+7
-19
src/vs/workbench/browser/nodeless.simpleservices.ts
src/vs/workbench/browser/nodeless.simpleservices.ts
+1
-1
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
...kbench/services/workspace/node/workspaceEditingService.ts
+2
-2
未找到文件。
src/vs/workbench/browser/dnd.ts
浏览文件 @
779a1d31
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
*--------------------------------------------------------------------------------------------*/
import
{
hasWorkspaceFileExtension
,
IWorkspacesService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
hasWorkspaceFileExtension
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
normalize
}
from
'
vs/base/common/path
'
;
import
{
normalize
}
from
'
vs/base/common/path
'
;
import
{
basename
}
from
'
vs/base/common/resources
'
;
import
{
basename
}
from
'
vs/base/common/resources
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
...
@@ -29,6 +29,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
...
@@ -29,6 +29,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
import
{
addDisposableListener
,
EventType
}
from
'
vs/base/browser/dom
'
;
import
{
addDisposableListener
,
EventType
}
from
'
vs/base/browser/dom
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IRecentFile
}
from
'
vs/platform/history/common/history
'
;
import
{
IRecentFile
}
from
'
vs/platform/history/common/history
'
;
import
{
IWorkspaceEditingService
}
from
'
vs/workbench/services/workspace/common/workspaceEditing
'
;
export
interface
IDraggedResource
{
export
interface
IDraggedResource
{
resource
:
URI
;
resource
:
URI
;
...
@@ -154,12 +155,12 @@ export class ResourcesDropHandler {
...
@@ -154,12 +155,12 @@ export class ResourcesDropHandler {
@
IFileService
private
readonly
fileService
:
IFileService
,
@
IFileService
private
readonly
fileService
:
IFileService
,
@
IWindowsService
private
readonly
windowsService
:
IWindowsService
,
@
IWindowsService
private
readonly
windowsService
:
IWindowsService
,
@
IWindowService
private
readonly
windowService
:
IWindowService
,
@
IWindowService
private
readonly
windowService
:
IWindowService
,
@
IWorkspacesService
private
readonly
workspacesService
:
IWorkspacesService
,
@
ITextFileService
private
readonly
textFileService
:
ITextFileService
,
@
ITextFileService
private
readonly
textFileService
:
ITextFileService
,
@
IBackupFileService
private
readonly
backupFileService
:
IBackupFileService
,
@
IBackupFileService
private
readonly
backupFileService
:
IBackupFileService
,
@
IUntitledEditorService
private
readonly
untitledEditorService
:
IUntitledEditorService
,
@
IUntitledEditorService
private
readonly
untitledEditorService
:
IUntitledEditorService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IWorkspaceEditingService
private
readonly
workspaceEditingService
:
IWorkspaceEditingService
)
{
)
{
}
}
...
@@ -284,26 +285,13 @@ export class ResourcesDropHandler {
...
@@ -284,26 +285,13 @@ export class ResourcesDropHandler {
// Pass focus to window
// Pass focus to window
this
.
windowService
.
focusWindow
();
this
.
windowService
.
focusWindow
();
let
workspacesToOpen
:
Promise
<
IURIToOpen
[]
>
|
undefined
;
// Open in separate windows if we drop workspaces or just one folder
// Open in separate windows if we drop workspaces or just one folder
if
(
workspaces
.
length
>
0
||
folders
.
length
===
1
)
{
if
(
workspaces
.
length
>
0
||
folders
.
length
===
1
)
{
workspacesToOpen
=
Promise
.
resolve
([...
workspaces
,
...
folders
]);
return
this
.
windowService
.
openWindow
([...
workspaces
,
...
folders
],
{
forceReuseWindow
:
true
}).
then
(
_
=>
true
);
}
// Multiple folders: Create new workspace with folders and open
else
if
(
folders
.
length
>
1
)
{
workspacesToOpen
=
this
.
workspacesService
.
createUntitledWorkspace
(
folders
).
then
(
workspace
=>
[
<
IURIToOpen
>
{
uri
:
workspace
.
configPath
,
typeHint
:
'
file
'
}]);
}
// Open
if
(
workspacesToOpen
)
{
workspacesToOpen
.
then
(
workspaces
=>
{
this
.
windowService
.
openWindow
(
workspaces
,
{
forceReuseWindow
:
true
});
});
}
}
return
true
;
// folders.length > 1: Multiple folders: Create new workspace with folders and open
return
this
.
workspaceEditingService
.
createAndEnterWorkspace
(
folders
).
then
(
_
=>
true
);
});
});
}
}
}
}
...
...
src/vs/workbench/browser/nodeless.simpleservices.ts
浏览文件 @
779a1d31
...
@@ -1810,7 +1810,7 @@ export class SimpleWorkspacesService implements IWorkspacesService {
...
@@ -1810,7 +1810,7 @@ export class SimpleWorkspacesService implements IWorkspacesService {
_serviceBrand
:
any
;
_serviceBrand
:
any
;
createUntitledWorkspace
(
folders
?:
IWorkspaceFolderCreationData
[]):
Promise
<
IWorkspaceIdentifier
>
{
createUntitledWorkspace
(
folders
?:
IWorkspaceFolderCreationData
[]
,
remoteAuthority
?:
string
):
Promise
<
IWorkspaceIdentifier
>
{
// @ts-ignore
// @ts-ignore
return
Promise
.
resolve
(
undefined
);
return
Promise
.
resolve
(
undefined
);
}
}
...
...
src/vs/workbench/services/workspace/node/workspaceEditingService.ts
浏览文件 @
779a1d31
...
@@ -245,8 +245,8 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
...
@@ -245,8 +245,8 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
if
(
path
&&
!
this
.
isValidTargetWorkspacePath
(
path
))
{
if
(
path
&&
!
this
.
isValidTargetWorkspacePath
(
path
))
{
return
Promise
.
reject
(
null
);
return
Promise
.
reject
(
null
);
}
}
const
remoteAuthority
=
this
.
windowService
.
getConfiguration
().
remoteAuthority
;
const
untitledWorkspace
=
await
this
.
workspaceService
.
createUntitledWorkspace
(
folders
);
const
untitledWorkspace
=
await
this
.
workspaceService
.
createUntitledWorkspace
(
folders
,
remoteAuthority
);
if
(
path
)
{
if
(
path
)
{
await
this
.
saveWorkspaceAs
(
untitledWorkspace
,
path
);
await
this
.
saveWorkspaceAs
(
untitledWorkspace
,
path
);
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录