Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
58987c21
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,发现更多精彩内容 >>
提交
58987c21
编写于
4月 27, 2020
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix error when invoking `explorer.newFile` while explorer viewlet is collapsed
fixes #96196
上级
457ce3ff
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
14 addition
and
11 deletion
+14
-11
src/vs/workbench/contrib/files/browser/explorerViewlet.ts
src/vs/workbench/contrib/files/browser/explorerViewlet.ts
+5
-5
src/vs/workbench/contrib/files/browser/fileActions.ts
src/vs/workbench/contrib/files/browser/fileActions.ts
+4
-5
src/vs/workbench/contrib/files/browser/views/explorerView.ts
src/vs/workbench/contrib/files/browser/views/explorerView.ts
+0
-1
src/vs/workbench/contrib/files/common/files.ts
src/vs/workbench/contrib/files/common/files.ts
+5
-0
未找到文件。
src/vs/workbench/contrib/files/browser/explorerViewlet.ts
浏览文件 @
58987c21
...
...
@@ -6,7 +6,7 @@
import
'
vs/css!./media/explorerviewlet
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
VIEWLET_ID
,
ExplorerViewletVisibleContext
,
IFilesConfiguration
,
OpenEditorsVisibleContext
}
from
'
vs/workbench/contrib/files/common/files
'
;
import
{
VIEWLET_ID
,
ExplorerViewletVisibleContext
,
IFilesConfiguration
,
OpenEditorsVisibleContext
,
VIEW_ID
}
from
'
vs/workbench/contrib/files/common/files
'
;
import
{
IViewletViewOptions
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
IConfigurationService
,
IConfigurationChangeEvent
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ExplorerView
}
from
'
vs/workbench/contrib/files/browser/views/explorerView
'
;
...
...
@@ -136,7 +136,7 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
private
createExplorerViewDescriptor
():
IViewDescriptor
{
return
{
id
:
ExplorerView
.
ID
,
id
:
VIEW_
ID
,
name
:
localize
(
'
folders
'
,
"
Folders
"
),
containerIcon
:
Codicon
.
files
.
classNames
,
ctorDescriptor
:
new
SyncDescriptor
(
ExplorerView
),
...
...
@@ -191,7 +191,7 @@ export class ExplorerViewPaneContainer extends ViewPaneContainer {
}
protected
createView
(
viewDescriptor
:
IViewDescriptor
,
options
:
IViewletViewOptions
):
ViewPane
{
if
(
viewDescriptor
.
id
===
ExplorerView
.
ID
)
{
if
(
viewDescriptor
.
id
===
VIEW_
ID
)
{
// Create a delegating editor service for the explorer to be able to delay the refresh in the opened
// editors view above. This is a workaround for being able to double click on a file to make it pinned
// without causing the animation in the opened editors view to kick in and change scroll position.
...
...
@@ -232,7 +232,7 @@ export class ExplorerViewPaneContainer extends ViewPaneContainer {
}
public
getExplorerView
():
ExplorerView
{
return
<
ExplorerView
>
this
.
getView
(
ExplorerView
.
ID
);
return
<
ExplorerView
>
this
.
getView
(
VIEW_
ID
);
}
public
getOpenEditorsView
():
OpenEditorsView
{
...
...
@@ -245,7 +245,7 @@ export class ExplorerViewPaneContainer extends ViewPaneContainer {
}
focus
():
void
{
const
explorerView
=
this
.
getView
(
ExplorerView
.
ID
);
const
explorerView
=
this
.
getView
(
VIEW_
ID
);
if
(
explorerView
?.
isExpanded
())
{
explorerView
.
focus
();
}
else
{
...
...
src/vs/workbench/contrib/files/browser/fileActions.ts
浏览文件 @
58987c21
...
...
@@ -13,7 +13,7 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
VIEWLET_ID
,
IExplorerService
,
IFilesConfiguration
}
from
'
vs/workbench/contrib/files/common/files
'
;
import
{
VIEWLET_ID
,
IExplorerService
,
IFilesConfiguration
,
VIEW_ID
}
from
'
vs/workbench/contrib/files/common/files
'
;
import
{
ITextFileService
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
toResource
,
SideBySideEditor
,
IEditorInput
}
from
'
vs/workbench/common/editor
'
;
...
...
@@ -51,6 +51,7 @@ import { IEditorOptions } from 'vs/platform/editor/common/editor';
import
{
IEditorGroup
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
openEditorWith
}
from
'
vs/workbench/contrib/files/common/openWith
'
;
import
{
IViewsService
}
from
'
vs/workbench/common/views
'
;
export
const
NEW_FILE_COMMAND_ID
=
'
explorer.newFile
'
;
export
const
NEW_FILE_LABEL
=
nls
.
localize
(
'
newFile
'
,
"
New File
"
);
...
...
@@ -93,7 +94,6 @@ export class NewFileAction extends Action {
static
readonly
LABEL
=
nls
.
localize
(
'
createNewFile
'
,
"
New File
"
);
constructor
(
@
IExplorerService
explorerService
:
IExplorerService
,
@
ICommandService
private
commandService
:
ICommandService
)
{
super
(
'
explorer.newFile
'
,
NEW_FILE_LABEL
);
...
...
@@ -111,7 +111,6 @@ export class NewFolderAction extends Action {
static
readonly
LABEL
=
nls
.
localize
(
'
createNewFolder
'
,
"
New Folder
"
);
constructor
(
@
IExplorerService
explorerService
:
IExplorerService
,
@
ICommandService
private
commandService
:
ICommandService
)
{
super
(
'
explorer.newFolder
'
,
NEW_FOLDER_LABEL
);
...
...
@@ -915,10 +914,10 @@ async function openExplorerAndCreate(accessor: ServicesAccessor, isFolder: boole
const
fileService
=
accessor
.
get
(
IFileService
);
const
textFileService
=
accessor
.
get
(
ITextFileService
);
const
editorService
=
accessor
.
get
(
IEditorService
);
const
view
letService
=
accessor
.
get
(
IViewlet
Service
);
const
view
sService
=
accessor
.
get
(
IViews
Service
);
const
notificationService
=
accessor
.
get
(
INotificationService
);
await
view
letService
.
openViewlet
(
VIEWLET
_ID
,
true
);
await
view
sService
.
openView
(
VIEW
_ID
,
true
);
const
stats
=
explorerService
.
getContext
(
false
);
const
stat
=
stats
.
length
>
0
?
stats
[
0
]
:
undefined
;
...
...
src/vs/workbench/contrib/files/browser/views/explorerView.ts
浏览文件 @
58987c21
...
...
@@ -123,7 +123,6 @@ export function getContext(focus: ExplorerItem[], selection: ExplorerItem[], res
}
export
class
ExplorerView
extends
ViewPane
{
static
readonly
ID
:
string
=
'
workbench.explorer.fileView
'
;
static
readonly
TREE_VIEW_STATE_STORAGE_KEY
:
string
=
'
workbench.explorer.treeViewState
'
;
private
tree
!
:
WorkbenchCompressibleAsyncDataTree
<
ExplorerItem
|
ExplorerItem
[],
ExplorerItem
,
FuzzyScore
>
;
...
...
src/vs/workbench/contrib/files/common/files.ts
浏览文件 @
58987c21
...
...
@@ -28,6 +28,11 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
*/
export
const
VIEWLET_ID
=
'
workbench.view.explorer
'
;
/**
* Explorer file view id.
*/
export
const
VIEW_ID
=
'
workbench.explorer.fileView
'
;
/**
* Id of the default editor for open with.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录