Skip to content

Commit 478739f

Browse files
committed
Prettier
1 parent b2dc1b5 commit 478739f

File tree

30 files changed

+214
-230
lines changed

30 files changed

+214
-230
lines changed

packages/code-jumpers/src/jumpers/notebook.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ export class NotebookJumper extends CodeJumper {
5151
}
5252

5353
getCurrentPosition(): IGlobalPosition {
54-
let position = this.editors[
55-
this.notebook.activeCellIndex
56-
].getCursorPosition();
54+
let position =
55+
this.editors[this.notebook.activeCellIndex].getCursorPosition();
5756

5857
return {
5958
editor_index: this.notebook.activeCellIndex,

packages/completion-theme/src/index.ts

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -173,30 +173,31 @@ export class CompletionThemeManager implements ILSPCompletionThemeManager {
173173

174174
const LSP_CATEGORY = 'Language server protocol';
175175

176-
export const COMPLETION_THEME_MANAGER: JupyterFrontEndPlugin<ILSPCompletionThemeManager> = {
177-
id: PLUGIN_ID,
178-
requires: [IThemeManager, ICommandPalette, ITranslator],
179-
activate: (
180-
app,
181-
themeManager: IThemeManager,
182-
commandPalette: ICommandPalette,
183-
translator: ITranslator
184-
) => {
185-
const trans = translator.load('jupyterlab_lsp');
186-
let manager = new CompletionThemeManager(themeManager, trans);
187-
const command_id = 'lsp:completer-about-themes';
188-
app.commands.addCommand(command_id, {
189-
label: trans.__('Display the completer themes'),
190-
execute: () => {
191-
manager.display_themes();
192-
}
193-
});
194-
commandPalette.addItem({
195-
category: LSP_CATEGORY,
196-
command: command_id
197-
});
198-
return manager;
199-
},
200-
provides: ILSPCompletionThemeManager,
201-
autoStart: true
202-
};
176+
export const COMPLETION_THEME_MANAGER: JupyterFrontEndPlugin<ILSPCompletionThemeManager> =
177+
{
178+
id: PLUGIN_ID,
179+
requires: [IThemeManager, ICommandPalette, ITranslator],
180+
activate: (
181+
app,
182+
themeManager: IThemeManager,
183+
commandPalette: ICommandPalette,
184+
translator: ITranslator
185+
) => {
186+
const trans = translator.load('jupyterlab_lsp');
187+
let manager = new CompletionThemeManager(themeManager, trans);
188+
const command_id = 'lsp:completer-about-themes';
189+
app.commands.addCommand(command_id, {
190+
label: trans.__('Display the completer themes'),
191+
execute: () => {
192+
manager.display_themes();
193+
}
194+
});
195+
commandPalette.addItem({
196+
category: LSP_CATEGORY,
197+
command: command_id
198+
});
199+
return manager;
200+
},
201+
provides: ILSPCompletionThemeManager,
202+
autoStart: true
203+
};

packages/jupyterlab-lsp/src/adapter_manager.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,13 @@ export class WidgetAdapterManager implements ILSPAdapterManager {
143143
}
144144
}
145145

146-
export const WIDGET_ADAPTER_MANAGER: JupyterFrontEndPlugin<ILSPAdapterManager> = {
147-
id: PLUGIN_ID + ':ILSPAdapterManager',
148-
activate: app => {
149-
let shell = app.shell as ILabShell | IRetroShell;
150-
return new WidgetAdapterManager(shell);
151-
},
152-
provides: ILSPAdapterManager,
153-
autoStart: true
154-
};
146+
export const WIDGET_ADAPTER_MANAGER: JupyterFrontEndPlugin<ILSPAdapterManager> =
147+
{
148+
id: PLUGIN_ID + ':ILSPAdapterManager',
149+
activate: app => {
150+
let shell = app.shell as ILabShell | IRetroShell;
151+
return new WidgetAdapterManager(shell);
152+
},
153+
provides: ILSPAdapterManager,
154+
autoStart: true
155+
};

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,8 @@ export abstract class WidgetAdapter<T extends IDocumentWidget> {
660660
}
661661

662662
for (let feature of features) {
663-
let featureEditorIntegrationConstructor = feature.editorIntegrationFactory.get(
664-
this.virtual_editor.editor_name
665-
);
663+
let featureEditorIntegrationConstructor =
664+
feature.editorIntegrationFactory.get(this.virtual_editor.editor_name);
666665
let integration = new featureEditorIntegrationConstructor({
667666
feature: feature,
668667
virtual_editor: this.virtual_editor,
@@ -725,9 +724,8 @@ export abstract class WidgetAdapter<T extends IDocumentWidget> {
725724

726725
get_context(root_position: IRootPosition): ICommandContext {
727726
let document = this.virtual_editor.document_at_root_position(root_position);
728-
let virtual_position = this.virtual_editor.root_position_to_virtual_position(
729-
root_position
730-
);
727+
let virtual_position =
728+
this.virtual_editor.root_position_to_virtual_position(root_position);
731729
return {
732730
document,
733731
connection: this.connection_manager.connections.get(document.uri),

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,8 @@ export class NotebookAdapter extends WidgetAdapter<NotebookPanel> {
349349
}
350350

351351
private get_cell_at(pos: IVirtualPosition): Cell {
352-
let ce_editor = this.virtual_editor.virtual_document.get_editor_at_virtual_line(
353-
pos
354-
);
352+
let ce_editor =
353+
this.virtual_editor.virtual_document.get_editor_at_virtual_line(pos);
355354
return this.ce_editor_to_cell.get(ce_editor);
356355
}
357356
}

packages/jupyterlab-lsp/src/components/statusbar.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,8 @@ class LSPPopup extends VDomRenderer<LSPStatus.Model> {
322322

323323
const missing_languages = this.model.missing_languages.map(
324324
(language, i) => {
325-
const specs_for_missing = this.model.language_server_manager.getMatchingSpecs(
326-
{ language }
327-
);
325+
const specs_for_missing =
326+
this.model.language_server_manager.getMatchingSpecs({ language });
328327
return (
329328
<div key={i} className={'lsp-missing-server'}>
330329
{language}
@@ -500,7 +499,8 @@ export class LSPStatus extends VDomRenderer<LSPStatus.Model> {
500499
}
501500

502501
export class StatusButtonExtension
503-
implements DocumentRegistry.IWidgetExtension<NotebookPanel, INotebookModel> {
502+
implements DocumentRegistry.IWidgetExtension<NotebookPanel, INotebookModel>
503+
{
504504
constructor(
505505
private options: {
506506
language_server_manager: LanguageServerManager;
@@ -519,7 +519,8 @@ export class StatusButtonExtension
519519
displayText,
520520
this.options.translator_bundle
521521
);
522-
status_bar_item.model.language_server_manager = this.options.language_server_manager;
522+
status_bar_item.model.language_server_manager =
523+
this.options.language_server_manager;
523524
status_bar_item.model.connection_manager = this.options.connection_manager;
524525
return status_bar_item;
525526
}
@@ -665,9 +666,10 @@ export namespace LSPStatus {
665666

666667
for (let document of documents.values()) {
667668
let language = document.language.toLocaleLowerCase();
668-
let server_ids = this._connection_manager.language_server_manager.getMatchingServers(
669-
{ language: document.language }
670-
);
669+
let server_ids =
670+
this._connection_manager.language_server_manager.getMatchingServers({
671+
language: document.language
672+
});
671673
if (server_ids.length === 0) {
672674
continue;
673675
}
@@ -739,9 +741,10 @@ export namespace LSPStatus {
739741

740742
detected_documents.forEach((document, uri) => {
741743
let connection = this._connection_manager.connections.get(uri);
742-
let server_ids = this._connection_manager.language_server_manager.getMatchingServers(
743-
{ language: document.language }
744-
);
744+
let server_ids =
745+
this._connection_manager.language_server_manager.getMatchingServers({
746+
language: document.language
747+
});
745748

746749
if (server_ids.length !== 0) {
747750
documents_with_known_servers.add(document);

packages/jupyterlab-lsp/src/connection.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ export type ServerRequests<
181181

182182
class ClientRequestHandler<
183183
T extends keyof IClientRequestParams = keyof IClientRequestParams
184-
> implements IClientRequestHandler {
184+
> implements IClientRequestHandler
185+
{
185186
constructor(
186187
protected connection: MessageConnection,
187188
protected method: T,
@@ -207,7 +208,8 @@ class ClientRequestHandler<
207208

208209
class ServerRequestHandler<
209210
T extends keyof IServerRequestParams = keyof IServerRequestParams
210-
> implements IServerRequestHandler {
211+
> implements IServerRequestHandler
212+
{
211213
private _handler: (
212214
params: IServerRequestParams[T],
213215
connection?: LSPConnection
@@ -352,7 +354,7 @@ export class LSPConnection extends LspWsConnection {
352354
return createMethodMap<T, IClientRequestHandler>(
353355
methods,
354356
method =>
355-
new ClientRequestHandler(this.connection, (method as U) as any, this)
357+
new ClientRequestHandler(this.connection, method as U as any, this)
356358
);
357359
}
358360

@@ -363,7 +365,7 @@ export class LSPConnection extends LspWsConnection {
363365
return createMethodMap<T, IServerRequestHandler>(
364366
methods,
365367
method =>
366-
new ServerRequestHandler(this.connection, (method as U) as any, this)
368+
new ServerRequestHandler(this.connection, method as U as any, this)
367369
);
368370
}
369371

@@ -373,12 +375,14 @@ export class LSPConnection extends LspWsConnection {
373375
this.serverIdentifier = options?.serverIdentifier;
374376
this.console = options.console.scope(this.serverIdentifier + ' connection');
375377
this.documentsToOpen = [];
376-
this.clientNotifications = this.constructNotificationHandlers<
377-
ClientNotifications
378-
>(Method.ClientNotification);
379-
this.serverNotifications = this.constructNotificationHandlers<
380-
ServerNotifications
381-
>(Method.ServerNotification);
378+
this.clientNotifications =
379+
this.constructNotificationHandlers<ClientNotifications>(
380+
Method.ClientNotification
381+
);
382+
this.serverNotifications =
383+
this.constructNotificationHandlers<ServerNotifications>(
384+
Method.ServerNotification
385+
);
382386
}
383387

384388
sendOpenWhenReady(documentInfo: IDocumentInfo) {

packages/jupyterlab-lsp/src/connection_manager.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,10 @@ export namespace DocumentConnectionManager {
392392
: virtualDocumentsUri;
393393

394394
// for now take the best match only
395-
const matchingServers = Private.getLanguageServerManager().getMatchingServers(
396-
{
395+
const matchingServers =
396+
Private.getLanguageServerManager().getMatchingServers({
397397
language
398-
}
399-
);
398+
});
400399
const language_server_id =
401400
matchingServers.length === 0 ? null : matchingServers[0];
402401

packages/jupyterlab-lsp/src/editor_integration/codemirror.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ interface IHTMLEventMap<
7777
* (the initialization is performed by the adapter).
7878
*/
7979
export abstract class CodeMirrorIntegration
80-
implements IFeatureEditorIntegration<CodeMirrorVirtualEditor> {
80+
implements IFeatureEditorIntegration<CodeMirrorVirtualEditor>
81+
{
8182
is_registered: boolean;
8283
feature: IFeature;
8384

@@ -171,12 +172,10 @@ export abstract class CodeMirrorIntegration
171172
let end = PositionConverter.lsp_to_cm(range.end) as IVirtualPosition;
172173

173174
if (cm_editor == null) {
174-
let start_in_root = this.transform_virtual_position_to_root_position(
175-
start
176-
);
177-
let ce_editor = this.virtual_editor.get_editor_at_root_position(
178-
start_in_root
179-
);
175+
let start_in_root =
176+
this.transform_virtual_position_to_root_position(start);
177+
let ce_editor =
178+
this.virtual_editor.get_editor_at_root_position(start_in_root);
180179
cm_editor = this.virtual_editor.ce_editor_to_cm_editor.get(ce_editor);
181180
}
182181

@@ -201,9 +200,8 @@ export abstract class CodeMirrorIntegration
201200
start: IVirtualPosition
202201
): IRootPosition {
203202
let ce_editor = this.virtual_document.virtual_lines.get(start.line).editor;
204-
let editor_position = this.virtual_document.transform_virtual_to_editor(
205-
start
206-
);
203+
let editor_position =
204+
this.virtual_document.transform_virtual_to_editor(start);
207205
return this.virtual_editor.transform_from_editor_to_root(
208206
ce_editor,
209207
editor_position

packages/jupyterlab-lsp/src/editor_integration/testutils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ type TestEnvironmentConstructor = new (...args: any[]) => ITestEnvironment;
205205
function FeatureSupport<TBase extends TestEnvironmentConstructor>(Base: TBase) {
206206
return class FeatureTestEnvironment
207207
extends Base
208-
implements IFeatureTestEnvironment {
208+
implements IFeatureTestEnvironment
209+
{
209210
_connections: Map<CodeMirrorIntegration, LSPConnection>;
210211

211212
init() {

0 commit comments

Comments
 (0)