UNPKG

@krassowski/jupyterlab-lsp

Version:

Language Server Protocol integration for JupyterLab

32 lines 1.2 kB
import { IEditorTracker } from '@jupyterlab/fileeditor'; import { ILSPAdapterManager, PLUGIN_ID } from '../../tokens'; import { FileEditorAdapter } from './file_editor'; export const FileEditorContextMenuEntryPoint = 'file-editor-context-menu'; export const FILE_EDITOR_ADAPTER = { id: PLUGIN_ID + ':FileEditorAdapter', requires: [ILSPAdapterManager], optional: [IEditorTracker], activate(app, adapterManager, fileEditorTracker) { if (fileEditorTracker === null) { console.warn('LSP: no fileEditorTracker - not registering file editor capabilities'); } else { adapterManager.registerAdapterType({ name: 'file_editor', tracker: fileEditorTracker, adapter: FileEditorAdapter, entrypoint: FileEditorContextMenuEntryPoint, get_id(widget) { return widget.id; }, context_menu: { selector: '.jp-FileEditor', rank_group: 0, rank_group_size: 4 } }); } }, autoStart: true }; //# sourceMappingURL=index.js.map