Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Jun 4, 2023
1 parent 29b9e20 commit 6e8a5ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ async function updateDiagnostics(document: vscode.TextDocument | null, collectio
console.error('[vscode-nsis]', error instanceof Error ? error.message : error);
}

const diagnostics = [];
const diagnosticsResult = [];

const warnings = await findWarnings(output.stdout);
if (warnings) diagnostics.push(...warnings);
if (warnings) diagnosticsResult.push(...warnings);

const error = findErrors(output.stderr);
if (error) diagnostics.push(error);
if (error) diagnosticsResult.push(error);

collection.set(document.uri, diagnostics);
collection.set(document.uri, diagnosticsResult);
} else {
collection.clear();
}
Expand Down
3 changes: 3 additions & 0 deletions src/makensis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ async function compile(strictMode: boolean): Promise<void> {
document.fileName,
{
env: await getProjectPath() || false,
events: true,
json: showFlagsAsObject,
pathToMakensis: await getMakensisPath(),
rawArguments: compiler.customArguments,
Expand All @@ -79,6 +80,7 @@ async function showVersion(): Promise<void> {

await NSIS.version(
{
events: true,
pathToMakensis: pathToMakensis || undefined
},
await getSpawnEnv()
Expand All @@ -95,6 +97,7 @@ async function showCompilerFlags(): Promise<void> {

await NSIS.headerInfo(
{
events: true,
json: showFlagsAsObject || false,
pathToMakensis: pathToMakensis || undefined
},
Expand Down

0 comments on commit 6e8a5ed

Please sign in to comment.