Skip to content

Commit

Permalink
auto: Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanV2 committed Jan 10, 2024
1 parent e357873 commit 4ee84e9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions dist/index.js

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions src/diagnose/diagnoser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Character } from "../code/character";
import { Diagnoser, DiagnoserContext, DiagnosticSeverity, InternalDiagnosticsBuilder } from "bc-minecraft-bedrock-diagnoser";
import { Diagnoser, DiagnoserContext, DiagnosticSeverity, ManagedDiagnosticsBuilder } from "bc-minecraft-bedrock-diagnoser";
import { Glob } from "./glob";
import { MCIgnore, MCProject } from "bc-minecraft-project";
import { readFileSync } from "fs";
Expand All @@ -26,7 +26,7 @@ export class Context implements DiagnoserContext {
}

/** @inheritdoc */
getDiagnoser(doc: TextDocument, project: MCProject): InternalDiagnosticsBuilder {
getDiagnoser(doc: TextDocument, project: MCProject): ManagedDiagnosticsBuilder {
//is excluded
if (Glob.IsMatch(doc.uri, project.ignores.patterns)) return undefined;

Expand Down Expand Up @@ -58,18 +58,14 @@ export interface msgError {
severity: DiagnosticSeverity;
}

class _InternalDiagnoser implements InternalDiagnosticsBuilder {
class _InternalDiagnoser implements ManagedDiagnosticsBuilder {
public context: Context;
public project: MCProject;
public doc: TextDocument;
public path: string;
public items: msgError[];

/**
*
* @param context
* @param project
*/
/** @inheritdoc */
constructor(context: Context, project: MCProject, doc: TextDocument) {
this.context = context;
this.project = project;
Expand All @@ -78,6 +74,7 @@ class _InternalDiagnoser implements InternalDiagnosticsBuilder {
this.items = [];
}

/** @inheritdoc */
done(): void {
if (this.items.length <= 0) return;

Expand Down Expand Up @@ -111,7 +108,8 @@ class _InternalDiagnoser implements InternalDiagnosticsBuilder {
//Nothing to mark done
}

Add(position: Types.DocumentLocation, message: string, severity: DiagnosticSeverity, code: string | number): void {
/** @inheritdoc */
add(position: Types.DocumentLocation, message: string, severity: DiagnosticSeverity, code: string | number): void {
if (this.project.attributes["diagnostic.disable." + code] === "false") return;

const r = GetRange(position, this.doc);
Expand Down
2 changes: 1 addition & 1 deletion src/diagnose/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function diagnose_pack(data: PackFiles, context: Context): void {

function diagnose_file(filepath: string, context: Context): void {
try {
context.diagnoser.Process(filepath);
context.diagnoser.process(filepath);
} catch (err) {
core.error(err);
}
Expand Down

0 comments on commit 4ee84e9

Please sign in to comment.