Skip to content

Commit

Permalink
improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Mar 24, 2024
1 parent 6ef42fa commit b346650
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/callbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function compilerError(data: string): Promise<void> {
}
}

export async function compilerExit(data: Makensis.CompilerData): Promise<void> {
export async function compilerExit(data: Makensis.CompilerOutput): Promise<void> {
const { showNotifications, showOutputView } = await getConfig('nsis');

if (data['status'] === 0) {
Expand Down
5 changes: 2 additions & 3 deletions src/makensis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { commands, window } from 'vscode';

import {
getMakensisPath,
getProjectPath,
getSpawnEnv,
isHeaderFile,
openURL,
Expand Down Expand Up @@ -59,7 +58,7 @@ export async function compile(strictMode: boolean): Promise<void> {
await NSIS.compile(
document.fileName,
{
env: await getProjectPath() || false,
env: false,
events: true,
json: showFlagsAsObject,
onData: async data => await compilerOutput(data),
Expand Down Expand Up @@ -139,7 +138,7 @@ export async function showHelp(): Promise<void> {
},
await getSpawnEnv()
);
command = await window.showQuickPick(Object.keys(output.stdout)) || undefined;
command = await window.showQuickPick(Object.keys(output.stdout as string)) || undefined;

if (command) {
openURL(command);
Expand Down
18 changes: 0 additions & 18 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,24 +273,6 @@ export function findErrors(input: string): DiagnosticCollection {
return {};
}

export async function getProjectPath(): Promise<null | string> {
let editor;

try {
editor = window.activeTextEditor;
} catch (err) {
return null;
}

try {
const workspaceFolder = workspace.getWorkspaceFolder(editor.document.uri);

return workspaceFolder ? workspaceFolder.uri.fsPath : '';
} catch (error) {
return null;
}
}

export async function getSpawnEnv(): Promise<SpawnOptions> {
const { integrated } = workspace.getConfiguration('terminal');
const mappedPlatform = mapPlatform();
Expand Down

0 comments on commit b346650

Please sign in to comment.