Skip to content

Commit 36aa419

Browse files
committed
some cleanup of completion, document updating
1 parent 8ae1b9e commit 36aa419

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

packages/jupyterlab-lsp/src/adapters/jupyterlab/components/completion.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ export class LSPConnector extends DataConnector<
112112
): Promise<CompletionHandler.IReply> {
113113
let editor = this._editor;
114114

115-
console.error('NRB: editor', (editor as any)._editor.display.lineDiv);
116-
117115
const cursor = editor.getCursorPosition();
118116
const token = editor.getTokenForPosition(cursor);
119117

packages/jupyterlab-lsp/src/adapters/jupyterlab/jl_adapter.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { PathExt } from '@jupyterlab/coreutils';
21
import * as CodeMirror from 'codemirror';
32
import { CodeMirrorAdapter } from '../codemirror/cm_adapter';
43
import { JupyterFrontEnd } from '@jupyterlab/application';
@@ -29,7 +28,8 @@ import { ICommandContext } from '../../command_manager';
2928
import { JSONObject } from '@phosphor/coreutils';
3029
import {
3130
DocumentConnectionManager,
32-
IDocumentConnectionData
31+
IDocumentConnectionData,
32+
ISocketConnectionOptions
3333
} from '../../connection_manager';
3434
import { Rename } from '../codemirror/features/rename';
3535

@@ -227,12 +227,6 @@ export abstract class JupyterLabWidgetAdapter
227227

228228
abstract get language_file_extension(): string;
229229

230-
get root_path() {
231-
// TODO: serverRoot may need to be included for Hub or Windows, requires testing.
232-
// let root = PageConfig.getOption('serverRoot');
233-
return PathExt.dirname(this.document_path);
234-
}
235-
236230
// equivalent to triggering didClose and didOpen, as per syncing specification,
237231
// but also reloads the connection; used during file rename (or when it was moved)
238232
protected reload_connection() {
@@ -402,14 +396,11 @@ export abstract class JupyterLabWidgetAdapter
402396
private async connect(virtual_document: VirtualDocument) {
403397
let language = virtual_document.language;
404398

405-
console.log(
406-
`LSP: will connect using root path: ${this.root_path} and language: ${language}`
407-
);
399+
console.log(`LSP: will connect using language: ${language}`);
408400

409-
let options = {
401+
let options: ISocketConnectionOptions = {
410402
virtual_document,
411403
language,
412-
root_path: this.root_path,
413404
document_path: this.document_path
414405
};
415406

packages/jupyterlab-lsp/src/adapters/jupyterlab/notebook.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,6 @@ export class NotebookAdapter extends JupyterLabWidgetAdapter {
197197
if (cell == null) {
198198
return;
199199
}
200-
console.error(
201-
'NRB: on_completions',
202-
(cell.editor as any)._editor.display.lineDiv
203-
);
204200
this.set_completion_connector(cell);
205201
this.current_completion_handler.editor = cell.editor;
206202
this.current_completion_handler.connector = this.current_completion_connector;

packages/jupyterlab-lsp/src/connection_manager.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ export interface IDocumentConnectionData {
1313
connection: LSPConnection;
1414
}
1515

16-
interface ISocketConnectionOptions {
16+
export interface ISocketConnectionOptions {
1717
virtual_document: VirtualDocument;
1818
/**
1919
* The language identifier, corresponding to the API endpoint on the LSP proxy server.
2020
*/
2121
language: string;
22-
/**
23-
* The root path in the JupyterLab (virtual) path space
24-
*/
25-
root_path: string;
2622
/**
2723
* Path to the document in the JupyterLab space
2824
*/
@@ -257,6 +253,7 @@ export class DocumentConnectionManager {
257253

258254
public unregister_document(virtual_document: VirtualDocument) {
259255
this.connections.delete(virtual_document.id_path);
256+
this.documents_changed.emit(this.documents);
260257
}
261258
}
262259

0 commit comments

Comments
 (0)