@@ -4,17 +4,15 @@ import {
4
4
} from '@jupyterlab/application' ;
5
5
import { CodeEditor } from '@jupyterlab/codeeditor' ;
6
6
import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
7
- import { ITranslator , TranslationBundle } from '@jupyterlab/translation' ;
8
7
import { LabIcon } from '@jupyterlab/ui-components' ;
9
8
import { Debouncer } from '@lumino/polling' ;
10
9
import type * as CodeMirror from 'codemirror' ;
11
10
import type * as lsProtocol from 'vscode-languageserver-protocol' ;
12
11
13
- import highlightTypeSvg from '../../style/icons/highlight-type.svg' ;
14
12
import highlightSvg from '../../style/icons/highlight.svg' ;
15
13
import { CodeHighlights as LSPHighlightsSettings } from '../_highlights' ;
16
14
import { CodeMirrorIntegration } from '../editor_integration/codemirror' ;
17
- import { FeatureSettings , IFeatureCommand } from '../feature' ;
15
+ import { FeatureSettings } from '../feature' ;
18
16
import { DocumentHighlightKind } from '../lsp' ;
19
17
import { IRootPosition , IVirtualPosition } from '../positioning' ;
20
18
import { ILSPFeatureManager , PLUGIN_ID } from '../tokens' ;
@@ -25,32 +23,6 @@ export const highlightIcon = new LabIcon({
25
23
svgstr : highlightSvg
26
24
} ) ;
27
25
28
- export const highlightTypeIcon = new LabIcon ( {
29
- name : 'lsp:highlight-type' ,
30
- svgstr : highlightTypeSvg
31
- } ) ;
32
-
33
- const COMMANDS = ( trans : TranslationBundle ) : IFeatureCommand [ ] => [
34
- {
35
- id : 'highlight-references' ,
36
- execute : ( { connection, virtual_position, document } ) =>
37
- connection ?. getReferences ( virtual_position , document . document_info ) ,
38
- is_enabled : ( { connection } ) =>
39
- connection ? connection . isReferencesSupported ( ) : false ,
40
- label : trans . __ ( 'Highlight references' ) ,
41
- icon : highlightIcon
42
- } ,
43
- {
44
- id : 'highlight-type-definition' ,
45
- execute : ( { connection, virtual_position, document } ) =>
46
- connection ?. getTypeDefinition ( virtual_position , document . document_info ) ,
47
- is_enabled : ( { connection } ) =>
48
- connection ? connection . isTypeDefinitionSupported ( ) : false ,
49
- label : trans . __ ( 'Highlight type definition' ) ,
50
- icon : highlightTypeIcon
51
- }
52
- ] ;
53
-
54
26
export class HighlightsCM extends CodeMirrorIntegration {
55
27
protected highlight_markers : CodeMirror . TextMarker [ ] = [ ] ;
56
28
private debounced_get_highlight : Debouncer <
@@ -240,24 +212,21 @@ const FEATURE_ID = PLUGIN_ID + ':highlights';
240
212
241
213
export const HIGHLIGHTS_PLUGIN : JupyterFrontEndPlugin < void > = {
242
214
id : FEATURE_ID ,
243
- requires : [ ILSPFeatureManager , ISettingRegistry , ITranslator ] ,
215
+ requires : [ ILSPFeatureManager , ISettingRegistry ] ,
244
216
autoStart : true ,
245
217
activate : (
246
218
app : JupyterFrontEnd ,
247
219
featureManager : ILSPFeatureManager ,
248
- settingRegistry : ISettingRegistry ,
249
- translator : ITranslator
220
+ settingRegistry : ISettingRegistry
250
221
) => {
251
222
const settings = new FeatureSettings ( settingRegistry , FEATURE_ID ) ;
252
- const trans = translator . load ( 'jupyterlab_lsp' ) ;
253
223
254
224
featureManager . register ( {
255
225
feature : {
256
226
editorIntegrationFactory : new Map ( [ [ 'CodeMirrorEditor' , HighlightsCM ] ] ) ,
257
227
id : FEATURE_ID ,
258
228
name : 'LSP Highlights' ,
259
- settings : settings ,
260
- commands : COMMANDS ( trans )
229
+ settings : settings
261
230
}
262
231
} ) ;
263
232
}
0 commit comments