@herb-tools/formatter 0.8.4 → 0.8.6
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/herb-format.js +96 -26
- package/dist/herb-format.js.map +1 -1
- package/dist/index.cjs +39 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +39 -4
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -243,7 +243,7 @@ class Token {
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
246
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
246
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.6/templates/javascript/packages/core/src/errors.ts.erb
|
|
247
247
|
class HerbError {
|
|
248
248
|
type;
|
|
249
249
|
message;
|
|
@@ -746,6 +746,40 @@ class MissingERBEndTagError extends HerbError {
|
|
|
746
746
|
return output;
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
+
class ERBMultipleBlocksInTagError extends HerbError {
|
|
750
|
+
static from(data) {
|
|
751
|
+
return new ERBMultipleBlocksInTagError({
|
|
752
|
+
type: data.type,
|
|
753
|
+
message: data.message,
|
|
754
|
+
location: Location.from(data.location),
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
constructor(props) {
|
|
758
|
+
super(props.type, props.message, props.location);
|
|
759
|
+
}
|
|
760
|
+
toJSON() {
|
|
761
|
+
return {
|
|
762
|
+
...super.toJSON(),
|
|
763
|
+
type: "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR",
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
toMonacoDiagnostic() {
|
|
767
|
+
return {
|
|
768
|
+
line: this.location.start.line,
|
|
769
|
+
column: this.location.start.column,
|
|
770
|
+
endLine: this.location.end.line,
|
|
771
|
+
endColumn: this.location.end.column,
|
|
772
|
+
message: this.message,
|
|
773
|
+
severity: 'error'
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
treeInspect() {
|
|
777
|
+
let output = "";
|
|
778
|
+
output += `@ ERBMultipleBlocksInTagError ${this.location.treeInspectWithLabel()}\n`;
|
|
779
|
+
output += `└── message: "${this.message}"\n`;
|
|
780
|
+
return output;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
749
783
|
function fromSerializedError(error) {
|
|
750
784
|
switch (error.type) {
|
|
751
785
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -759,6 +793,7 @@ function fromSerializedError(error) {
|
|
|
759
793
|
case "RUBY_PARSE_ERROR": return RubyParseError.from(error);
|
|
760
794
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
761
795
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
796
|
+
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
762
797
|
default:
|
|
763
798
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
764
799
|
}
|
|
@@ -773,7 +808,7 @@ function convertToUTF8(string) {
|
|
|
773
808
|
}
|
|
774
809
|
|
|
775
810
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
776
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
811
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.6/templates/javascript/packages/core/src/nodes.ts.erb
|
|
777
812
|
class Node {
|
|
778
813
|
type;
|
|
779
814
|
location;
|
|
@@ -3007,7 +3042,7 @@ class ParseResult extends Result {
|
|
|
3007
3042
|
}
|
|
3008
3043
|
|
|
3009
3044
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3010
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3045
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.6/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
3011
3046
|
/**
|
|
3012
3047
|
* Type guard functions for AST nodes.
|
|
3013
3048
|
* These functions provide type checking by combining both instanceof
|
|
@@ -3504,7 +3539,7 @@ function getNodesAfterPosition(nodes, position, inclusive = true) {
|
|
|
3504
3539
|
}
|
|
3505
3540
|
|
|
3506
3541
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3507
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3542
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.6/templates/javascript/packages/core/src/visitor.ts.erb
|
|
3508
3543
|
class Visitor {
|
|
3509
3544
|
visit(node) {
|
|
3510
3545
|
if (!node)
|