Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a19eb1d5
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,发现更多精彩内容 >>
提交
a19eb1d5
编写于
2月 09, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
"paste" as command for explorer (for #4557)
上级
f3d8873b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
61 addition
and
57 deletion
+61
-57
src/vs/workbench/parts/files/browser/fileActions.contribution.ts
...workbench/parts/files/browser/fileActions.contribution.ts
+19
-11
src/vs/workbench/parts/files/browser/fileActions.ts
src/vs/workbench/parts/files/browser/fileActions.ts
+16
-3
src/vs/workbench/parts/files/browser/fileCommands.ts
src/vs/workbench/parts/files/browser/fileCommands.ts
+24
-24
src/vs/workbench/parts/files/browser/views/explorerViewer.ts
src/vs/workbench/parts/files/browser/views/explorerViewer.ts
+2
-19
未找到文件。
src/vs/workbench/parts/files/browser/fileActions.contribution.ts
浏览文件 @
a19eb1d5
...
...
@@ -11,7 +11,7 @@ import { isMacintosh } from 'vs/base/common/platform';
import
{
ActionItem
,
BaseActionItem
,
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Scope
,
IActionBarRegistry
,
Extensions
as
ActionBarExtensions
,
ActionBarContributor
}
from
'
vs/workbench/browser/actionBarRegistry
'
;
import
{
IEditorInputActionContext
,
IEditorInputAction
,
EditorInputActionContributor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
GlobalNewUntitledFileAction
,
SaveFileAsAction
,
OpenFileAction
,
ShowOpenedFileInNewWindow
,
CopyPathAction
,
GlobalCopyPathAction
,
RevealInOSAction
,
GlobalRevealInOSAction
,
FocusOpenEditorsView
,
FocusFilesExplorer
,
GlobalCompareResourcesAction
,
GlobalNewFileAction
,
GlobalNewFolderAction
,
RevertFileAction
,
SaveFilesAction
,
SaveAllAction
,
SaveFileAction
,
keybindingForAction
,
MoveFileToTrashAction
,
TriggerRenameFileAction
,
PasteFileAction
,
CopyFileAction
,
SelectResourceForCompareAction
,
CompareResourcesAction
,
NewFolderAction
,
NewFileAction
,
OpenToSideAction
,
ShowActiveFileInExplorer
,
CollapseExplorerView
,
RefreshExplorerView
}
from
'
vs/workbench/parts/files/browser/fileActions
'
;
import
{
GlobalNewUntitledFileAction
,
SaveFileAsAction
,
OpenFileAction
,
ShowOpenedFileInNewWindow
,
CopyPathAction
,
GlobalCopyPathAction
,
RevealInOSAction
,
GlobalRevealInOSAction
,
pasteIntoFocusedFilesExplorerViewItem
,
FocusOpenEditorsView
,
FocusFilesExplorer
,
GlobalCompareResourcesAction
,
GlobalNewFileAction
,
GlobalNewFolderAction
,
RevertFileAction
,
SaveFilesAction
,
SaveAllAction
,
SaveFileAction
,
keybindingForAction
,
MoveFileToTrashAction
,
TriggerRenameFileAction
,
PasteFileAction
,
CopyFileAction
,
SelectResourceForCompareAction
,
CompareResourcesAction
,
NewFolderAction
,
NewFileAction
,
OpenToSideAction
,
ShowActiveFileInExplorer
,
CollapseExplorerView
,
RefreshExplorerView
}
from
'
vs/workbench/parts/files/browser/fileActions
'
;
import
{
RevertLocalChangesAction
,
AcceptLocalChangesAction
,
CONFLICT_RESOLUTION_SCHEME
}
from
'
vs/workbench/parts/files/browser/saveErrorHandler
'
;
import
{
SyncActionDescriptor
,
MenuId
,
MenuRegistry
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/common/actionRegistry
'
;
...
...
@@ -23,7 +23,7 @@ import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
import
{
DiffEditorInput
}
from
'
vs/workbench/common/editor/diffEditorInput
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
import
{
OpenFolderAction
,
OpenFileFolderAction
}
from
'
vs/workbench/browser/actions/fileActions
'
;
import
{
copyFocus
sedExplorerViewItem
,
revealInOSFocussedExplorerItem
,
openFocussedOpenedEditorsViewItemCommand
,
openFocussedExplorerItemSideBySideCommand
,
copyPathOfFocussedExplorerItem
,
copyPathCommand
,
revealInExplorerCommand
,
revealInOSCommand
,
openFolderPickerCommand
,
openWindowCommand
,
openFileInNewWindowCommand
,
openFocussedExplorerViewItemCommand
,
deleteFocussedExplorerViewItemCommand
,
moveFocussedExplorerViewItemToTrashCommand
,
renameFocussed
ExplorerViewItemCommand
}
from
'
vs/workbench/parts/files/browser/fileCommands
'
;
import
{
copyFocus
edFilesExplorerViewItem
,
revealInOSFocusedFilesExplorerItem
,
openFocusedOpenedEditorsViewItemCommand
,
openFocusedExplorerItemSideBySideCommand
,
copyPathOfFocusedExplorerItem
,
copyPathCommand
,
revealInExplorerCommand
,
revealInOSCommand
,
openFolderPickerCommand
,
openWindowCommand
,
openFileInNewWindowCommand
,
openFocussedFilesExplorerViewItemCommand
,
deleteFocusedFilesExplorerViewItemCommand
,
moveFocusedFilesExplorerViewItemToTrashCommand
,
renameFocusedFiles
ExplorerViewItemCommand
}
from
'
vs/workbench/parts/files/browser/fileCommands
'
;
import
{
CommandsRegistry
,
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
KeybindingsRegistry
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
...
...
@@ -246,7 +246,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(
explorerCommandsWeightBonus
),
when
:
OpenedEditorsFocusCondition
,
primary
:
KeyCode
.
Enter
,
handler
:
openFocus
s
edOpenedEditorsViewItemCommand
handler
:
openFocusedOpenedEditorsViewItemCommand
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -257,7 +257,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
DownArrow
},
handler
:
openFocussedExplorerViewItemCommand
handler
:
openFocussed
Files
ExplorerViewItemCommand
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -268,7 +268,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
mac
:
{
primary
:
KeyMod
.
WinCtrl
|
KeyCode
.
Enter
},
handler
:
openFocus
s
edExplorerItemSideBySideCommand
handler
:
openFocusedExplorerItemSideBySideCommand
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -279,7 +279,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
mac
:
{
primary
:
KeyCode
.
Enter
},
handler
:
renameFocus
sed
ExplorerViewItemCommand
handler
:
renameFocus
edFiles
ExplorerViewItemCommand
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -290,7 +290,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
Backspace
},
handler
:
moveFocus
sed
ExplorerViewItemToTrashCommand
handler
:
moveFocus
edFiles
ExplorerViewItemToTrashCommand
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -301,7 +301,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
mac
:
{
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Alt
|
KeyCode
.
Backspace
},
handler
:
deleteFocus
sed
ExplorerViewItemCommand
handler
:
deleteFocus
edFiles
ExplorerViewItemCommand
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -309,7 +309,15 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(
explorerCommandsWeightBonus
),
when
:
FilesExplorerFocusCondition
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_C
,
handler
:
copyFocussedExplorerViewItem
handler
:
copyFocusedFilesExplorerViewItem
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
'
filesExplorer.paste
'
,
weight
:
KeybindingsRegistry
.
WEIGHT
.
workbenchContrib
(
explorerCommandsWeightBonus
),
when
:
FilesExplorerFocusCondition
,
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_V
,
handler
:
pasteIntoFocusedFilesExplorerViewItem
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -320,7 +328,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
win
:
{
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_C
},
handler
:
copyPathOfFocus
s
edExplorerItem
handler
:
copyPathOfFocusedExplorerItem
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
...
...
@@ -331,7 +339,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
win
:
{
primary
:
KeyMod
.
Shift
|
KeyMod
.
Alt
|
KeyCode
.
KEY_R
},
handler
:
revealInOSFocus
sed
ExplorerItem
handler
:
revealInOSFocus
edFiles
ExplorerItem
});
// Editor Title Context Menu
...
...
src/vs/workbench/parts/files/browser/fileActions.ts
浏览文件 @
a19eb1d5
...
...
@@ -40,7 +40,7 @@ import { IQuickOpenService, IFilePickOpenEntry } from 'vs/platform/quickOpen/com
import
{
IHistoryService
}
from
'
vs/workbench/services/history/common/history
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
Position
,
IResourceInput
,
IEditorInput
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
,
IConstructorSignature2
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
IConstructorSignature2
,
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMessageService
,
IMessageWithAction
,
IConfirmation
,
Severity
,
CancelAction
}
from
'
vs/platform/message/common/message
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Keybinding
,
KeyMod
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
...
...
@@ -49,7 +49,7 @@ import { IEditorViewState } from 'vs/editor/common/editorCommon';
import
{
IBackupFileService
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
ITextModelResolverService
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IWindowsService
,
IWindowService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
revealInOSCommand
,
revealInExplorerCommand
,
copyPathCommand
}
from
'
vs/workbench/parts/files/browser/fileCommands
'
;
import
{
withFocussedFilesExplorerViewItem
,
revealInOSCommand
,
revealInExplorerCommand
,
copyPathCommand
}
from
'
vs/workbench/parts/files/browser/fileCommands
'
;
export
interface
IEditableData
{
action
:
IAction
;
...
...
@@ -923,7 +923,7 @@ export class CopyFileAction extends BaseFileAction {
// Paste File/Folder
export
class
PasteFileAction
extends
BaseFileAction
{
public
static
ID
=
'
workbench.files.action.pasteFil
e
'
;
public
static
ID
=
'
filesExplorer.past
e
'
;
private
tree
:
ITree
;
...
...
@@ -984,6 +984,19 @@ export class PasteFileAction extends BaseFileAction {
}
}
export
const
pasteIntoFocusedFilesExplorerViewItem
=
(
accessor
:
ServicesAccessor
)
=>
{
const
instantiationService
=
accessor
.
get
(
IInstantiationService
);
withFocussedFilesExplorerViewItem
(
accessor
).
then
(
res
=>
{
if
(
res
.
item
)
{
const
pasteAction
=
instantiationService
.
createInstance
(
PasteFileAction
,
res
.
tree
,
res
.
item
);
if
(
pasteAction
.
_isEnabled
())
{
pasteAction
.
run
().
done
(
null
,
errors
.
onUnexpectedError
);
}
}
});
};
// Duplicate File/Folder
export
class
DuplicateFileAction
extends
BaseFileAction
{
private
tree
:
ITree
;
...
...
src/vs/workbench/parts/files/browser/fileCommands.ts
浏览文件 @
a19eb1d5
...
...
@@ -77,8 +77,8 @@ export const revealInExplorerCommand = (accessor: ServicesAccessor, resource: UR
});
};
function
openFocus
sed
ExplorerViewItem
(
accessor
:
ServicesAccessor
,
sideBySide
:
boolean
):
void
{
withFocussedExplorerViewItem
(
accessor
).
then
(
res
=>
{
function
openFocus
edFiles
ExplorerViewItem
(
accessor
:
ServicesAccessor
,
sideBySide
:
boolean
):
void
{
withFocussed
Files
ExplorerViewItem
(
accessor
).
then
(
res
=>
{
if
(
res
)
{
// Directory: Toggle expansion
...
...
@@ -105,8 +105,8 @@ function openFocussedOpenedEditorsViewItem(accessor: ServicesAccessor, sideBySid
});
}
function
runActionOnFocus
sed
ExplorerViewItem
(
accessor
:
ServicesAccessor
,
id
:
string
,
context
?:
any
):
void
{
withFocussedExplorerViewItem
(
accessor
).
then
(
res
=>
{
function
runActionOnFocus
edFiles
ExplorerViewItem
(
accessor
:
ServicesAccessor
,
id
:
string
,
context
?:
any
):
void
{
withFocussed
Files
ExplorerViewItem
(
accessor
).
then
(
res
=>
{
if
(
res
)
{
res
.
explorer
.
getViewletState
().
actionProvider
.
runAction
(
res
.
tree
,
res
.
item
,
id
,
context
).
done
(
null
,
errors
.
onUnexpectedError
);
}
...
...
@@ -124,7 +124,7 @@ function withVisibleExplorer(accessor: ServicesAccessor): TPromise<ExplorerViewl
return
viewletService
.
openViewlet
(
VIEWLET_ID
,
false
);
};
function
withFocussed
ExplorerViewItem
(
accessor
:
ServicesAccessor
):
TPromise
<
{
explorer
:
ExplorerViewlet
,
tree
:
ITree
,
item
:
FileStat
}
>
{
export
function
withFocussedFiles
ExplorerViewItem
(
accessor
:
ServicesAccessor
):
TPromise
<
{
explorer
:
ExplorerViewlet
,
tree
:
ITree
,
item
:
FileStat
}
>
{
return
withVisibleExplorer
(
accessor
).
then
(
explorer
=>
{
if
(
!
explorer
||
!
explorer
.
getExplorerView
())
{
return
void
0
;
// empty folder or hidden explorer
...
...
@@ -159,8 +159,8 @@ function withFocussedOpenEditorsViewItem(accessor: ServicesAccessor): TPromise<{
});
};
function
withFocus
s
edExplorerItem
(
accessor
:
ServicesAccessor
):
TPromise
<
FileStat
|
OpenEditor
>
{
return
withFocussedExplorerViewItem
(
accessor
).
then
(
res
=>
{
function
withFocusedExplorerItem
(
accessor
:
ServicesAccessor
):
TPromise
<
FileStat
|
OpenEditor
>
{
return
withFocussed
Files
ExplorerViewItem
(
accessor
).
then
(
res
=>
{
if
(
res
)
{
return
res
.
item
;
}
...
...
@@ -175,27 +175,27 @@ function withFocussedExplorerItem(accessor: ServicesAccessor): TPromise<FileStat
})
as
TPromise
<
FileStat
|
OpenEditor
>
;
// TypeScript fail
};
export
const
openFocussed
ExplorerViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
openFocussed
ExplorerViewItem
(
accessor
,
false
);
export
const
openFocus
s
edOpenedEditorsViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
openFocussedOpenedEditorsViewItem
(
accessor
,
false
);
export
const
openFocussed
FilesExplorerViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
openFocusedFiles
ExplorerViewItem
(
accessor
,
false
);
export
const
openFocusedOpenedEditorsViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
openFocussedOpenedEditorsViewItem
(
accessor
,
false
);
export
const
renameFocus
sed
ExplorerViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
sed
ExplorerViewItem
(
accessor
,
'
filesExplorer.rename
'
);
export
const
renameFocus
edFiles
ExplorerViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
edFiles
ExplorerViewItem
(
accessor
,
'
filesExplorer.rename
'
);
};
export
const
deleteFocus
sed
ExplorerViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
sed
ExplorerViewItem
(
accessor
,
'
filesExplorer.moveFileToTrash
'
,
{
useTrash
:
false
});
export
const
deleteFocus
edFiles
ExplorerViewItemCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
edFiles
ExplorerViewItem
(
accessor
,
'
filesExplorer.moveFileToTrash
'
,
{
useTrash
:
false
});
};
export
const
moveFocus
sed
ExplorerViewItemToTrashCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
sed
ExplorerViewItem
(
accessor
,
'
filesExplorer.moveFileToTrash
'
,
{
useTrash
:
true
});
export
const
moveFocus
edFiles
ExplorerViewItemToTrashCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
edFiles
ExplorerViewItem
(
accessor
,
'
filesExplorer.moveFileToTrash
'
,
{
useTrash
:
true
});
};
export
const
copyFocus
sed
ExplorerViewItem
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
sed
ExplorerViewItem
(
accessor
,
'
filesExplorer.copy
'
);
export
const
copyFocus
edFiles
ExplorerViewItem
=
(
accessor
:
ServicesAccessor
)
=>
{
runActionOnFocus
edFiles
ExplorerViewItem
(
accessor
,
'
filesExplorer.copy
'
);
};
export
const
copyPathOfFocus
s
edExplorerItem
=
(
accessor
:
ServicesAccessor
)
=>
{
withFocus
s
edExplorerItem
(
accessor
).
then
(
item
=>
{
export
const
copyPathOfFocusedExplorerItem
=
(
accessor
:
ServicesAccessor
)
=>
{
withFocusedExplorerItem
(
accessor
).
then
(
item
=>
{
const
file
=
explorerItemToFileResource
(
item
);
if
(
file
)
{
copyPathCommand
(
accessor
,
file
.
resource
);
...
...
@@ -203,18 +203,18 @@ export const copyPathOfFocussedExplorerItem = (accessor: ServicesAccessor) => {
});
};
export
const
openFocus
s
edExplorerItemSideBySideCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
withFocus
s
edExplorerItem
(
accessor
).
then
(
item
=>
{
export
const
openFocusedExplorerItemSideBySideCommand
=
(
accessor
:
ServicesAccessor
)
=>
{
withFocusedExplorerItem
(
accessor
).
then
(
item
=>
{
if
(
item
instanceof
FileStat
)
{
openFocus
sed
ExplorerViewItem
(
accessor
,
true
);
openFocus
edFiles
ExplorerViewItem
(
accessor
,
true
);
}
else
{
openFocussedOpenedEditorsViewItem
(
accessor
,
true
);
}
});
};
export
const
revealInOSFocus
sed
ExplorerItem
=
(
accessor
:
ServicesAccessor
)
=>
{
withFocus
s
edExplorerItem
(
accessor
).
then
(
item
=>
{
export
const
revealInOSFocus
edFiles
ExplorerItem
=
(
accessor
:
ServicesAccessor
)
=>
{
withFocusedExplorerItem
(
accessor
).
then
(
item
=>
{
const
file
=
explorerItemToFileResource
(
item
);
if
(
file
)
{
revealInOSCommand
(
accessor
,
file
.
resource
);
...
...
src/vs/workbench/parts/files/browser/views/explorerViewer.ts
浏览文件 @
a19eb1d5
...
...
@@ -27,7 +27,7 @@ import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegis
import
{
IFilesConfiguration
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IFileOperationResult
,
FileOperationResult
,
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
DuplicateFileAction
,
ImportFileAction
,
PasteFileAction
,
keybindingForAction
,
IEditableData
,
IFileViewletState
}
from
'
vs/workbench/parts/files/browser/fileActions
'
;
import
{
DuplicateFileAction
,
ImportFileAction
,
keybindingForAction
,
IEditableData
,
IFileViewletState
}
from
'
vs/workbench/parts/files/browser/fileActions
'
;
import
{
IDataSource
,
ITree
,
IElementCallback
,
IAccessibilityProvider
,
IRenderer
,
ContextMenuEvent
,
ISorter
,
IFilter
,
IDragAndDrop
,
IDragAndDropData
,
IDragOverReaction
,
DRAG_OVER_ACCEPT_BUBBLE_DOWN
,
DRAG_OVER_ACCEPT_BUBBLE_DOWN_COPY
,
DRAG_OVER_ACCEPT_BUBBLE_UP
,
DRAG_OVER_ACCEPT_BUBBLE_UP_COPY
,
DRAG_OVER_REJECT
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
DesktopDragAndDropData
,
ExternalElementsDragAndDropData
}
from
'
vs/base/parts/tree/browser/treeDnd
'
;
import
{
ClickBehavior
,
DefaultController
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
...
...
@@ -45,7 +45,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import
{
IMessageService
,
IConfirmation
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
IProgressService
}
from
'
vs/platform/progress/common/progress
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
Keybinding
,
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
Keybinding
,
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IMenuService
,
IMenu
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
fillInActions
}
from
'
vs/platform/actions/browser/menuItemActionItem
'
;
...
...
@@ -390,9 +390,6 @@ export class FileController extends DefaultController {
this
.
contributedContextMenu
=
menuService
.
createMenu
(
MenuId
.
ExplorerContext
,
contextKeyService
);
// Paste
this
.
downKeyBindingDispatcher
.
set
(
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_V
,
(
t
,
e
)
=>
this
.
onPaste
(
t
,
e
));
this
.
state
=
state
;
}
...
...
@@ -502,20 +499,6 @@ export class FileController extends DefaultController {
return
true
;
}
private
onPaste
(
tree
:
ITree
,
event
:
IKeyboardEvent
):
boolean
{
const
stat
:
FileStat
=
tree
.
getFocus
()
||
tree
.
getInput
()
/* root */
;
if
(
stat
)
{
const
pasteAction
=
this
.
instantiationService
.
createInstance
(
PasteFileAction
,
tree
,
stat
);
if
(
pasteAction
.
_isEnabled
())
{
pasteAction
.
run
().
done
(
null
,
errors
.
onUnexpectedError
);
return
true
;
}
}
return
false
;
}
private
openEditor
(
stat
:
FileStat
,
preserveFocus
:
boolean
,
sideBySide
:
boolean
,
pinned
=
false
):
void
{
if
(
stat
&&
!
stat
.
isDirectory
)
{
this
.
telemetryService
.
publicLog
(
'
workbenchActionExecuted
'
,
{
id
:
'
workbench.files.openFile
'
,
from
:
'
explorer
'
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录