diff --git a/package.json b/package.json index 89e6eb1..5133a3c 100644 --- a/package.json +++ b/package.json @@ -715,7 +715,7 @@ "command": "juvix-mode.geb-eval", "group": "navigation@3" } - ], + ], "editor/context": [ { "submenu": "juvix-submenu", diff --git a/src/codelens.ts b/src/codelens.ts index bd6aeb3..f8f77ef 100644 --- a/src/codelens.ts +++ b/src/codelens.ts @@ -14,7 +14,6 @@ import { * CodelensProvider */ - export function activate(context: vscode.ExtensionContext) { context.subscriptions.push( vscode.languages.registerCodeLensProvider( @@ -97,8 +96,8 @@ export class JuvixCodelensProvider implements vscode.CodeLensProvider { }); this.codeLenses.push(juvixVersionCodeLenses); - if(document.fileName.endsWith('Package.juvix') && text.length === 0){ -const packageText: string = `module Package; + if (document.fileName.endsWith('Package.juvix') && text.length === 0) { + const packageText: string = `module Package; import PackageDescription.V2 open; @@ -129,7 +128,6 @@ package : Package := let juvixBlockText: string = ''; if (moduleName && text.length === 0) { - if (isPureJuvixFile(document)) { juvixBlockText = `${moduleDeclaration}\n\n`; } else if (isJuvixMarkdownFile(document)) { diff --git a/src/config.ts b/src/config.ts index d3c6b8b..3ad186c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -11,7 +11,6 @@ import { logger } from './utils/debug'; import { ConfigurationTarget, workspace } from 'vscode'; export class JuvixConfig { - private workspaceConfig = workspace.getConfiguration('juvix-mode'); public _binaryPath = this.workspaceConfig.get('juvixBinPath', ''); public _binaryName = this.workspaceConfig.get('juvixBinName', 'juvix'); @@ -27,12 +26,20 @@ export class JuvixConfig { public setBinaryPath(value: string): void { this._binaryPath = value; - this.workspaceConfig.update('juvixBinPath', value, ConfigurationTarget.Workspace); + this.workspaceConfig.update( + 'juvixBinPath', + value, + ConfigurationTarget.Workspace, + ); } public setBinaryName(value: string): void { this._binaryName = value; - this.workspaceConfig.update('juvixBinName', value, ConfigurationTarget.Workspace); + this.workspaceConfig.update( + 'juvixBinName', + value, + ConfigurationTarget.Workspace, + ); } public getJuvixExec(): string { @@ -192,7 +199,10 @@ export class JuvixConfig { const juvixBuildDir = tmp.toString(); return juvixBuildDir; } catch (e) { - logger.error(`Error creating temporary directory ${tmpPath}: ${e}`, 'config.ts'); + logger.error( + `Error creating temporary directory ${tmpPath}: ${e}`, + 'config.ts', + ); return ''; // Add a return statement here } }; @@ -226,7 +236,10 @@ export class JuvixConfig { fs.mkdirSync(tmp); return tmp.toString(); } catch (e) { - logger.error('Error creating temporary directory for Judoc: ' + e, 'config.ts'); + logger.error( + 'Error creating temporary directory for Judoc: ' + e, + 'config.ts', + ); } return 'html'; } @@ -240,7 +253,6 @@ export class JuvixConfig { public inputModeEnabled(): boolean { return this.workspaceConfig.get('input.enabled', true); } - } export interface TaggedList { diff --git a/src/tasks.ts b/src/tasks.ts index 209dcc8..1625607 100644 --- a/src/tasks.ts +++ b/src/tasks.ts @@ -199,16 +199,17 @@ export async function JuvixTask( switch (name) { case 'run': if (config.useInternalBuildDirOption()) { - const buildDir = config.getInternalBuildDir(); - exec = new vscode.ShellExecution( - JuvixExec + - ` compile native --output ${buildDir}\${pathSeparator}out ${fl} && ${buildDir}\${pathSeparator}out`, - { cwd: buildDir }, - ); - } else { - exec = new vscode.ShellExecution(JuvixExec - + ` compile native --output ${fl}.out ${fl} && ${fl}.out`); - } + const buildDir = config.getInternalBuildDir(); + exec = new vscode.ShellExecution( + JuvixExec + + ` compile native --output ${buildDir}\${pathSeparator}out ${fl} && ${buildDir}\${pathSeparator}out`, + { cwd: buildDir }, + ); + } else { + exec = new vscode.ShellExecution( + JuvixExec + ` compile native --output ${fl}.out ${fl} && ${fl}.out`, + ); + } break; case 'core-compile': exec = new vscode.ShellExecution(