File tree Expand file tree Collapse file tree 5 files changed +30
-3
lines changed
jupyterlab-lsp/src/features/completion
python_packages/jupyter_lsp Expand file tree Collapse file tree 5 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 1
1
## CHANGELOG
2
2
3
+ ### ` @krassowski/jupyterlab-lsp 3.3.1 ` (unreleased)
4
+
5
+ - bug fixes:
6
+
7
+ - LaTeX is now rendered in documentation panel of completer ([ #506 ] )
8
+ - completion response returned as plain text use pre tag to retain whitespace formatting ([ #506 ] )
9
+ - pre-formatted code font size was reduced to match font-size of the text in completion panel ([ #506 ] )
10
+
11
+ [ #506 ] : https://github.com/krassowski/jupyterlab-lsp/pull/506
12
+
3
13
### ` jupyter-lsp 1.1.3 ` (unreleased)
4
14
5
15
- features:
6
16
7
17
- add config for the classic notebook server extension ([ #504 ] )
8
18
19
+ [ #504 ] : https://github.com/krassowski/jupyterlab-lsp/pull/504
20
+
9
21
### ` @krassowski/jupyterlab-lsp 3.3.0 ` (2021-01-31)
10
22
11
23
- features:
Original file line number Diff line number Diff line change 28
28
content : 'Loading...' ;
29
29
color : # 7f7f7f ;
30
30
}
31
+
32
+ /* a workaround for code being larger font size than text in markdown-rendered panel */
33
+ .jp-Completer-docpanel pre code {
34
+ font-size : 90% ;
35
+ }
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ export class CompletionLabIntegration implements IFeatureLabIntegration {
99
99
this . renderer = new LSPCompletionRenderer ( {
100
100
integrator : this ,
101
101
markdownRenderer : markdown_renderer ,
102
+ latexTypesetter : this . renderMimeRegistry . latexTypesetter ,
102
103
console : console . scope ( 'renderer' )
103
104
} ) ;
104
105
this . renderer . activeChanged . connect ( this . active_completion_changed , this ) ;
Original file line number Diff line number Diff line change @@ -52,21 +52,29 @@ export class LSPCompletionRenderer
52
52
53
53
createDocumentationNode ( item : LazyCompletionItem ) : HTMLElement {
54
54
if ( item . isDocumentationMarkdown ) {
55
+ let documentation = item . documentation ;
55
56
this . options . markdownRenderer
56
57
. renderModel ( {
57
58
data : {
58
- 'text/markdown' : item . documentation
59
+ 'text/markdown' : documentation
59
60
} ,
60
61
trusted : false ,
61
62
metadata : { } ,
62
63
setData ( options : IRenderMime . IMimeModel . ISetDataOptions ) {
63
64
// empty
64
65
}
65
66
} )
67
+ . then ( ( ) => {
68
+ if ( this . options . latexTypesetter && documentation . includes ( '$' ) ) {
69
+ this . options . latexTypesetter . typeset (
70
+ this . options . markdownRenderer . node
71
+ ) ;
72
+ }
73
+ } )
66
74
. catch ( this . options . console . warn ) ;
67
75
return this . options . markdownRenderer . node ;
68
76
} else {
69
- let node = document . createElement ( 'div ' ) ;
77
+ let node = document . createElement ( 'pre ' ) ;
70
78
node . textContent = item . documentation ;
71
79
return node ;
72
80
}
@@ -77,6 +85,7 @@ export namespace LSPCompletionRenderer {
77
85
export interface IOptions {
78
86
integrator : CompletionLabIntegration ;
79
87
markdownRenderer : IRenderMime . IRenderer ;
88
+ latexTypesetter ?: IRenderMime . ILatexTypesetter ;
80
89
console : ILSPLogConsole ;
81
90
}
82
91
}
Original file line number Diff line number Diff line change 20
20
(
21
21
"etc/jupyter/jupyter_notebook_config.d" ,
22
22
["jupyter_lsp/etc/jupyter_notebook_config.json" ],
23
- )
23
+ ),
24
24
],
25
25
)
You can’t perform that action at this time.
0 commit comments