All files / src/objects _unknown_object.ts

94.59% Statements 35/37
100% Branches 4/4
80% Functions 4/5
94.59% Lines 35/37

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 371x 1x 1x 1x 1x 1x 1x 1x 1x 5x 5x 5x 1x 1x 39x 39x 1x 1x 2x 2x 2x 2x 2x 1x 1x     1x 1x 3x 3x 3x 3x 3x 3x 1x 1x
import {AbstractObject} from "./_abstract_object";
import {Issue} from "../issue";
import {Position} from "../position";
import {Severity} from "../severity";
 
export class UnknownObject extends AbstractObject {
  private readonly type: string;
 
  public constructor(name: string, type: string) {
    super(name);
    this.type = type;
  }
 
  public getType(): string {
    return this.type;
  }
 
  public getAllowedNaming() {
    return {
      maxLength: 100,
      allowNamespace: true,
    };
  }
 
  public getDescription(): string | undefined {
    return undefined;
  }
 
  public getParsingIssues() {
    const pos = new Position(1, 1);
    const file = this.getFiles()[0]!;
    const message = "Unknown object type, currently not supported in abaplint, open issue on github";
    const issue = Issue.atPosition(file, pos, message, "parser_error", Severity.Error);
    return [issue];
  }
 
}