Skip to content

Commit

Permalink
Merge pull request #7 from bilgorajskim/master
Browse files Browse the repository at this point in the history
Fix for WSL / Remote Development
  • Loading branch information
89netraM authored Feb 24, 2021
2 parents d6273a2 + 8dc62e2 commit c59006c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"publisher": "89netraM",
"description": "Are red squiggly lines not enough? Do you wish for more of a kick when you make an error? Have VS Code scream at you whenever you type something that isn't correct.",
"icon": "assets/icon.png",
"extensionKind": [
"ui"
],
"repository": {
"type": "git",
"url": "https://github.com/89netraM/hotheaded-vscode.git"
Expand Down
22 changes: 7 additions & 15 deletions src/ErrorTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,23 @@ import { DiagnosticChangeEvent, Uri, Diagnostic, window, languages, DiagnosticSe
import { bash } from "./Basher";

export function OnDidChangeDiagnostics(e: DiagnosticChangeEvent): void {
if (window.activeTextEditor !== undefined && e.uris.includes(window.activeTextEditor.document.uri)) {
const errors = errorsForActiveFile(window.activeTextEditor, e.uris);

const activeTextEditor = window.activeTextEditor;
if (
activeTextEditor && e.uris.find(uri => uri.path === activeTextEditor.document.uri.path)
) {
const errors = errorsForFile(activeTextEditor, activeTextEditor.document.uri);
if (errors.length > 0) {
if (errors.filter(d => !sameAsPrevious(d)).length > 0) {
if (errors.filter((d) => !sameAsPrevious(d)).length > 0) {
console.log(errors);
bash();
setPreviousError(errors[0]);
}
}
else {
} else {
console.log("No errors");
clearPreviousError();
}
}
}

function errorsForActiveFile(editor: TextEditor, errorUris: ReadonlyArray<Uri>): Array<Diagnostic> {
if (errorUris.includes(editor.document.uri)) {
return errorsForFile(editor, editor.document.uri);
}
else {
return new Array<Diagnostic>();
}
}
function errorsForFile(editor: TextEditor, fileUri: Uri): Array<Diagnostic> {
return languages
.getDiagnostics(fileUri)
Expand Down

0 comments on commit c59006c

Please sign in to comment.