Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e43c3957
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e43c3957
编写于
6月 03, 2021
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename onDidChangeNotebookAssociation to onDidChangeSelectedNotebooks
上级
41f11775
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
15 deletion
+16
-15
.vscode/searches/api-todos.code-search
.vscode/searches/api-todos.code-search
+1
-5
extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts
.../vscode-api-tests/src/singlefolder-tests/notebook.test.ts
+1
-1
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+11
-6
src/vs/workbench/api/common/extHostNotebookKernels.ts
src/vs/workbench/api/common/extHostNotebookKernels.ts
+1
-1
src/vs/workbench/contrib/notebook/test/notebookKernelService.test.ts
...bench/contrib/notebook/test/notebookKernelService.test.ts
+2
-2
未找到文件。
.vscode/searches/api-todos.code-search
浏览文件 @
e43c3957
...
...
@@ -2,13 +2,9 @@
# Including: */vscode.d.ts
# ContextLines: 1
2 results
- 1 file
1 result
- 1 file
src/vs/vscode.d.ts:
11804 */
11805: //todo@API inline?
11806 export interface NotebookExecuteHandler {
11935 */
11936: //todo@api selected vs associated, jsdoc
11937 readonly onDidChangeNotebookAssociation: Event<{ notebook: NotebookDocument, selected: boolean }>;
extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts
浏览文件 @
e43c3957
...
...
@@ -40,7 +40,7 @@ class Kernel {
this
.
controller
.
executeHandler
=
this
.
_execute
.
bind
(
this
);
this
.
controller
.
supportsExecutionOrder
=
true
;
this
.
controller
.
supportedLanguages
=
[
'
typescript
'
,
'
javascript
'
];
this
.
controller
.
onDidChange
NotebookAssociation
(
e
=>
{
this
.
controller
.
onDidChange
SelectedNotebooks
(
e
=>
{
if
(
e
.
selected
)
{
this
.
associatedNotebooks
.
add
(
e
.
notebook
.
uri
.
toString
());
}
else
{
...
...
src/vs/vscode.d.ts
浏览文件 @
e43c3957
...
...
@@ -11834,7 +11834,8 @@ declare module 'vscode' {
* There can be multiple controllers and the editor will let users choose which controller to use for a certain notebook. The
* {@link NotebookController.notebookType `notebookType`}-property defines for what kind of notebooks a controller is for and
* the {@link NotebookController.updateNotebookAffinity `updateNotebookAffinity`}-function allows controllers to set a preference
* for specific notebook documents.
* for specific notebook documents. When a controller has been selected its
* {@link NotebookController.onDidChangeSelectedNotebooks onDidChangeSelectedNotebooks}-event fires.
*
* When a cell is being run the editor will invoke the {@link NotebookController.executeHandler `executeHandler`} and a controller
* is expected to create and finalize a {@link NotebookCellExecution notebook cell execution}. However, controllers are also free
...
...
@@ -11929,12 +11930,16 @@ declare module 'vscode' {
interruptHandler
?:
(
notebook
:
NotebookDocument
)
=>
void
|
Thenable
<
void
>
;
/**
* An event that fires whenever a controller has been selected for a notebook document. Selecting a controller
* for a notebook is a user gesture and happens either explicitly or implicitly when interacting while a
* controller was suggested.
* An event that fires whenever a controller has been selected or un-selected for a notebook document.
*
* There can be multiple controllers for a notebook and in that case a controllers needs to be _selected_. This is a user gesture
* and happens either explicitly or implicitly when interacting with a notebook for which a controller was _suggested_. When possible,
* the editor _suggests_ a controller that is most likely to be _selected_.
*
* _Note_ that controller selection is persisted (by the controllers {@link NotebookController.id id}) and restored as soon as a
* controller is re-created or as a notebook is {@link workspace.onDidOpenNotebookDocument opened}.
*/
//todo@api selected vs associated, jsdoc
readonly
onDidChangeNotebookAssociation
:
Event
<
{
notebook
:
NotebookDocument
,
selected
:
boolean
}
>
;
readonly
onDidChangeSelectedNotebooks
:
Event
<
{
notebook
:
NotebookDocument
,
selected
:
boolean
}
>
;
/**
* A controller can set affinities for specific notebook documents. This allows a controller
...
...
src/vs/workbench/api/common/extHostNotebookKernels.ts
浏览文件 @
e43c3957
...
...
@@ -112,7 +112,7 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape {
const
controller
:
vscode
.
NotebookController
=
{
get
id
()
{
return
id
;
},
get
notebookType
()
{
return
data
.
notebookType
;
},
onDidChange
NotebookAssociation
:
onDidChangeSelection
.
event
,
onDidChange
SelectedNotebooks
:
onDidChangeSelection
.
event
,
get
label
()
{
return
data
.
label
;
},
...
...
src/vs/workbench/contrib/notebook/test/notebookKernelService.test.ts
浏览文件 @
e43c3957
...
...
@@ -102,7 +102,7 @@ suite('NotebookKernelService', () => {
assert
.
ok
(
info
.
all
[
1
]
===
kernel
);
});
test
(
'
onDidChange
NotebookAssociation
not fired on initial notebook open #121904
'
,
function
()
{
test
(
'
onDidChange
SelectedNotebooks
not fired on initial notebook open #121904
'
,
function
()
{
const
uri
=
URI
.
parse
(
'
foo:///one
'
);
const
jupyter
=
{
uri
,
viewType
:
'
jupyter
'
};
...
...
@@ -123,7 +123,7 @@ suite('NotebookKernelService', () => {
assert
.
strictEqual
(
info
.
selected
===
jupyterKernel
,
true
);
});
test
(
'
onDidChange
NotebookAssociation
not fired on initial notebook open #121904, p2
'
,
async
function
()
{
test
(
'
onDidChange
SelectedNotebooks
not fired on initial notebook open #121904, p2
'
,
async
function
()
{
const
uri
=
URI
.
parse
(
'
foo:///one
'
);
const
jupyter
=
{
uri
,
viewType
:
'
jupyter
'
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录