diff --git a/Src/CSharpier.VSCode/src/CSharpierProcess.ts b/Src/CSharpier.VSCode/src/CSharpierProcess.ts index 8f638f227..41224c977 100644 --- a/Src/CSharpier.VSCode/src/CSharpierProcess.ts +++ b/Src/CSharpier.VSCode/src/CSharpierProcess.ts @@ -7,7 +7,7 @@ export interface ICSharpierProcess extends Disposable { export class NullCSharpierProcess implements ICSharpierProcess { static instance = new NullCSharpierProcess(); - private constructor () { } + private constructor() {} formatFile(content: string, filePath: string): Promise { return Promise.resolve(""); diff --git a/Src/CSharpier.VSCode/src/CSharpierProcessProvider.ts b/Src/CSharpier.VSCode/src/CSharpierProcessProvider.ts index ef4ae60b4..62684a856 100644 --- a/Src/CSharpier.VSCode/src/CSharpierProcessProvider.ts +++ b/Src/CSharpier.VSCode/src/CSharpierProcessProvider.ts @@ -1,4 +1,4 @@ -import {Disposable, Extension, TextEditor, window, workspace} from "vscode"; +import { Disposable, Extension, TextEditor, window, workspace } from "vscode"; import { Logger } from "./Logger"; import * as path from "path"; import * as semver from "semver"; @@ -23,7 +23,11 @@ export class CSharpierProcessProvider implements Disposable { constructor(logger: Logger, extension: Extension) { this.logger = logger; this.customPathInstaller = new CustomPathInstaller(logger); - this.installerService = new InstallerService(this.logger, this.killRunningProcesses, extension); + this.installerService = new InstallerService( + this.logger, + this.killRunningProcesses, + extension, + ); window.onDidChangeActiveTextEditor((event: TextEditor | undefined) => { if (event?.document?.languageId !== "csharp") { @@ -137,11 +141,12 @@ export class CSharpierProcessProvider implements Disposable { outputFromCsharpier = execSync(`dotnet csharpier --version`, { cwd: directoryThatContainsFile, env: { ...process.env, DOTNET_NOLOGO: "1" }, - }).toString().trim(); + }) + .toString() + .trim(); this.logger.debug(`dotnet csharpier --version output ${outputFromCsharpier}`); return outputFromCsharpier; - } catch (error: any) { const message = !error.stderr ? error.toString() : error.stderr.toString(); diff --git a/Src/CSharpier.VSCode/src/CustomPathInstaller.ts b/Src/CSharpier.VSCode/src/CustomPathInstaller.ts index d058e7660..b646f2c8c 100644 --- a/Src/CSharpier.VSCode/src/CustomPathInstaller.ts +++ b/Src/CSharpier.VSCode/src/CustomPathInstaller.ts @@ -19,7 +19,9 @@ export class CustomPathInstaller { try { const output = execSync(`${this.getPathForVersion(version)} --version`, { env: { ...process.env, DOTNET_NOLOGO: "1" }, - }).toString().trim(); + }) + .toString() + .trim(); this.logger.debug("dotnet csharpier --version output: " + output); @@ -38,7 +40,9 @@ export class CustomPathInstaller { ); } - this.logger.debug(`Removing directory at ${pathToDirectoryForVersion} because it appears to be corrupted`) + this.logger.debug( + `Removing directory at ${pathToDirectoryForVersion} because it appears to be corrupted`, + ); fs.rmdirSync(pathToDirectoryForVersion, { recursive: true }); } diff --git a/Src/CSharpier.VSCode/src/InstallerService.ts b/Src/CSharpier.VSCode/src/InstallerService.ts index 5ac6023cb..be34adf40 100644 --- a/Src/CSharpier.VSCode/src/InstallerService.ts +++ b/Src/CSharpier.VSCode/src/InstallerService.ts @@ -26,7 +26,9 @@ export class InstallerService { this.logger.info(this.extension.extensionKind); if (this.extension.extensionKind === vscode.ExtensionKind.Workspace) { - window.showErrorMessage("CSharpier must be installed as a local dotnet tool in ./.config/dotnet-tools.json using `dotnet tool install csharpier` and the devcontainer rebuilt to support formatting files."); + window.showErrorMessage( + "CSharpier must be installed as a local dotnet tool in ./.config/dotnet-tools.json using `dotnet tool install csharpier` and the devcontainer rebuilt to support formatting files.", + ); return; }