Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
49ebc84e
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,发现更多精彩内容 >>
提交
49ebc84e
编写于
2月 17, 2020
作者:
R
rebornix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
No latex handler in core.
上级
14170909
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
10 addition
and
57 deletion
+10
-57
extensions/notebook-renderers/nteract/readme.md
extensions/notebook-renderers/nteract/readme.md
+2
-1
src/vs/workbench/api/browser/mainThreadNotebook.ts
src/vs/workbench/api/browser/mainThreadNotebook.ts
+0
-10
src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
...rkbench/contrib/notebook/browser/notebook.contribution.ts
+1
-1
src/vs/workbench/contrib/notebook/browser/notebookActions.ts
src/vs/workbench/contrib/notebook/browser/notebookActions.ts
+4
-4
src/vs/workbench/contrib/notebook/browser/notebookService.ts
src/vs/workbench/contrib/notebook/browser/notebookService.ts
+2
-4
src/vs/workbench/contrib/notebook/browser/renderers/mdRenderer.ts
...orkbench/contrib/notebook/browser/renderers/mdRenderer.ts
+1
-37
未找到文件。
extensions/notebook-renderers/nteract/readme.md
浏览文件 @
49ebc84e
...
...
@@ -300,6 +300,8 @@ With above list
-
priority list
-
renders for custom mimetypes --> primitives
-
*!*
strongly typed output. Currently output is
`any`
, but we can define a fixed list of mimetypes which can be rendered in the core
-
renders for primitives (initially provided by the core)
...
...
@@ -307,7 +309,6 @@ With above list
# MISC
-
preload resources types: (script, css, font?)
-
strongly typed output. Currently output is
`any`
, but we can define a fixed list of mimetypes which can be rendered in the core
-
kernel adapter -- local/remote runtime
-
perf
-
forced reflow in
`CodeEditorWidget.ContentWidget`
https://github.com/microsoft/vscode/blob/20f4cbf4b6e585a15751effe59ab40e180d11b43/src/vs/editor/browser/viewParts/contentWidgets/contentWidgets.ts#L437-L441
...
...
src/vs/workbench/api/browser/mainThreadNotebook.ts
浏览文件 @
49ebc84e
...
...
@@ -312,12 +312,6 @@ export class MainThreadNotebookController implements IMainNotebookController {
document
?.
updateCells
(
cells
);
}
updateNotebookCell
(
resource
:
UriComponents
,
cell
:
ICell
,
renderers
:
number
[]):
void
{
let
document
=
this
.
_mapping
.
get
(
URI
.
from
(
resource
).
toString
());
document
?.
updateRenderers
(
renderers
);
document
?.
updateCell
(
cell
);
}
updateNotebookRenderers
(
resource
:
UriComponents
,
renderers
:
number
[]):
void
{
let
document
=
this
.
_mapping
.
get
(
URI
.
from
(
resource
).
toString
());
document
?.
updateRenderers
(
renderers
);
...
...
@@ -351,10 +345,6 @@ export class MainThreadNotebookController implements IMainNotebookController {
}
}
// async latexRenderer(value: string): Promise<IMarkdownString | undefined> {
// return this._proxy.$latexRenderer(this._viewType, value);
// }
async
destoryNotebookDocument
(
notebook
:
INotebook
):
Promise
<
void
>
{
let
document
=
this
.
_mapping
.
get
(
URI
.
from
(
notebook
.
uri
).
toString
());
...
...
src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts
浏览文件 @
49ebc84e
...
...
@@ -68,7 +68,7 @@ export class NotebookContribution implements IWorkbenchContribution {
let
viewType
:
string
|
undefined
=
undefined
;
if
(
resource
)
{
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
(
resource
!
);
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
Providers
(
resource
!
);
if
(
notebookProviders
.
length
>
0
)
{
viewType
=
notebookProviders
[
0
].
id
;
...
...
src/vs/workbench/contrib/notebook/browser/notebookActions.ts
浏览文件 @
49ebc84e
...
...
@@ -36,7 +36,7 @@ export class ExecuteNotebookCellAction extends Action {
let
resource
=
this
.
editorService
.
activeEditor
?.
getResource
();
if
(
resource
)
{
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
(
resource
!
);
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
Providers
(
resource
!
);
if
(
notebookProviders
.
length
>
0
)
{
let
viewType
=
notebookProviders
[
0
].
id
;
...
...
@@ -64,7 +64,7 @@ export class ExecuteNotebookAction extends Action {
let
resource
=
this
.
editorService
.
activeEditor
?.
getResource
();
if
(
resource
)
{
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
(
resource
!
);
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
Providers
(
resource
!
);
if
(
notebookProviders
.
length
>
0
)
{
let
viewType
=
notebookProviders
[
0
].
id
;
...
...
@@ -95,7 +95,7 @@ export class QuitNotebookEditAction extends Action {
let
editorControl
=
this
.
editorService
.
activeControl
;
if
(
resource
&&
editorControl
)
{
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
(
resource
!
);
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
Providers
(
resource
!
);
if
(
notebookProviders
.
length
>
0
)
{
let
editorViewType
=
(
editorControl
!
as
NotebookEditor
).
viewType
;
...
...
@@ -132,7 +132,7 @@ export class EditNotebookCellAction extends Action {
let
editorControl
=
this
.
editorService
.
activeControl
;
if
(
resource
&&
editorControl
)
{
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
(
resource
!
);
let
notebookProviders
=
this
.
notebookService
.
getContributedNotebook
Providers
(
resource
!
);
if
(
notebookProviders
.
length
>
0
)
{
let
editorViewType
=
(
editorControl
!
as
NotebookEditor
).
viewType
;
...
...
src/vs/workbench/contrib/notebook/browser/notebookService.ts
浏览文件 @
49ebc84e
...
...
@@ -51,7 +51,6 @@ export interface IMainNotebookController {
deleteCell
(
uri
:
URI
,
index
:
number
):
Promise
<
boolean
>
executeNotebookActiveCell
(
uri
:
URI
):
void
;
destoryNotebookDocument
(
notebook
:
INotebook
):
Promise
<
void
>
;
// latexRenderer(value: string): Promise<IMarkdownString | undefined>;
}
export
interface
INotebookService
{
...
...
@@ -65,14 +64,13 @@ export interface INotebookService {
resolveNotebook
(
viewType
:
string
,
uri
:
URI
):
Promise
<
INotebook
|
undefined
>
;
executeNotebook
(
viewType
:
string
,
uri
:
URI
):
Promise
<
void
>
;
executeNotebookActiveCell
(
viewType
:
string
,
uri
:
URI
):
Promise
<
void
>
;
getContributedNotebook
(
resource
:
URI
):
readonly
NotebookProviderInfo
[];
getContributedNotebook
Providers
(
resource
:
URI
):
readonly
NotebookProviderInfo
[];
getNotebookProviderResourceRoots
():
URI
[];
updateNotebookActiveCell
(
viewType
:
string
,
resource
:
URI
,
cellHandle
:
number
):
void
;
createNotebookCell
(
viewType
:
string
,
resource
:
URI
,
index
:
number
,
language
:
string
,
type
:
'
markdown
'
|
'
code
'
):
Promise
<
ICell
|
undefined
>
;
deleteNotebookCell
(
viewType
:
string
,
resource
:
URI
,
index
:
number
):
Promise
<
boolean
>
;
destoryNotebookDocument
(
viewType
:
string
,
notebook
:
INotebook
):
void
;
updateActiveNotebookDocument
(
viewType
:
string
,
resource
:
URI
):
void
;
// latexRenderer(viewType: string, value: string): Promise<IMarkdownString | undefined>;
}
export
class
NotebookInfoStore
{
...
...
@@ -233,7 +231,7 @@ export class NotebookService extends Disposable implements INotebookService {
}
}
getContributedNotebook
(
resource
:
URI
):
readonly
NotebookProviderInfo
[]
{
getContributedNotebook
Providers
(
resource
:
URI
):
readonly
NotebookProviderInfo
[]
{
return
this
.
notebookProviderInfoStore
.
getContributedNotebook
(
resource
);
}
...
...
src/vs/workbench/contrib/notebook/browser/renderers/mdRenderer.ts
浏览文件 @
49ebc84e
...
...
@@ -12,9 +12,6 @@ import { tokenizeToString } from 'vs/editor/common/modes/textToHtmlTokenizer';
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
DisposableStore
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
TokenizationRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
INotebookService
}
from
'
vs/workbench/contrib/notebook/browser/notebookService
'
;
import
*
as
colorRegistry
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
export
interface
IMarkdownRenderResult
extends
IDisposable
{
element
:
HTMLElement
;
...
...
@@ -25,29 +22,12 @@ export class MarkdownRenderer extends Disposable {
private
_onDidUpdateRender
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidUpdateRender
:
Event
<
void
>
=
this
.
_onDidUpdateRender
.
event
;
private
_styles
:
{
[
key
:
string
]:
string
;
};
private
_latexCache
:
{
[
key
:
string
]:
string
};
constructor
(
private
readonly
viewType
:
string
,
@
IModeService
private
readonly
_modeService
:
IModeService
,
@
IOpenerService
private
readonly
_openerService
:
IOpenerService
,
@
INotebookService
private
readonly
_notebookService
:
INotebookService
,
@
IThemeService
private
readonly
_themeService
:
IThemeService
,
@
IOpenerService
private
readonly
_openerService
:
IOpenerService
)
{
super
();
let
theme
=
this
.
_themeService
.
getTheme
();
this
.
_styles
=
colorRegistry
.
getColorRegistry
().
getColors
().
reduce
((
colors
,
entry
)
=>
{
const
color
=
theme
.
getColor
(
entry
.
id
);
if
(
color
)
{
colors
[
'
vscode-
'
+
entry
.
id
.
replace
(
'
.
'
,
'
-
'
)]
=
color
.
toString
();
}
return
colors
;
},
{}
as
{
[
key
:
string
]:
string
;
});
this
.
_latexCache
=
{};
}
private
getOptions
(
disposeables
:
DisposableStore
):
MarkdownRenderOptions
{
...
...
@@ -71,22 +51,6 @@ export class MarkdownRenderer extends Disposable {
});
},
codeBlockRenderCallback
:
()
=>
this
.
_onDidUpdateRender
.
fire
(),
latexRenderer
:
async
(
value
)
=>
{
if
(
this
.
_latexCache
[
value
])
{
return
{
html
:
this
.
_latexCache
[
value
],
styles
:
this
.
_styles
};
}
let
res
=
await
this
.
_notebookService
.
latexRenderer
(
this
.
viewType
,
value
);
if
(
res
)
{
let
innerHTML
=
renderMarkdown
(
res
,
{},
{
gfm
:
true
}).
innerHTML
;
this
.
_latexCache
[
value
]
=
innerHTML
;
return
{
html
:
innerHTML
,
styles
:
this
.
_styles
};
}
else
{
return
{
html
:
`<span>
${
value
}
</span>`
};
}
},
latexRendererCallback
:
()
=>
this
.
_onDidUpdateRender
.
fire
(),
actionHandler
:
{
callback
:
(
content
)
=>
{
this
.
_openerService
.
open
(
content
,
{
fromUserGesture
:
true
}).
catch
(
onUnexpectedError
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录