From 522925bae0b6cf162cee0c1a30a9f77305aa728b Mon Sep 17 00:00:00 2001 From: Jonathan Cubides Date: Wed, 31 May 2023 16:43:42 +0200 Subject: [PATCH] Closes #52 (#93) Closes #52 --- src/formatter.ts | 51 +----------------------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/src/formatter.ts b/src/formatter.ts index d7ddec1..8329c8b 100644 --- a/src/formatter.ts +++ b/src/formatter.ts @@ -23,10 +23,8 @@ export function activate(_context: vscode.ExtensionContext) { config.getJuvixExec(), config.getGlobalFlags(), '--stdin', - 'dev', - 'scope', + 'format', filePath, - '--with-comments', ].join(' '); debugChannel.info(`Formatting ${filePath}`); @@ -49,53 +47,6 @@ export function activate(_context: vscode.ExtensionContext) { }, }); - // JuvixCore - - // FIXME: one anoma/juvix/issue/#1841 is fixed. - // vscode.languages.registerDocumentFormattingEditProvider('JuvixCore', { - // provideDocumentFormattingEdits( - // document: vscode.TextDocument - // ): vscode.TextEdit[] { - // const range = new vscode.Range( - // document.positionAt(0), - // document.positionAt(document.getText().length) - // ); - - // const filePath = document.uri.fsPath; - // debugChannel.appendLine(`Formatting ${filePath}`); - // const formatterCall = [ - // config.getJuvixExec(), - // config.getGlobalFlags(), - // '--stdin', - // 'dev', - // 'core', - // 'read', - // filePath, - // ].join(' '); - - // debugChannel.appendLine(formatterCall); - - // const { spawnSync } = require('child_process'); - // const ls = spawnSync(formatterCall, { - // shell: true, - // input: document.getText(), - // encoding: 'utf8', - // }); - - // debugChannel.appendLine(ls.stdout); - - // if (ls.status == 0) { - // const stdout = ls.stdout; - // return [vscode.TextEdit.replace(range, stdout)]; - // } else { - // const errMsg: string = ls.stderr.toString(); - // throw new Error(errMsg); - // } - // }, - // }); - - // JuvixGeb - vscode.languages.registerDocumentFormattingEditProvider('JuvixGeb', { provideDocumentFormattingEdits( document: vscode.TextDocument