Skip to content

Commit

Permalink
fix linter lags
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilja Postnovs authored and Ilja Postnovs committed May 16, 2024
1 parent 0021d28 commit 23682d2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/classes/utils/FileWatcherMediator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { PackageLinterConfigHandler } from "ui5plugin-linter";
import { PackageParserConfigHandler, ParserPool, toNative, UI5TSParser } from "ui5plugin-parser";
import { ICacheable } from "ui5plugin-parser/dist/classes/parsing/abstraction/ICacheable";
import { AbstractCustomClass } from "ui5plugin-parser/dist/classes/parsing/ui5class/AbstractCustomClass";
import { CustomJSClass } from "ui5plugin-parser/dist/classes/parsing/ui5class/js/CustomJSClass";
import { IReferenceCodeLensCacheable } from "ui5plugin-parser/dist/classes/parsing/util/referencefinder/ReferenceFinderBase";
import * as vscode from "vscode";
Expand Down Expand Up @@ -65,11 +64,6 @@ export class FileWatcherMediator {
if (document.fileName.endsWith(".js") || document.fileName.endsWith(".ts")) {
const currentClassNameDotNotation = parser.fileReader.getClassNameFromPath(document.fileName);
if (currentClassNameDotNotation) {
const UIClass = parser.classFactory.getUIClass(currentClassNameDotNotation) as AbstractCustomClass;
const textChanged =
force ||
UIClass.classText.length !== document.getText().length ||
UIClass.classText !== document.getText();
if (FileWatcherMediator._parsingTimeout[document.fileName]) {
clearTimeout(FileWatcherMediator._parsingTimeout[document.fileName]);
}
Expand Down Expand Up @@ -99,9 +93,7 @@ export class FileWatcherMediator {
parser.classFactory.setNewCodeForClass(currentClassNameDotNotation, document.getText(), force);
}

if (textChanged || force) {
EventBus.fireCodeUpdated(document);
}
EventBus.fireCodeUpdated(document);

delete FileWatcherMediator._parsingTimeout[document.fileName];
}, vscode.workspace.getConfiguration("ui5.plugin").get<number>("parsingDelay"));
Expand Down

0 comments on commit 23682d2

Please sign in to comment.