Skip to content

Commit

Permalink
minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Jul 8, 2023
1 parent 88f368d commit d4355e8
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ import open from 'open';
import vscode from 'vscode';
import which from 'which';



type DiagnosticCollection = {
code?: string;
message?: string;
range?: vscode.Range;
severity?: vscode.DiagnosticSeverity;
code?: string;
message?: string;
range?: vscode.Range;
severity?: vscode.DiagnosticSeverity;
}

export function getNullDevice(): string {
Expand Down Expand Up @@ -77,7 +75,7 @@ export async function getMakensisPath(): Promise<string> {
console.error('[vscode-nsis]', error instanceof Error ? error.message : error);
}

return 'makensis';
return 'makensis';
}

export function mapPlatform(): string {
Expand Down Expand Up @@ -183,7 +181,7 @@ export async function getOverrideCompression(): Promise<string> {
}

export function getLineLength(line: number): number {
const editorText = vscode.window.activeTextEditor.document.getText();
const editorText = vscode.window.activeTextEditor?.document.getText();

if (editorText && editorText.length) {
const lines: string[] = editorText.split('\n');
Expand Down Expand Up @@ -228,8 +226,8 @@ export async function findWarnings(input: string): Promise<unknown[]> {

const warningLines = input.split('\n');
if (!warningLines.length) {
return [output];
}
return [output];
}

if (warningLines.length) {
// Note to self: Don't use map()
Expand All @@ -253,7 +251,7 @@ export async function findWarnings(input: string): Promise<unknown[]> {
}
}

return output;
return output;
}

export function findErrors(input: string): DiagnosticCollection {
Expand Down

0 comments on commit d4355e8

Please sign in to comment.