@herb-tools/formatter 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -241,7 +241,7 @@ class Token {
241
241
  }
242
242
 
243
243
  // NOTE: This file is generated by the templates/template.rb script and should not
244
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.4/templates/javascript/packages/core/src/errors.ts.erb
244
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/errors.ts.erb
245
245
  class HerbError {
246
246
  type;
247
247
  message;
@@ -744,6 +744,40 @@ class MissingERBEndTagError extends HerbError {
744
744
  return output;
745
745
  }
746
746
  }
747
+ class ERBMultipleBlocksInTagError extends HerbError {
748
+ static from(data) {
749
+ return new ERBMultipleBlocksInTagError({
750
+ type: data.type,
751
+ message: data.message,
752
+ location: Location.from(data.location),
753
+ });
754
+ }
755
+ constructor(props) {
756
+ super(props.type, props.message, props.location);
757
+ }
758
+ toJSON() {
759
+ return {
760
+ ...super.toJSON(),
761
+ type: "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR",
762
+ };
763
+ }
764
+ toMonacoDiagnostic() {
765
+ return {
766
+ line: this.location.start.line,
767
+ column: this.location.start.column,
768
+ endLine: this.location.end.line,
769
+ endColumn: this.location.end.column,
770
+ message: this.message,
771
+ severity: 'error'
772
+ };
773
+ }
774
+ treeInspect() {
775
+ let output = "";
776
+ output += `@ ERBMultipleBlocksInTagError ${this.location.treeInspectWithLabel()}\n`;
777
+ output += `└── message: "${this.message}"\n`;
778
+ return output;
779
+ }
780
+ }
747
781
  function fromSerializedError(error) {
748
782
  switch (error.type) {
749
783
  case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
@@ -757,6 +791,7 @@ function fromSerializedError(error) {
757
791
  case "RUBY_PARSE_ERROR": return RubyParseError.from(error);
758
792
  case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
759
793
  case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
794
+ case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
760
795
  default:
761
796
  throw new Error(`Unknown node type: ${error.type}`);
762
797
  }
@@ -771,7 +806,7 @@ function convertToUTF8(string) {
771
806
  }
772
807
 
773
808
  // NOTE: This file is generated by the templates/template.rb script and should not
774
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.4/templates/javascript/packages/core/src/nodes.ts.erb
809
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/nodes.ts.erb
775
810
  class Node {
776
811
  type;
777
812
  location;
@@ -3005,7 +3040,7 @@ class ParseResult extends Result {
3005
3040
  }
3006
3041
 
3007
3042
  // NOTE: This file is generated by the templates/template.rb script and should not
3008
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.4/templates/javascript/packages/core/src/node-type-guards.ts.erb
3043
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/node-type-guards.ts.erb
3009
3044
  /**
3010
3045
  * Type guard functions for AST nodes.
3011
3046
  * These functions provide type checking by combining both instanceof
@@ -3502,7 +3537,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
3502
3537
  }
3503
3538
 
3504
3539
  // NOTE: This file is generated by the templates/template.rb script and should not
3505
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.4/templates/javascript/packages/core/src/visitor.ts.erb
3540
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.5/templates/javascript/packages/core/src/visitor.ts.erb
3506
3541
  class Visitor {
3507
3542
  visit(node) {
3508
3543
  if (!node)