Skip to content

Commit

Permalink
Closes #52 (#93)
Browse files Browse the repository at this point in the history
Closes #52
  • Loading branch information
jonaprieto authored May 31, 2023
1 parent d8e781f commit 522925b
Showing 1 changed file with 1 addition and 50 deletions.
51 changes: 1 addition & 50 deletions src/formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -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
Expand Down

0 comments on commit 522925b

Please sign in to comment.