Lint plugin

This commit is contained in:
Andras Schmelczer 2025-01-02 11:57:40 +00:00
parent 4af8f3b23f
commit a2b1a83663
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
6 changed files with 20 additions and 23 deletions

View file

@ -9,7 +9,13 @@ export class LogsView extends ItemView {
public constructor(leaf: WorkspaceLeaf) {
super(leaf);
this.icon = LogsView.ICON;
Logger.getInstance().addOnMessageListener(() => this.updateView());
Logger.getInstance().addOnMessageListener(() => {
this.updateView();
});
}
private static formatTimestamp(timestamp: Date): string {
return timestamp.toTimeString().split(" ")[0];
}
public getViewType(): string {
@ -21,10 +27,10 @@ export class LogsView extends ItemView {
}
public async onOpen(): Promise<void> {
await this.updateView();
this.updateView();
}
private async updateView(): Promise<void> {
private updateView(): void {
const container = this.containerEl.children[1];
container.empty();
@ -44,8 +50,4 @@ export class LogsView extends ItemView {
messageContainer.createEl("span", { text: message.message });
});
}
private static formatTimestamp(timestamp: Date): string {
return timestamp.toTimeString().split(" ")[0];
}
}