Skip to content

Commit 3c64a2d

Browse files
committed
Remove unused highlight commands and highlight type icon
1 parent 14ece08 commit 3c64a2d

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

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

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ import {
44
} from '@jupyterlab/application';
55
import { CodeEditor } from '@jupyterlab/codeeditor';
66
import { ISettingRegistry } from '@jupyterlab/settingregistry';
7-
import { ITranslator, TranslationBundle } from '@jupyterlab/translation';
87
import { LabIcon } from '@jupyterlab/ui-components';
98
import { Debouncer } from '@lumino/polling';
109
import type * as CodeMirror from 'codemirror';
1110
import type * as lsProtocol from 'vscode-languageserver-protocol';
1211

13-
import highlightTypeSvg from '../../style/icons/highlight-type.svg';
1412
import highlightSvg from '../../style/icons/highlight.svg';
1513
import { CodeHighlights as LSPHighlightsSettings } from '../_highlights';
1614
import { CodeMirrorIntegration } from '../editor_integration/codemirror';
17-
import { FeatureSettings, IFeatureCommand } from '../feature';
15+
import { FeatureSettings } from '../feature';
1816
import { DocumentHighlightKind } from '../lsp';
1917
import { IRootPosition, IVirtualPosition } from '../positioning';
2018
import { 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-
5426
export 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

241213
export 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
}

packages/jupyterlab-lsp/style/icons/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ respective license holders:
99
- [rename.svg](./rename.svg) by Austin Andrews (Templarian)
1010
- [hover.svg](./hover.svg) by Austin Andrews (Templarian)
1111
- [completion.svg](./completion.svg): based on `format-list-bulleted-type` by Austin Andrews (Templarian)
12-
- [highlight-type.svg](./highlight-type.svg) a derivative of `marker` by Google and `alpha-t` by GreenTurtwig
1312

1413
Following icons are derivative works of the `code-tags-check icon` by Simran (XT3000) and:
1514

packages/jupyterlab-lsp/style/icons/highlight-type.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)