Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add completion settings (Hinterland mode, documentation, suppression) #315

Merged
merged 133 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
49bd4ee
Add completion settings (Hinterland mode, documentation, suppression)
krassowski Aug 11, 2020
128d275
Lint typescript changes
krassowski Aug 11, 2020
a6985c5
Add changelog entry
krassowski Aug 11, 2020
01c9f56
Add settings descriptions (though they do not show up yet)
krassowski Aug 12, 2020
1b66629
Lint plugin
krassowski Aug 12, 2020
6ccd932
Initial work for feature system refactor
krassowski Aug 13, 2020
c9fa9ca
Minor fixes
krassowski Aug 13, 2020
f829fcb
Lint
krassowski Aug 13, 2020
2fcb08d
Refactor completer and signature features
krassowski Aug 13, 2020
0eddcee
Refactor highlights, rename and hover
krassowski Aug 13, 2020
45dc5b1
Refactor diagnostics, split commands into respective files
krassowski Aug 13, 2020
170c573
Fix minor typos and spec files
krassowski Aug 13, 2020
267e615
Fix schema files
krassowski Aug 14, 2020
b700cf2
Implement adapterDisposed and make PLUGIN_ID discoverable
krassowski Aug 14, 2020
05fbf60
Fix autostart, settings, registration & commands
krassowski Aug 14, 2020
7e02a15
Finish notebook completion, clean up document bits
krassowski Aug 14, 2020
6a159ca
Lint everything
krassowski Aug 14, 2020
4d4ccbe
Implement diagnostics message filtering
krassowski Aug 14, 2020
778f9bf
Add feature icons, rename settings
krassowski Aug 14, 2020
114f3c2
Groundwork for token-based adapters (refactor extension and command m…
krassowski Aug 15, 2020
d62ce1f
Split adapters registration into separate plugins
krassowski Aug 15, 2020
ebe1eb4
Remove hard-coded entry-point definitions
krassowski Aug 15, 2020
6f0780b
Split adapters and adapter manager off index, move files around
krassowski Aug 15, 2020
0ae9120
VirtualEditor cleanup: (1) move document creation to adapter (it know…
krassowski Aug 16, 2020
7c476aa
Separate the responsibilities of VirtualEditor & WidgetAdapter,
krassowski Aug 18, 2020
3eb9c4e
Cleanup index.ts
krassowski Aug 18, 2020
c1ebf10
Solve some refactor issues
krassowski Aug 18, 2020
eb50752
Rename the CodeMirror implementation
krassowski Aug 19, 2020
e7c4015
Minor cleanup after renames/refactor fixes
krassowski Aug 19, 2020
49209e7
Refactor some of the tests to adapt to the architectural changes
krassowski Aug 19, 2020
01d99a0
Introduce extension interface, fix a few jest tests
krassowski Aug 19, 2020
25e806f
Restore more jest tests to working condition
krassowski Aug 19, 2020
f269e26
Implement settings mocks for tests
krassowski Aug 19, 2020
efb7e22
Finish fixing jest tests, fix diagnostics message filter
krassowski Aug 19, 2020
032b81d
Add tests for diagnostics filtering settings
krassowski Aug 19, 2020
08618d2
Lint everything
krassowski Aug 19, 2020
54b21fe
Remove CM import in VirtualEditor, correct FileEditor plugin id
krassowski Aug 19, 2020
110c1c5
Fix extension activation, add missing signal
krassowski Aug 19, 2020
75111cf
Register the extension with the adapter manager
krassowski Aug 19, 2020
f6a1533
Connect the feature manager with the adapter manager to restore commands
krassowski Aug 19, 2020
f8c11a8
Polish document updates, command connection and completer connections
krassowski Aug 20, 2020
4421ce7
Lint and improve out-of-range diagnostics guard
krassowski Aug 20, 2020
4e5b2ad
Solve the root cause of #310
krassowski Aug 20, 2020
5e80e49
Port the collapse/expand (caret) and doc icons
krassowski Aug 20, 2020
42b5474
Refactor diagnostics to follow widget adapter-virtual editor responsi…
krassowski Aug 20, 2020
bacc006
Use DocumentLocator in status popover rather than the document id.
krassowski Aug 20, 2020
4537855
Add icon to the feature command interface
krassowski Aug 20, 2020
00448d0
Improve handling of jump targets
krassowski Aug 20, 2020
8798f2d
Fix status message implementation
krassowski Aug 20, 2020
0934d06
Fix rename status handling, only rename if confirmed, improve messages
krassowski Aug 20, 2020
a0bbe11
Make the timer private
krassowski Aug 20, 2020
9caecd8
Remove "additionalProperties:false" following the https://github.com/…
krassowski Aug 20, 2020
15f14fb
Improve rename tests and messages
krassowski Aug 20, 2020
56919c5
Change rename icon, improve command ranks
krassowski Aug 20, 2020
9da6fed
Add highlight icons
krassowski Aug 20, 2020
9f7a3bc
Improve colors of the status icon
krassowski Aug 20, 2020
55a662b
Create directories for diagnostics and completions
krassowski Aug 20, 2020
47cc6fb
Create IFeatureEditorIntegration, document feature-related interfaces
krassowski Aug 20, 2020
4758719
Document the added extension points, update roadmap
krassowski Aug 20, 2020
0ddf1f3
Fix notebooks with markdown/raw cells (filter before mapping)
krassowski Aug 20, 2020
ec38679
Add CHANGELOG entry
krassowski Aug 20, 2020
a06adc4
Simplify and document IVirtualEditor
krassowski Aug 20, 2020
d0aaa0d
Add a note on API being subject to change
krassowski Aug 20, 2020
7136e10
Document IVirtualEditorType
krassowski Aug 20, 2020
1d240ea
Update the icon and title in the jump schema
krassowski Aug 20, 2020
61f69be
Run Azure Pipelines on all PRs
krassowski Aug 21, 2020
5a01ef9
Use escaped wildcard to build CI on all PRs
krassowski Aug 21, 2020
70352bb
Fix jumping in files (correctly infer the current widget id)
krassowski Aug 21, 2020
53c868f
Restore after change to prevent errors, handle the failures
krassowski Aug 21, 2020
ca4e4b3
Fix the language for JavaScript extractor
krassowski Aug 21, 2020
62cc728
Remove CodeMirror import in Virtual document, expose the foreign docu…
krassowski Aug 21, 2020
e2f4895
Try to freeze tectonic
krassowski Aug 21, 2020
b1bbe85
Comment on the pin
krassowski Aug 21, 2020
4b1c47a
Merge pull request #320 from krassowski/tex-ci-experiments
krassowski Aug 22, 2020
d7d555e
Improve syntax highlighting in editors covered by foreign extractors
krassowski Aug 21, 2020
a87bd4d
Fix syntax highlighting settings
krassowski Aug 21, 2020
07a3bf9
Improve the syntax highlight icons composition
krassowski Aug 21, 2020
196242f
Clean up and add changelog entry
krassowski Aug 22, 2020
ea45f0f
Add ILSPCodeExtractorsManager token
krassowski Aug 21, 2020
b447d93
Implement completion icons support
krassowski Aug 22, 2020
78274c9
Lint and clean up
krassowski Aug 22, 2020
c692086
Add icons cache to prevent re-defining lab icons
krassowski Aug 22, 2020
af3dfd2
Attempt to add material icons
krassowski Aug 22, 2020
dd0ea83
Add icon theme id, improve contrast for active items
krassowski Aug 24, 2020
1cb59e3
Implement theme display, improve themes
krassowski Aug 24, 2020
c23266f
Equate icons margin to list padding in the themes dialog
krassowski Aug 24, 2020
090abfb
Split themes into manager package and theme packages
krassowski Aug 25, 2020
85d3db6
Commit updated package.json and yarn.lock
krassowski Aug 26, 2020
666107c
Remove jp-icon-selectable from material icons
krassowski Aug 26, 2020
012b7d2
Use a superposition of alpha-t and code-tags for the TypeParameter icon
krassowski Aug 26, 2020
549c20a
Improve styling in about dialog
krassowski Aug 26, 2020
6a18738
Further improvements to the TypeParameter icon
krassowski Aug 26, 2020
b817a1c
Enforce 16x16 size for all vscode icons (some are 24x24)
krassowski Aug 26, 2020
ed417f5
Hide the text with transparent color, not hidden...
krassowski Aug 26, 2020
2701904
Add completer themes acceptance tests
krassowski Aug 26, 2020
12c1cd6
Lint
krassowski Aug 26, 2020
0064113
Add documentation on adding completer icon themes
krassowski Aug 26, 2020
67b1cc2
Try to use the most recent build of tectonic again
krassowski Aug 26, 2020
edc6e3c
Add new packages to linked packages for CI
krassowski Aug 26, 2020
f989a2b
Add Changelog entry for the icons
krassowski Aug 26, 2020
56d6b05
Try to make dark theme completer test more reliable
krassowski Aug 27, 2020
9aa8f76
Fix the link in the changelog
krassowski Aug 27, 2020
fb90252
Test the completer in FileEditor (& fix related setup issue)
krassowski Aug 27, 2020
f0b1ced
Add a test for syntax highlighting
krassowski Aug 27, 2020
eb85f38
Address review comments
krassowski Aug 28, 2020
83075bb
Rename icons_manager in one last place
krassowski Aug 28, 2020
a60ee5b
Don't show scrollbars when not needed for the completion item documen…
krassowski Aug 28, 2020
ded7c46
Extractors: split defaults, implement ipython-sql, fix html --isolated
krassowski Aug 28, 2020
b849b64
Add ILSPCodeOverridesManager, move implementations to transclusions/
krassowski Aug 29, 2020
b9799e6
Merge pull request #322 from krassowski/completer-icons
krassowski Aug 30, 2020
dfc65f7
Merge branch 'master' into features-refactor
krassowski Aug 30, 2020
3e1afc8
Retry tectonic cache warm up on failures
krassowski Aug 30, 2020
807aae3
Fix race in VirtualDocument.dispose() / async update_documents()
krassowski Aug 30, 2020
b4e91cb
Fix statusbar message pooling data from all editors
krassowski Aug 30, 2020
4236a1c
Update changelog
krassowski Aug 30, 2020
f2ee5eb
Merge branch 'features-refactor' into syntax_higlighting
krassowski Aug 30, 2020
b8f0cc6
Lint cache
krassowski Aug 30, 2020
b9b97b1
Merge pull request #319 from krassowski/syntax_higlighting
krassowski Aug 30, 2020
f3c73ca
Merge branch 'features-refactor' into fix-statusbar-status
krassowski Aug 30, 2020
19123a1
Fix document test file after merge conflict
krassowski Aug 30, 2020
e6e76f9
Merge branch 'features-refactor' into fix-statusbar-status
krassowski Aug 30, 2020
86e696e
Merge branch 'features-refactor' into transclusion-refactor
krassowski Aug 30, 2020
d69b102
Add example.plain file
krassowski Aug 30, 2020
01ea6a9
Merge pull request #329 from krassowski/fix-statusbar-status
krassowski Aug 31, 2020
e6e8c07
Export CODE_OVERRIDES_MANAGER with other plugins
krassowski Aug 31, 2020
a852e87
Merge branch 'features-refactor' into transclusion-refactor
krassowski Aug 31, 2020
8c380f6
Document preferred language ids and register() methods
krassowski Aug 31, 2020
6559be9
Document code replacements and code extractors
krassowski Aug 31, 2020
dbdf2aa
Fix typos in Extending docs
krassowski Aug 31, 2020
c4257b5
Merge pull request #321 from krassowski/transclusion-refactor
krassowski Aug 31, 2020
2b2c115
Merge branch 'features-refactor' into test-new-tectonic-build
krassowski Aug 31, 2020
fab0feb
Merge pull request #323 from krassowski/test-new-tectonic-build
krassowski Aug 31, 2020
d400629
Merge pull request #318 from krassowski/features-refactor
krassowski Aug 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
- support for JupyterLab 2.2 ([#301][])
- completer now displays server-provided documentation,
and a kernel icon for kernel suggestions without type information ([#301][])
- the documentation by the completer can be turned on or off ([#315])
- continuous hinting (Hinterland mode) can be enabled in settings ([#315])
- tokens in which the completer should not be triggered can be changed ([#315])

- bug fixes

- path-autocompletion issues were resolved upstream an this release adopts these changes

[#301]: https://github.com/krassowski/jupyterlab-lsp/pull/301
[#315]: https://github.com/krassowski/jupyterlab-lsp/pull/315

### `@krassowski/jupyterlab-lsp 1.1.2` (2020-08-05)

Expand Down
72 changes: 57 additions & 15 deletions packages/jupyterlab-lsp/schema/plugin.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,58 @@
{
"jupyter.lab.setting-icon": "lsp:diagnostics",
"jupyter.lab.setting-icon-label": "Language integration",
"title": "Language Server",
"description": "Language Server Protocol settings.",
"type": "object",
"definitions": {
"language-server": {
"title": "Language Server",
"description": "Client and server configurations for a single language server",
"type": "object",
"default": {},
"properties": {
"serverSettings": {
"title": "Language Server Configurations",
"description": "Configuration to be sent to language server over LSP when initialized: see the specific language server's documentation for more",
"type": "object",
"default": {}
}
}
},
"features": {
"title": "Code Intelligence Features Configuration",
"description": "Configuration for the implementation of the LSP features",
"type": "object",
"properties": {
"completion": {
"type": "object",
"properties": {
"showDocumentation": {
"type": "boolean",
"default": true,
"description": "Whether to show documentation box next to the completion suggestions."
},
"continuousHinting": {
"type": "boolean",
"default": false,
"description": "Whether to enable continuous hinting (Hinterland mode)."
},
"suppressInvokeIn": {
"type": "array",
krassowski marked this conversation as resolved.
Show resolved Hide resolved
"items": {
"type": "string"
},
"description": "An array of CodeMirror tokens for which the auto-invoke should be suppressed. The token names vary between languages (modes)."
}
}
}
}
}
},
"properties": {
"language_servers": {
"title": "Language Server",
"description": "Language-server specific configuration, keyed by implementation, e.g: \n\npyls: {\n serverSettings: {\n pyls: {\n plugins: {\n pydocstyle: {\n enabled: true\n },\n pyflakes: {\n enabled: false\n },\n flake8: {\n enabled: true\n }\n }\n }\n }\n}\n\nAlternatively, using VSCode's naming convention:\n\npyls: {\n serverSettings: {\n \"pyls.plugins.pydocstyle.enabled\": true,\n \"pyls.plugins.pyflakes.enabled\": false,\n \"pyls.plugins.flake8.enabled\": true\n }\n}",
"type": "object",
krassowski marked this conversation as resolved.
Show resolved Hide resolved
"default": {},
"patternProperties": {
".*": {
Expand All @@ -16,20 +62,16 @@
"additionalProperties": {
"$ref": "#/definitions/language-server"
}
}
},
"definitions": {
"language-server": {
"title": "Language Server",
"description": "Client and server configurations for a single language server",
"type": "object",
"default": {},
"properties": {
"serverSettings": {
"title": "Language Server Configurations",
"description": "Configuration to be sent to language server over LSP when initialized: see the specific language server's documentation for more",
"type": "object",
"default": {}
},
"features": {
"title": "LSP features",
"description": "Client-side features configuration",
"$ref": "#/definitions/features",
"default": {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the defaults are actually preserved all the way down... it might just be the top-level object. would have to check.

Copy link
Member Author

@krassowski krassowski Aug 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, they seem to be preserved - at least in the sense of being correctly displayed in the settings editor; how else can I specify them? propertiescompletion and then default?

"completion": {
"showDocumentation": true,
"continuousHinting": false,
"suppressInvokeIn": ["comment", "string"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import { IRootPosition } from '../../positioning';
import * as CodeMirror from 'codemirror';
import { CodeMirrorLSPFeature } from './feature';
import { FileEditorFeatureTestEnvironment } from './testutils';
import { DummySettings, FileEditorFeatureTestEnvironment } from './testutils';

describe('CodeMirrorAdapter', () => {
let env: FileEditorFeatureTestEnvironment;
Expand Down Expand Up @@ -46,7 +46,8 @@ describe('CodeMirrorAdapter', () => {
virtual_editor.virtual_document,
connection,
dummy_components_manager,
new StatusMessage()
new StatusMessage(),
new DummySettings()
);

let adapter = new CodeMirrorAdapter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { CodeMirrorLSPFeature } from './feature';
import {
code_cell,
DummySettings,
FeatureTestEnvironment,
FileEditorFeatureTestEnvironment,
getCellsJSON,
Expand Down Expand Up @@ -119,7 +120,8 @@ describe('Feature', () => {
virtual_editor.virtual_document,
connection,
dummy_components_manager,
new StatusMessage()
new StatusMessage(),
new DummySettings()
);
}

Expand Down
8 changes: 7 additions & 1 deletion packages/jupyterlab-lsp/src/adapters/codemirror/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export interface ILSPFeature {
): void;
}

export interface IFeatureSettings {
get(setting: string): any;
set(setting: string, value: any): void;
}

export interface IEditorRange {
start: IEditorPosition;
end: IEditorPosition;
Expand Down Expand Up @@ -124,7 +129,8 @@ export abstract class CodeMirrorLSPFeature implements ILSPFeature {
public virtual_document: VirtualDocument,
public connection: LSPConnection,
public jupyterlab_components: IJupyterLabComponentsManager,
public status_message: StatusMessage
public status_message: StatusMessage,
public settings: IFeatureSettings
) {
this.editor_handlers = new Map();
this.connection_handlers = new Map();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ export class Completion extends CodeMirrorLSPFeature {
afterChange(change: CodeMirror.EditorChange): void {
// TODO: maybe the completer could be kicked off in the handleChange() method directly; signature help still
// requires an up-to-date virtual document on the LSP side, so we need to wait for sync.
if (
change.text &&
change.text[0].length == 1 &&
(this.settings.get('continuousHinting') as boolean)
) {
this.jupyterlab_components.invoke_completer(
CompletionTriggerKind.Invoked
);
return;
}

let last_character = this.extract_last_character(change);
if (this.completionCharacters.indexOf(last_character) > -1) {
this.virtual_editor.console.log(
Expand Down
18 changes: 16 additions & 2 deletions packages/jupyterlab-lsp/src/adapters/codemirror/testutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import {
CodeMirrorEditorFactory
} from '@jupyterlab/codemirror';
import { VirtualEditor } from '../../virtual/editor';
import { CodeMirrorLSPFeature, ILSPFeatureConstructor } from './feature';
import {
CodeMirrorLSPFeature,
IFeatureSettings,
ILSPFeatureConstructor
} from './feature';
import { LSPConnection } from '../../connection';
import { CodeEditor } from '@jupyterlab/codeeditor';
import { VirtualFileEditor } from '../../virtual/editors/file_editor';
Expand All @@ -19,11 +23,11 @@ import { IOverridesRegistry } from '../../magics/overrides';
import { IForeignCodeExtractorsRegistry } from '../../extractors/types';
import * as nbformat from '@jupyterlab/nbformat';
import { ICellModel } from '@jupyterlab/cells';
import createNotebook = NBTestUtils.createNotebook;
import { CodeMirrorAdapter } from './cm_adapter';
import { VirtualDocument } from '../../virtual/document';
import { LanguageServerManager } from '../../manager';
import { DocumentConnectionManager } from '../../connection_manager';
import createNotebook = NBTestUtils.createNotebook;

interface IFeatureTestEnvironment {
host: HTMLElement;
Expand Down Expand Up @@ -276,3 +280,13 @@ export async function synchronize_content(
console.warn(e);
}
}

export class DummySettings implements IFeatureSettings {
get(setting: string): any {
return null;
}

set(setting: string, value: any): void {
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { LSPConnection } from '../../../connection';
import { Session } from '@jupyterlab/services';
import ICompletionItemsResponseType = CompletionHandler.ICompletionItemsResponseType;
import { kernelIcon } from '@jupyterlab/ui-components';
import { IFeatureSettings } from '../../codemirror/feature';

/**
* A LSP connector for completion handlers.
Expand All @@ -33,22 +34,27 @@ export class LSPConnector
private _context_connector: ContextConnector;
private _kernel_connector: KernelConnector;
private _kernel_and_context_connector: CompletionConnector;
protected options: LSPConnector.IOptions;

// signal that this is the new type connector (providing completion items)
responseType = ICompletionItemsResponseType;

virtual_editor: VirtualEditor;
private trigger_kind: CompletionTriggerKind;
// TODO expose this in user settings
private suppress_auto_invoke_in = ['comment', 'string'];

private get suppress_auto_invoke_in(): string[] {
return this.options.settings.get('suppressInvokeIn');
}

private get should_show_documentation(): boolean {
return this.options.settings.get('showDocumentation');
}

/**
* Create a new LSP connector for completion requests.
*
* @param options - The instantiation options for the LSP connector.
*/
constructor(options: LSPConnector.IOptions) {
constructor(protected options: LSPConnector.IOptions) {
this._editor = options.editor;
this._connections = options.connections;
this.virtual_editor = options.virtual_editor;
Expand All @@ -60,7 +66,6 @@ export class LSPConnector
kernel_options
);
}
this.options = options;
}

dispose() {
Expand Down Expand Up @@ -216,14 +221,17 @@ export class LSPConnector
let prefix = token.value.slice(0, position_in_token + 1);
let all_non_prefixed = true;
let items: CompletionHandler.ICompletionItem[] = [];
const show_documentation = this.should_show_documentation;
lspCompletionItems.forEach(match => {
let completionItem = {
label: match.label,
insertText: match.insertText,
type: match.kind ? completionItemKindNames[match.kind] : '',
documentation: lsProtocol.MarkupContent.is(match.documentation)
? match.documentation.value
: match.documentation,
documentation: show_documentation
? lsProtocol.MarkupContent.is(match.documentation)
? match.documentation.value
: match.documentation
: null,
filterText: match.filterText,
deprecated: match.deprecated,
data: { ...match }
Expand Down Expand Up @@ -386,6 +394,8 @@ export namespace LSPConnector {
*/
connections: Map<VirtualDocument.id_path, LSPConnection>;

settings: IFeatureSettings;

session?: Session.ISessionConnection;
}
}
25 changes: 7 additions & 18 deletions packages/jupyterlab-lsp/src/adapters/jupyterlab/file_editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ import { FileEditor } from '@jupyterlab/fileeditor';
import { IDocumentWidget } from '@jupyterlab/docregistry';
import { FileEditorJumper } from '@krassowski/jupyterlab_go_to_definition/lib/jumpers/fileeditor';
import * as CodeMirror from 'codemirror';
import { JupyterFrontEnd } from '@jupyterlab/application';
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
import { CodeMirrorEditor } from '@jupyterlab/codemirror';
import { ICompletionManager } from '@jupyterlab/completer';
import { LSPConnector } from './components/completion';
import { CodeEditor } from '@jupyterlab/codeeditor';
import { VirtualFileEditor } from '../../virtual/editors/file_editor';
import { DocumentConnectionManager } from '../../connection_manager';
import { LSPExtension } from '../../index';

export class FileEditorAdapter extends JupyterLabWidgetAdapter {
editor: FileEditor;
Expand Down Expand Up @@ -44,20 +41,11 @@ export class FileEditorAdapter extends JupyterLabWidgetAdapter {
}

constructor(
extension: LSPExtension,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here: when we start changing constructors, we should just go ahead and adopt an IOptions someplace so the options can grow more organically over time. The closer we can start making <ActivityName>WidgetAdapter invocation to be more regular, I think the happier we'll be...

editor_widget: IDocumentWidget<FileEditor>,
jumper: FileEditorJumper,
app: JupyterFrontEnd,
protected completion_manager: ICompletionManager,
rendermime_registry: IRenderMimeRegistry,
connection_manager: DocumentConnectionManager
jumper: FileEditorJumper
) {
super(
app,
editor_widget,
rendermime_registry,
'completer:invoke-file',
connection_manager
);
super(extension, editor_widget, 'completer:invoke-file');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably collect all of our external command references someplace...

this.jumper = jumper;
this.editor = editor_widget.content;

Expand All @@ -84,9 +72,10 @@ export class FileEditorAdapter extends JupyterLabWidgetAdapter {
this.current_completion_connector = new LSPConnector({
editor: this.editor.editor,
connections: this.connection_manager.connections,
virtual_editor: this.virtual_editor
virtual_editor: this.virtual_editor,
settings: this.completion_settings
});
this.completion_manager.register({
this.extension.completion_manager.register({
connector: this.current_completion_connector,
editor: this.editor.editor,
parent: this.widget
Expand Down
Loading