@@ -4,17 +4,15 @@ import {
44} from '@jupyterlab/application' ;
55import { CodeEditor } from '@jupyterlab/codeeditor' ;
66import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
7- import { ITranslator , TranslationBundle } from '@jupyterlab/translation' ;
87import { LabIcon } from '@jupyterlab/ui-components' ;
98import { Debouncer } from '@lumino/polling' ;
109import type * as CodeMirror from 'codemirror' ;
1110import type * as lsProtocol from 'vscode-languageserver-protocol' ;
1211
13- import highlightTypeSvg from '../../style/icons/highlight-type.svg' ;
1412import highlightSvg from '../../style/icons/highlight.svg' ;
1513import { CodeHighlights as LSPHighlightsSettings } from '../_highlights' ;
1614import { CodeMirrorIntegration } from '../editor_integration/codemirror' ;
17- import { FeatureSettings , IFeatureCommand } from '../feature' ;
15+ import { FeatureSettings } from '../feature' ;
1816import { DocumentHighlightKind } from '../lsp' ;
1917import { IRootPosition , IVirtualPosition } from '../positioning' ;
2018import { ILSPFeatureManager , PLUGIN_ID } from '../tokens' ;
@@ -25,32 +23,6 @@ export const highlightIcon = new LabIcon({
2523 svgstr : highlightSvg
2624} ) ;
2725
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-
5426export class HighlightsCM extends CodeMirrorIntegration {
5527 protected highlight_markers : CodeMirror . TextMarker [ ] = [ ] ;
5628 private debounced_get_highlight : Debouncer <
@@ -240,24 +212,21 @@ const FEATURE_ID = PLUGIN_ID + ':highlights';
240212
241213export const HIGHLIGHTS_PLUGIN : JupyterFrontEndPlugin < void > = {
242214 id : FEATURE_ID ,
243- requires : [ ILSPFeatureManager , ISettingRegistry , ITranslator ] ,
215+ requires : [ ILSPFeatureManager , ISettingRegistry ] ,
244216 autoStart : true ,
245217 activate : (
246218 app : JupyterFrontEnd ,
247219 featureManager : ILSPFeatureManager ,
248- settingRegistry : ISettingRegistry ,
249- translator : ITranslator
220+ settingRegistry : ISettingRegistry
250221 ) => {
251222 const settings = new FeatureSettings ( settingRegistry , FEATURE_ID ) ;
252- const trans = translator . load ( 'jupyterlab_lsp' ) ;
253223
254224 featureManager . register ( {
255225 feature : {
256226 editorIntegrationFactory : new Map ( [ [ 'CodeMirrorEditor' , HighlightsCM ] ] ) ,
257227 id : FEATURE_ID ,
258228 name : 'LSP Highlights' ,
259- settings : settings ,
260- commands : COMMANDS ( trans )
229+ settings : settings
261230 }
262231 } ) ;
263232 }
0 commit comments