Skip to content

Commit d605ebe

Browse files
committed
ts-ignore no longer needed in the connection
1 parent 500893a commit d605ebe

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

packages/jupyterlab-lsp/src/connection.ts

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,19 @@ export class LSPConnection extends LspWsConnection {
3030
}
3131

3232
public isRenameSupported() {
33-
// prettier-ignore
3433
return !!(
35-
// @ts-ignore
3634
this.serverCapabilities && this.serverCapabilities.renameProvider
3735
);
3836
}
3937

4038
public rename(location: IPosition, newName: string) {
41-
// @ts-ignore
4239
if (!this.isConnected || !this.isRenameSupported()) {
4340
return;
4441
}
4542

46-
// @ts-ignore
4743
this.connection
4844
.sendRequest('textDocument/rename', {
4945
textDocument: {
50-
// @ts-ignore
5146
uri: this.documentInfo.documentUri
5247
},
5348
position: {
@@ -65,14 +60,10 @@ export class LSPConnection extends LspWsConnection {
6560
super.connect(socket);
6661

6762
until_ready(() => {
68-
// @ts-ignore
6963
return this.isConnected;
7064
}, -1)
7165
.then(() => {
72-
// @ts-ignore
73-
let connection = this.connection;
74-
connection.onClose(() => {
75-
// @ts-ignore
66+
this.connection.onClose(() => {
7667
this.isConnected = false;
7768
this.emit('close', this.closing_manually);
7869
});
@@ -97,26 +88,20 @@ export class LSPConnection extends LspWsConnection {
9788
private _sendChange(
9889
changeEvents: lsProtocol.TextDocumentContentChangeEvent[]
9990
) {
100-
// @ts-ignore
10191
if (!this.isConnected) {
10292
return;
10393
}
104-
// @ts-ignore
105-
let documentInfo = this.documentInfo;
10694
const textDocumentChange: lsProtocol.DidChangeTextDocumentParams = {
10795
textDocument: {
108-
uri: documentInfo.documentUri,
109-
// @ts-ignore
96+
uri: this.documentInfo.documentUri,
11097
version: this.documentVersion
11198
} as lsProtocol.VersionedTextDocumentIdentifier,
11299
contentChanges: changeEvents
113100
};
114-
// @ts-ignore
115101
this.connection.sendNotification(
116102
'textDocument/didChange',
117103
textDocumentChange
118104
);
119-
// @ts-ignore
120105
this.documentVersion++;
121106
}
122107

@@ -126,24 +111,19 @@ export class LSPConnection extends LspWsConnection {
126111
triggerCharacter: string,
127112
triggerKind: CompletionTriggerKind
128113
): Promise<lsProtocol.CompletionItem[]> {
129-
// @ts-ignore
130114
if (!this.isConnected) {
131115
return;
132116
}
133117
if (
134-
// @ts-ignore
135118
!(this.serverCapabilities && this.serverCapabilities.completionProvider)
136119
) {
137120
return;
138121
}
139122

140-
// @ts-ignore
141-
let connection = this.connection;
142123
return new Promise<lsProtocol.CompletionItem[]>(resolve => {
143-
connection
124+
this.connection
144125
.sendRequest('textDocument/completion', {
145126
textDocument: {
146-
// @ts-ignore
147127
uri: this.documentInfo.documentUri
148128
},
149129
position: {

0 commit comments

Comments
 (0)