editor/code: Re-apply code format

This commit is contained in:
Tetsuharu Ohzeki 2023-07-11 22:35:10 +09:00
parent 9d06aa55b4
commit f7823f3106
17 changed files with 180 additions and 175 deletions

View file

@ -42,10 +42,10 @@ export type Workspace =
export function fetchWorkspace(): Workspace {
const folders = (vscode.workspace.workspaceFolders || []).filter(
(folder) => folder.uri.scheme === "file"
(folder) => folder.uri.scheme === "file",
);
const rustDocuments = vscode.workspace.textDocuments.filter((document) =>
isRustDocument(document)
isRustDocument(document),
);
return folders.length === 0
@ -61,7 +61,7 @@ export function fetchWorkspace(): Workspace {
export async function discoverWorkspace(
files: readonly vscode.TextDocument[],
command: string[],
options: ExecOptions
options: ExecOptions,
): Promise<JsonProject> {
const paths = files.map((f) => `"${f.uri.fsPath}"`).join(" ");
const joinedCommand = command.join(" ");
@ -110,7 +110,7 @@ export class Ctx {
constructor(
readonly extCtx: vscode.ExtensionContext,
commandFactories: Record<string, CommandFactory>,
workspace: Workspace
workspace: Workspace,
) {
extCtx.subscriptions.push(this);
this.statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
@ -186,7 +186,7 @@ export class Ctx {
log.error("Bootstrap error", err);
throw new Error(message);
}
},
);
const newEnv = Object.assign({}, process.env, this.config.serverExtraEnv);
const run: lc.Executable = {
@ -216,7 +216,7 @@ export class Ctx {
return discoverWorkspace([file], discoverProjectCommand, {
cwd: path.dirname(file.uri.fsPath),
});
})
}),
);
this.addToDiscoveredWorkspaces(workspaces);
@ -230,7 +230,7 @@ export class Ctx {
if (key === "linkedProjects" && this.config.discoveredWorkspaces.length > 0) {
obj["linkedProjects"] = this.config.discoveredWorkspaces;
}
}
},
);
this._client = await createClient(
@ -239,17 +239,17 @@ export class Ctx {
initializationOptions,
serverOptions,
this.config,
this.unlinkedFiles
this.unlinkedFiles,
);
this.pushClientCleanup(
this._client.onNotification(ra.serverStatus, (params) =>
this.setServerStatus(params)
)
this.setServerStatus(params),
),
);
this.pushClientCleanup(
this._client.onNotification(ra.openServerLogs, () => {
this.outputChannel!.show();
})
}),
);
}
return this._client;
@ -395,7 +395,7 @@ export class Ctx {
} else {
callback = () =>
vscode.window.showErrorMessage(
`command ${fullName} failed: rust-analyzer server is not running`
`command ${fullName} failed: rust-analyzer server is not running`,
);
}
@ -423,7 +423,7 @@ export class Ctx {
}
statusBar.color = new vscode.ThemeColor("statusBarItem.warningForeground");
statusBar.backgroundColor = new vscode.ThemeColor(
"statusBarItem.warningBackground"
"statusBarItem.warningBackground",
);
statusBar.command = "rust-analyzer.openLogs";
icon = "$(warning) ";
@ -440,7 +440,7 @@ export class Ctx {
case "stopped":
statusBar.tooltip.appendText("Server is stopped");
statusBar.tooltip.appendMarkdown(
"\n\n[Start server](command:rust-analyzer.startServer)"
"\n\n[Start server](command:rust-analyzer.startServer)",
);
statusBar.color = undefined;
statusBar.backgroundColor = undefined;
@ -453,13 +453,13 @@ export class Ctx {
}
statusBar.tooltip.appendMarkdown("\n\n[Open logs](command:rust-analyzer.openLogs)");
statusBar.tooltip.appendMarkdown(
"\n\n[Reload Workspace](command:rust-analyzer.reloadWorkspace)"
"\n\n[Reload Workspace](command:rust-analyzer.reloadWorkspace)",
);
statusBar.tooltip.appendMarkdown(
"\n\n[Rebuild Proc Macros](command:rust-analyzer.rebuildProcMacros)"
"\n\n[Rebuild Proc Macros](command:rust-analyzer.rebuildProcMacros)",
);
statusBar.tooltip.appendMarkdown(
"\n\n[Restart server](command:rust-analyzer.restartServer)"
"\n\n[Restart server](command:rust-analyzer.restartServer)",
);
statusBar.tooltip.appendMarkdown("\n\n[Stop server](command:rust-analyzer.stopServer)");
if (!status.quiescent) icon = "$(sync~spin) ";