Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
96bf508c
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,发现更多精彩内容 >>
提交
96bf508c
编写于
9月 17, 2019
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move remote dialog local commands into remoteFileDialog.ts
Fixes #80959
上级
09daf886
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
77 deletion
+60
-77
src/vs/workbench/common/actions.ts
src/vs/workbench/common/actions.ts
+0
-21
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
...ch/contrib/remote/electron-browser/remote.contribution.ts
+6
-6
src/vs/workbench/electron-browser/actions/workspaceActions.ts
...vs/workbench/electron-browser/actions/workspaceActions.ts
+0
-49
src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts
...vs/workbench/services/dialogs/browser/remoteFileDialog.ts
+54
-1
未找到文件。
src/vs/workbench/common/actions.ts
浏览文件 @
96bf508c
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
KeybindingsRegistry
,
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
ICommandHandler
,
CommandsRegistry
}
from
'
vs/platform/commands/common/commands
'
;
...
...
@@ -120,23 +119,3 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR
}
}
});
export
namespace
OpenLocalFileCommand
{
export
const
ID
=
'
workbench.action.files.openLocalFile
'
;
export
const
LABEL
=
nls
.
localize
(
'
openLocalFile
'
,
"
Open Local File...
"
);
}
export
namespace
SaveLocalFileCommand
{
export
const
ID
=
'
workbench.action.files.saveLocalFile
'
;
export
const
LABEL
=
nls
.
localize
(
'
saveLocalFile
'
,
"
Save Local File...
"
);
}
export
namespace
OpenLocalFolderCommand
{
export
const
ID
=
'
workbench.action.files.openLocalFolder
'
;
export
const
LABEL
=
nls
.
localize
(
'
openLocalFolder
'
,
"
Open Local Folder...
"
);
}
export
namespace
OpenLocalFileFolderCommand
{
export
const
ID
=
'
workbench.action.files.openLocalFileFolder
'
;
export
const
LABEL
=
nls
.
localize
(
'
openLocalFileFolder
'
,
"
Open Local...
"
);
}
src/vs/workbench/contrib/remote/electron-browser/remote.contribution.ts
浏览文件 @
96bf508c
...
...
@@ -33,13 +33,13 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
import
{
PersistentConnectionEventType
}
from
'
vs/platform/remote/common/remoteAgentConnection
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationRegistry
,
Extensions
as
ConfigurationExtensions
}
from
'
vs/platform/configuration/common/configurationRegistry
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
,
OpenLocalFileFolderCommand
,
OpenLocalFileCommand
,
OpenLocalFolderCommand
,
SaveLocalFileCommand
}
from
'
vs/workbench/common/actions
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/common/actions
'
;
import
{
OpenFileFolderAction
,
OpenFileAction
,
OpenFolderAction
}
from
'
vs/workbench/browser/actions/workspaceActions
'
;
import
{
IRemoteAuthorityResolverService
}
from
'
vs/platform/remote/common/remoteAuthorityResolver
'
;
import
{
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
RemoteConnectionState
,
Deprecated_RemoteAuthorityContext
,
RemoteFileDialogContext
}
from
'
vs/workbench/browser/contextkeys
'
;
import
{
IDownloadService
}
from
'
vs/platform/download/common/download
'
;
import
*
as
workspaceActions
from
'
vs/workbench/electron-browser/actions/workspaceActions
'
;
import
{
OpenLocalFileFolderCommand
,
OpenLocalFileCommand
,
OpenLocalFolderCommand
,
SaveLocalFileCommand
}
from
'
vs/workbench/services/dialogs/browser/remoteFileDialog
'
;
const
WINDOW_ACTIONS_COMMAND_ID
=
'
remote.showActions
'
;
const
CLOSE_REMOTE_COMMAND_ID
=
'
remote.closeRemote
'
;
...
...
@@ -388,7 +388,7 @@ if (isMacintosh) {
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_O
,
when
:
RemoteFileDialogContext
,
description
:
{
description
:
OpenLocalFileFolderCommand
.
LABEL
,
args
:
[]
},
handler
:
workspaceActions
.
OpenLocalFileFolderCommand
.
handler
()
handler
:
OpenLocalFileFolderCommand
.
handler
()
});
}
else
{
registry
.
registerWorkbenchAction
(
new
SyncActionDescriptor
(
OpenFileAction
,
OpenFileAction
.
ID
,
OpenFileAction
.
LABEL
,
{
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_O
}),
'
File: Open File...
'
,
fileCategory
);
...
...
@@ -399,7 +399,7 @@ if (isMacintosh) {
primary
:
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_O
,
when
:
RemoteFileDialogContext
,
description
:
{
description
:
OpenLocalFileCommand
.
LABEL
,
args
:
[]
},
handler
:
workspaceActions
.
OpenLocalFileCommand
.
handler
()
handler
:
OpenLocalFileCommand
.
handler
()
});
KeybindingsRegistry
.
registerCommandAndKeybindingRule
({
id
:
OpenLocalFolderCommand
.
ID
,
...
...
@@ -407,7 +407,7 @@ if (isMacintosh) {
primary
:
KeyChord
(
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_K
,
KeyMod
.
CtrlCmd
|
KeyCode
.
KEY_O
),
when
:
RemoteFileDialogContext
,
description
:
{
description
:
OpenLocalFolderCommand
.
LABEL
,
args
:
[]
},
handler
:
workspaceActions
.
OpenLocalFolderCommand
.
handler
()
handler
:
OpenLocalFolderCommand
.
handler
()
});
}
...
...
@@ -417,5 +417,5 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
primary
:
KeyMod
.
CtrlCmd
|
KeyMod
.
Shift
|
KeyCode
.
KEY_S
,
when
:
RemoteFileDialogContext
,
description
:
{
description
:
SaveLocalFileCommand
.
LABEL
,
args
:
[]
},
handler
:
workspaceActions
.
SaveLocalFileCommand
.
handler
()
handler
:
SaveLocalFileCommand
.
handler
()
});
src/vs/workbench/electron-browser/actions/workspaceActions.ts
浏览文件 @
96bf508c
...
...
@@ -11,13 +11,6 @@ import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common
import
{
IWorkspacesService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
IFileDialogService
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
ITextFileService
,
ISaveOptions
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
toResource
}
from
'
vs/workbench/common/editor
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
export
class
SaveWorkspaceAsAction
extends
Action
{
...
...
@@ -102,45 +95,3 @@ export class CloseWorkspaceAction extends Action {
return
this
.
windowService
.
closeWorkspace
();
}
}
export
namespace
OpenLocalFileCommand
{
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
dialogService
=
accessor
.
get
(
IFileDialogService
);
return
dialogService
.
pickFileAndOpen
({
forceNewWindow
:
false
,
availableFileSystems
:
[
Schemas
.
file
]
});
};
}
}
export
namespace
SaveLocalFileCommand
{
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
textFileService
=
accessor
.
get
(
ITextFileService
);
const
editorService
=
accessor
.
get
(
IEditorService
);
let
resource
:
URI
|
undefined
=
toResource
(
editorService
.
activeEditor
);
const
options
:
ISaveOptions
=
{
force
:
true
,
availableFileSystems
:
[
Schemas
.
file
]
};
if
(
resource
)
{
return
textFileService
.
saveAs
(
resource
,
undefined
,
options
);
}
return
Promise
.
resolve
(
undefined
);
};
}
}
export
namespace
OpenLocalFolderCommand
{
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
dialogService
=
accessor
.
get
(
IFileDialogService
);
return
dialogService
.
pickFolderAndOpen
({
forceNewWindow
:
false
,
availableFileSystems
:
[
Schemas
.
file
]
});
};
}
}
export
namespace
OpenLocalFileFolderCommand
{
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
dialogService
=
accessor
.
get
(
IFileDialogService
);
return
dialogService
.
pickFileFolderAndOpen
({
forceNewWindow
:
false
,
availableFileSystems
:
[
Schemas
.
file
]
});
};
}
}
src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts
浏览文件 @
96bf508c
...
...
@@ -23,7 +23,6 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
import
{
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
equalsIgnoreCase
,
format
,
startsWithIgnoreCase
}
from
'
vs/base/common/strings
'
;
import
{
OpenLocalFileCommand
,
OpenLocalFileFolderCommand
,
OpenLocalFolderCommand
,
SaveLocalFileCommand
}
from
'
vs/workbench/common/actions
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IRemoteAgentEnvironment
}
from
'
vs/platform/remote/common/remoteAgentEnvironment
'
;
import
{
isValidBasename
}
from
'
vs/base/common/extpath
'
;
...
...
@@ -32,6 +31,60 @@ import { Emitter } from 'vs/base/common/event';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
createCancelablePromise
,
CancelablePromise
}
from
'
vs/base/common/async
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
ICommandHandler
}
from
'
vs/platform/commands/common/commands
'
;
import
{
ITextFileService
,
ISaveOptions
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
toResource
}
from
'
vs/workbench/common/editor
'
;
export
namespace
OpenLocalFileCommand
{
export
const
ID
=
'
workbench.action.files.openLocalFile
'
;
export
const
LABEL
=
nls
.
localize
(
'
openLocalFile
'
,
"
Open Local File...
"
);
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
dialogService
=
accessor
.
get
(
IFileDialogService
);
return
dialogService
.
pickFileAndOpen
({
forceNewWindow
:
false
,
availableFileSystems
:
[
Schemas
.
file
]
});
};
}
}
export
namespace
SaveLocalFileCommand
{
export
const
ID
=
'
workbench.action.files.saveLocalFile
'
;
export
const
LABEL
=
nls
.
localize
(
'
saveLocalFile
'
,
"
Save Local File...
"
);
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
textFileService
=
accessor
.
get
(
ITextFileService
);
const
editorService
=
accessor
.
get
(
IEditorService
);
let
resource
:
URI
|
undefined
=
toResource
(
editorService
.
activeEditor
);
const
options
:
ISaveOptions
=
{
force
:
true
,
availableFileSystems
:
[
Schemas
.
file
]
};
if
(
resource
)
{
return
textFileService
.
saveAs
(
resource
,
undefined
,
options
);
}
return
Promise
.
resolve
(
undefined
);
};
}
}
export
namespace
OpenLocalFolderCommand
{
export
const
ID
=
'
workbench.action.files.openLocalFolder
'
;
export
const
LABEL
=
nls
.
localize
(
'
openLocalFolder
'
,
"
Open Local Folder...
"
);
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
dialogService
=
accessor
.
get
(
IFileDialogService
);
return
dialogService
.
pickFolderAndOpen
({
forceNewWindow
:
false
,
availableFileSystems
:
[
Schemas
.
file
]
});
};
}
}
export
namespace
OpenLocalFileFolderCommand
{
export
const
ID
=
'
workbench.action.files.openLocalFileFolder
'
;
export
const
LABEL
=
nls
.
localize
(
'
openLocalFileFolder
'
,
"
Open Local...
"
);
export
function
handler
():
ICommandHandler
{
return
accessor
=>
{
const
dialogService
=
accessor
.
get
(
IFileDialogService
);
return
dialogService
.
pickFileFolderAndOpen
({
forceNewWindow
:
false
,
availableFileSystems
:
[
Schemas
.
file
]
});
};
}
}
interface
FileQuickPickItem
extends
IQuickPickItem
{
uri
:
URI
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录