Skip to content

Commit

Permalink
Run npm run pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaprieto committed Jul 17, 2024
1 parent a8ac790 commit c5d061f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
"command": "juvix-mode.geb-eval",
"group": "navigation@3"
}
],
],
"editor/context": [
{
"submenu": "juvix-submenu",
Expand Down
6 changes: 2 additions & 4 deletions src/codelens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
* CodelensProvider
*/


export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(
vscode.languages.registerCodeLensProvider(
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down
24 changes: 18 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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 {
Expand Down Expand Up @@ -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
}
};
Expand Down Expand Up @@ -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';
}
Expand All @@ -240,7 +253,6 @@ export class JuvixConfig {
public inputModeEnabled(): boolean {
return this.workspaceConfig.get('input.enabled', true);
}

}

export interface TaggedList {
Expand Down
21 changes: 11 additions & 10 deletions src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c5d061f

Please sign in to comment.