@@ -7,6 +7,7 @@ import { ILSPFeatureManager, PLUGIN_ID } from '../tokens';
7
7
import { LabIcon } from '@jupyterlab/ui-components' ;
8
8
import syntaxSvg from '../../style/icons/syntax-highlight.svg' ;
9
9
import {
10
+ FeatureSettings ,
10
11
IEditorIntegrationOptions ,
11
12
IFeatureLabIntegration ,
12
13
IFeatureSettings
@@ -17,13 +18,14 @@ import CodeMirror from 'codemirror';
17
18
import { IEditorMimeTypeService } from '@jupyterlab/codeeditor/lib/mimetype' ;
18
19
import { IEditorServices } from '@jupyterlab/codeeditor/lib/tokens' ;
19
20
import { CodeSyntax as LSPSyntaxHighlightingSettings } from '../_syntax_highlighting' ;
21
+ import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
20
22
21
23
export const syntaxHighlightingIcon = new LabIcon ( {
22
24
name : 'lsp:syntax-highlighting' ,
23
25
svgstr : syntaxSvg
24
26
} ) ;
25
27
26
- const FEATURE_ID = PLUGIN_ID + ':syntax-highlighting ' ;
28
+ const FEATURE_ID = PLUGIN_ID + ':syntax_highlighting ' ;
27
29
28
30
export class CMSyntaxHighlighting extends CodeMirrorIntegration {
29
31
lab_integration : SyntaxLabIntegration ;
@@ -91,13 +93,16 @@ class SyntaxLabIntegration implements IFeatureLabIntegration {
91
93
92
94
export const SYNTAX_HIGHLIGHTING_PLUGIN : JupyterFrontEndPlugin < void > = {
93
95
id : FEATURE_ID ,
94
- requires : [ ILSPFeatureManager , IEditorServices ] ,
96
+ requires : [ ILSPFeatureManager , IEditorServices , ISettingRegistry ] ,
95
97
autoStart : true ,
96
98
activate : (
97
99
app : JupyterFrontEnd ,
98
100
featureManager : ILSPFeatureManager ,
99
- editorServices : IEditorServices
101
+ editorServices : IEditorServices ,
102
+ settingRegistry : ISettingRegistry
100
103
) => {
104
+ const settings = new FeatureSettings ( settingRegistry , FEATURE_ID ) ;
105
+
101
106
featureManager . register ( {
102
107
feature : {
103
108
editorIntegrationFactory : new Map ( [
@@ -106,7 +111,10 @@ export const SYNTAX_HIGHLIGHTING_PLUGIN: JupyterFrontEndPlugin<void> = {
106
111
commands : [ ] ,
107
112
id : FEATURE_ID ,
108
113
name : 'Syntax highlighting' ,
109
- labIntegration : new SyntaxLabIntegration ( editorServices . mimeTypeService )
114
+ labIntegration : new SyntaxLabIntegration (
115
+ editorServices . mimeTypeService
116
+ ) ,
117
+ settings : settings
110
118
}
111
119
} ) ;
112
120
}
0 commit comments