Skip to content

Commit

Permalink
Merge 59be255 into 3ad56e7
Browse files Browse the repository at this point in the history
  • Loading branch information
antico5 authored Mar 9, 2023
2 parents 3ad56e7 + 59be255 commit 3ad77a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/formatter/forgeFormatter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable @typescript-eslint/strict-boolean-expressions */
/* eslint-disable @typescript-eslint/no-explicit-any */
import * as vscode from "vscode";
import * as cp from "child_process";
import path from "path";
import { runCmd, runningOnWindows } from "../utils/os";

let resolvedForgeCommand: string;
Expand All @@ -18,10 +20,8 @@ export async function formatDocument(
const forgeCommand = await resolveForgeCommand();

const formatted = await new Promise<string>((resolve, reject) => {
const currentDocument = vscode.window.activeTextEditor?.document.uri;
const rootPath = currentDocument
? vscode.workspace.getWorkspaceFolder(currentDocument)?.uri.fsPath
: undefined;
const documentUri = vscode.window.activeTextEditor?.document.uri.fsPath;
const rootPath = documentUri && path.dirname(documentUri);

const forge = cp.execFile(
forgeCommand,
Expand Down

0 comments on commit 3ad77a0

Please sign in to comment.