Fix babylon misplacing comments (#3441)
* Fix comments in class method args * Fix comments in obj propertymaster
parent
4f24892e53
commit
934e4d3027
|
@ -207,7 +207,6 @@ function attach(comments, ast, text, options) {
|
||||||
comment
|
comment
|
||||||
) ||
|
) ||
|
||||||
handleImportSpecifierComments(enclosingNode, comment) ||
|
handleImportSpecifierComments(enclosingNode, comment) ||
|
||||||
handleObjectPropertyComments(enclosingNode, comment) ||
|
|
||||||
handleForComments(enclosingNode, precedingNode, comment) ||
|
handleForComments(enclosingNode, precedingNode, comment) ||
|
||||||
handleUnionTypeComments(
|
handleUnionTypeComments(
|
||||||
precedingNode,
|
precedingNode,
|
||||||
|
@ -273,7 +272,6 @@ function attach(comments, ast, text, options) {
|
||||||
handlePropertyComments(enclosingNode, comment) ||
|
handlePropertyComments(enclosingNode, comment) ||
|
||||||
handleExportNamedDeclarationComments(enclosingNode, comment) ||
|
handleExportNamedDeclarationComments(enclosingNode, comment) ||
|
||||||
handleOnlyComments(enclosingNode, ast, comment, isLastComment) ||
|
handleOnlyComments(enclosingNode, ast, comment, isLastComment) ||
|
||||||
handleClassMethodComments(enclosingNode, comment) ||
|
|
||||||
handleTypeAliasComments(enclosingNode, followingNode, comment) ||
|
handleTypeAliasComments(enclosingNode, followingNode, comment) ||
|
||||||
handleVariableDeclaratorComments(enclosingNode, followingNode, comment)
|
handleVariableDeclaratorComments(enclosingNode, followingNode, comment)
|
||||||
) {
|
) {
|
||||||
|
@ -756,14 +754,6 @@ function handleImportSpecifierComments(enclosingNode, comment) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleObjectPropertyComments(enclosingNode, comment) {
|
|
||||||
if (enclosingNode && enclosingNode.type === "ObjectProperty") {
|
|
||||||
addLeadingComment(enclosingNode, comment);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleLabeledStatementComments(enclosingNode, comment) {
|
function handleLabeledStatementComments(enclosingNode, comment) {
|
||||||
if (enclosingNode && enclosingNode.type === "LabeledStatement") {
|
if (enclosingNode && enclosingNode.type === "LabeledStatement") {
|
||||||
addLeadingComment(enclosingNode, comment);
|
addLeadingComment(enclosingNode, comment);
|
||||||
|
@ -887,14 +877,6 @@ function handleAssignmentPatternComments(enclosingNode, comment) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClassMethodComments(enclosingNode, comment) {
|
|
||||||
if (enclosingNode && enclosingNode.type === "ClassMethod") {
|
|
||||||
addTrailingComment(enclosingNode, comment);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleTypeAliasComments(enclosingNode, followingNode, comment) {
|
function handleTypeAliasComments(enclosingNode, followingNode, comment) {
|
||||||
if (enclosingNode && enclosingNode.type === "TypeAlias") {
|
if (enclosingNode && enclosingNode.type === "TypeAlias") {
|
||||||
addLeadingComment(enclosingNode, comment);
|
addLeadingComment(enclosingNode, comment);
|
||||||
|
|
|
@ -41,6 +41,14 @@ class X {
|
||||||
'<div class="ag-large-textarea"></div>' +
|
'<div class="ag-large-textarea"></div>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SnapshotLogger {
|
||||||
|
constructor(
|
||||||
|
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||||
|
snapshotInterval: number = 30 * 1000, // snapshot no more than every 30s
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
class A // comment 1
|
class A // comment 1
|
||||||
// comment 2
|
// comment 2
|
||||||
|
@ -87,4 +95,11 @@ class X {
|
||||||
"</div>";
|
"</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SnapshotLogger {
|
||||||
|
constructor(
|
||||||
|
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||||
|
snapshotInterval: number = 30 * 1000 // snapshot no more than every 30s
|
||||||
|
) {}
|
||||||
|
}
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -38,3 +38,11 @@ class X {
|
||||||
'<div class="ag-large-textarea"></div>' +
|
'<div class="ag-large-textarea"></div>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SnapshotLogger {
|
||||||
|
constructor(
|
||||||
|
retentionPeriod: number = 5 * 60 * 1000, // retain past five minutes
|
||||||
|
snapshotInterval: number = 30 * 1000, // snapshot no more than every 30s
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
run_spec(__dirname, ["flow"]);
|
run_spec(__dirname, ["flow", "babylon"]);
|
||||||
|
|
Loading…
Reference in New Issue