Skip to content

Commit

Permalink
Fix errors #6
Browse files Browse the repository at this point in the history
  • Loading branch information
AziatkaVictor committed Apr 17, 2023
1 parent 50a971b commit a4e59a1
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/ltx/ltxSection.ts
Expand Up @@ -18,19 +18,16 @@ export class LtxSection {
private tempLines: Map<number, string> = new Map<number, string>()

validate() {
if (this.tempLines.size === 0) {
if (this.owner.getType() === LtxDocumentType.Logic) {
this.owner.addError(this.getRange(), "В целях оптимизиции, рекомендуется, если хотите закончить логику, использовать nil. Однако, некоторые секции, перед окончанием работы, должны смениться на другую.", this.name, DiagnosticSeverity.Information, this.isHaveLinks() ? "ReplaceSectionToNil" : "Remove");
}
else {
this.owner.addError(this.getRange(), "Пустая секция", this.name, DiagnosticSeverity.Information, this.isHaveLinks() ? "ReplaceSectionToNil" : "Remove");
}
}
if (!this.isTypeValid()) {
this.owner.addError(this.getTypeRange(), "Неизвестный тип секции.", this.name, DiagnosticSeverity.Error, "InvalidSectionType");
}
if (this.owner.getType() === LtxDocumentType.Logic && !this.isHaveLinks() && this.getTypeName() !== "logic") {
this.owner.addError(this.getRange(), "Данная секция не используется.", this.name, DiagnosticSeverity.Information, "Remove");
else {
if (this.tempLines.size === 0) {
this.owner.addError(this.getRange(), "Пустая секция", this.name, DiagnosticSeverity.Information, this.isHaveLinks() ? "ReplaceSectionToNil" : "Remove");
}
if (this.owner.getType() === LtxDocumentType.Logic && !this.isHaveLinks() && this.getTypeName() !== "logic") {
this.owner.addError(this.getRange(), "Данная секция не используется.", this.name, DiagnosticSeverity.Information, "Remove");
}
}
}

Expand Down

0 comments on commit a4e59a1

Please sign in to comment.