Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
11f838c1
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,体验更适合开发者的 AI 搜索 >>
提交
11f838c1
编写于
12月 21, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #112747.
上级
af92a731
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
4 deletion
+23
-4
src/vs/workbench/contrib/notebook/browser/contrib/find/findController.ts
...h/contrib/notebook/browser/contrib/find/findController.ts
+2
-2
src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
...rkbench/contrib/notebook/browser/notebook.contribution.ts
+20
-2
src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
+1
-0
未找到文件。
src/vs/workbench/contrib/notebook/browser/contrib/find/findController.ts
浏览文件 @
11f838c1
...
...
@@ -6,7 +6,7 @@
import
'
vs/css!./media/notebookFind
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IContextKeyService
,
IContextKey
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED
,
INotebookEditor
,
CellFindMatch
,
CellEditState
,
INotebookEditorContribution
,
NOTEBOOK_EDITOR_FOCUSED
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
KEYBINDING_CONTEXT_NOTEBOOK_FIND_WIDGET_FOCUSED
,
INotebookEditor
,
CellFindMatch
,
CellEditState
,
INotebookEditorContribution
,
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_OPEN
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
FindDecorations
}
from
'
vs/editor/contrib/find/findDecorations
'
;
import
{
ModelDecorationOptions
}
from
'
vs/editor/common/model/textModel
'
;
import
{
IModelDeltaDecoration
}
from
'
vs/editor/common/model
'
;
...
...
@@ -385,7 +385,7 @@ registerAction2(class extends Action2 {
id
:
'
notebook.find
'
,
title
:
{
value
:
localize
(
'
notebookActions.findInNotebook
'
,
"
Find in Notebook
"
),
original
:
'
Find in Notebook
'
},
keybinding
:
{
when
:
NOTEBOOK_EDITOR_FOCUSED
,
when
:
ContextKeyExpr
.
or
(
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_EDITOR_OPEN
)
,
primary
:
KeyCode
.
KEY_F
|
KeyMod
.
CtrlCmd
,
weight
:
KeybindingWeight
.
WorkbenchContrib
}
...
...
src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
浏览文件 @
11f838c1
...
...
@@ -31,12 +31,12 @@ import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/browser/noteb
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/common/notebookService
'
;
import
{
NotebookService
}
from
'
vs/workbench/contrib/notebook/browser/notebookServiceImpl
'
;
import
{
CellKind
,
CellToolbarLocKey
,
CellUri
,
DisplayOrderKey
,
getCellUndoRedoComparisonKey
,
NotebookDocumentBackupData
,
NotebookEditorPriority
,
NotebookTextDiffEditorPreview
,
ShowCellStatusBarKey
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IEditorGroup
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorGroup
,
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
IEditorService
,
IOpenEditorOverride
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
CustomEditorsAssociations
,
customEditorsAssociationsSettingId
}
from
'
vs/workbench/services/editor/common/editorOpenWith
'
;
import
{
CustomEditorInfo
}
from
'
vs/workbench/contrib/customEditor/common/customEditor
'
;
import
{
INotebookEditor
,
NotebookEditorOptions
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
INotebookEditor
,
NotebookEditorOptions
,
NOTEBOOK_EDITOR_OPEN
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
IUndoRedoService
}
from
'
vs/platform/undoRedo/common/undoRedo
'
;
import
{
INotebookEditorModelResolverService
,
NotebookModelResolverService
}
from
'
vs/workbench/contrib/notebook/common/notebookEditorModelResolverService
'
;
import
{
ResourceEditorInput
}
from
'
vs/workbench/common/editor/resourceEditorInput
'
;
...
...
@@ -72,6 +72,7 @@ import 'vs/workbench/contrib/notebook/browser/diff/notebookDiffActions';
import
'
vs/workbench/contrib/notebook/browser/view/output/transforms/streamTransform
'
;
import
'
vs/workbench/contrib/notebook/browser/view/output/transforms/errorTransform
'
;
import
'
vs/workbench/contrib/notebook/browser/view/output/transforms/richTransform
'
;
import
{
IContextKey
,
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
/*--------------------------------------------------------------------------------------------- */
...
...
@@ -204,17 +205,22 @@ Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactor
);
export
class
NotebookContribution
extends
Disposable
implements
IWorkbenchContribution
{
private
_notebookEditorIsOpen
:
IContextKey
<
boolean
>
;
constructor
(
@
IContextKeyService
private
readonly
contextKeyService
:
IContextKeyService
,
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
INotebookService
private
readonly
notebookService
:
INotebookService
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IAccessibilityService
private
readonly
_accessibilityService
:
IAccessibilityService
,
@
IEditorGroupsService
private
readonly
editorGroupService
:
IEditorGroupsService
,
@
IUndoRedoService
undoRedoService
:
IUndoRedoService
,
)
{
super
();
this
.
_notebookEditorIsOpen
=
NOTEBOOK_EDITOR_OPEN
.
bindTo
(
this
.
contextKeyService
);
this
.
_register
(
undoRedoService
.
registerUriComparisonKeyComputer
(
CellUri
.
scheme
,
{
getComparisonKey
:
(
uri
:
URI
):
string
=>
{
return
getCellUndoRedoComparisonKey
(
uri
);
...
...
@@ -264,6 +270,18 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri
this
.
notebookService
.
updateActiveNotebookEditor
(
null
);
}
}));
this
.
editorGroupService
.
whenRestored
.
then
(()
=>
this
.
_updateContextKeys
());
this
.
_register
(
this
.
editorService
.
onDidActiveEditorChange
(()
=>
this
.
_updateContextKeys
()));
this
.
_register
(
this
.
editorService
.
onDidVisibleEditorsChange
(()
=>
this
.
_updateContextKeys
()));
this
.
_register
(
this
.
editorGroupService
.
onDidAddGroup
(()
=>
this
.
_updateContextKeys
()));
this
.
_register
(
this
.
editorGroupService
.
onDidRemoveGroup
(()
=>
this
.
_updateContextKeys
()));
}
private
_updateContextKeys
()
{
const
activeEditorPane
=
this
.
editorService
.
activeEditorPane
as
{
isNotebookEditor
?:
boolean
}
|
undefined
;
this
.
_notebookEditorIsOpen
.
set
(
!!
activeEditorPane
?.
isNotebookEditor
);
}
getUserAssociatedEditors
(
resource
:
URI
)
{
...
...
src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
浏览文件 @
11f838c1
...
...
@@ -39,6 +39,7 @@ export const NOTEBOOK_IS_ACTIVE_EDITOR = ContextKeyExpr.equals('activeEditor', '
// Editor keys
export
const
NOTEBOOK_EDITOR_FOCUSED
=
new
RawContextKey
<
boolean
>
(
'
notebookEditorFocused
'
,
false
);
export
const
NOTEBOOK_EDITOR_OPEN
=
new
RawContextKey
<
boolean
>
(
'
notebookEditorOpen
'
,
false
);
export
const
NOTEBOOK_CELL_LIST_FOCUSED
=
new
RawContextKey
<
boolean
>
(
'
notebookCellListFocused
'
,
false
);
export
const
NOTEBOOK_OUTPUT_FOCUSED
=
new
RawContextKey
<
boolean
>
(
'
notebookOutputFocused
'
,
false
);
export
const
NOTEBOOK_EDITOR_EDITABLE
=
new
RawContextKey
<
boolean
>
(
'
notebookEditable
'
,
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录