Skip to content

Commit a87bd4d

Browse files
committed
Fix syntax highlighting settings
1 parent d7d555e commit a87bd4d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/jupyterlab-lsp/schema/syntax_highlighting.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"jupyter.lab.setting-icon": "lsp:syntax-highlight",
2+
"jupyter.lab.setting-icon": "lsp:syntax-highlighting",
33
"jupyter.lab.setting-icon-label": "Language integration",
44
"title": "Code Syntax",
55
"description": "LSP code syntax highlighting settings.",

packages/jupyterlab-lsp/src/features/syntax_highlighting.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ILSPFeatureManager, PLUGIN_ID } from '../tokens';
77
import { LabIcon } from '@jupyterlab/ui-components';
88
import syntaxSvg from '../../style/icons/syntax-highlight.svg';
99
import {
10+
FeatureSettings,
1011
IEditorIntegrationOptions,
1112
IFeatureLabIntegration,
1213
IFeatureSettings
@@ -17,13 +18,14 @@ import CodeMirror from 'codemirror';
1718
import { IEditorMimeTypeService } from '@jupyterlab/codeeditor/lib/mimetype';
1819
import { IEditorServices } from '@jupyterlab/codeeditor/lib/tokens';
1920
import { CodeSyntax as LSPSyntaxHighlightingSettings } from '../_syntax_highlighting';
21+
import { ISettingRegistry } from '@jupyterlab/settingregistry';
2022

2123
export const syntaxHighlightingIcon = new LabIcon({
2224
name: 'lsp:syntax-highlighting',
2325
svgstr: syntaxSvg
2426
});
2527

26-
const FEATURE_ID = PLUGIN_ID + ':syntax-highlighting';
28+
const FEATURE_ID = PLUGIN_ID + ':syntax_highlighting';
2729

2830
export class CMSyntaxHighlighting extends CodeMirrorIntegration {
2931
lab_integration: SyntaxLabIntegration;
@@ -91,13 +93,16 @@ class SyntaxLabIntegration implements IFeatureLabIntegration {
9193

9294
export const SYNTAX_HIGHLIGHTING_PLUGIN: JupyterFrontEndPlugin<void> = {
9395
id: FEATURE_ID,
94-
requires: [ILSPFeatureManager, IEditorServices],
96+
requires: [ILSPFeatureManager, IEditorServices, ISettingRegistry],
9597
autoStart: true,
9698
activate: (
9799
app: JupyterFrontEnd,
98100
featureManager: ILSPFeatureManager,
99-
editorServices: IEditorServices
101+
editorServices: IEditorServices,
102+
settingRegistry: ISettingRegistry
100103
) => {
104+
const settings = new FeatureSettings(settingRegistry, FEATURE_ID);
105+
101106
featureManager.register({
102107
feature: {
103108
editorIntegrationFactory: new Map([
@@ -106,7 +111,10 @@ export const SYNTAX_HIGHLIGHTING_PLUGIN: JupyterFrontEndPlugin<void> = {
106111
commands: [],
107112
id: FEATURE_ID,
108113
name: 'Syntax highlighting',
109-
labIntegration: new SyntaxLabIntegration(editorServices.mimeTypeService)
114+
labIntegration: new SyntaxLabIntegration(
115+
editorServices.mimeTypeService
116+
),
117+
settings: settings
110118
}
111119
});
112120
}

0 commit comments

Comments
 (0)