You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all congrats on the native parser solution, just ran it through my entire company code base (7500 files) and went from 1 hour and 10 minutes on the First run to 10 minutes on the native
After running it I found 4 mismatches between the first run (over an 'ugly' file) and the second run (over a 'prettied' file)
REP_obj_casosProductos__cnuevoCasoProducto=newREP_obj_casosProductos__c(
/*Name = ESDIM_cls_metodosComunes.TEST,*/REP_fld_product__c=equiposMaestro[
i
]
.Id,
REP_fld_caso__c=lstCase[i].Id
);
insertnuevoCasoProducto;
2.1. First run
if (
mapOrderItem.containsKey(
porder.OrderId
) /* && mapOrderTank.containsKey(porder.OrderId)*/
) {
System.debug('Lo contiene el map de OI');
mapOrderItem.get(porder.OrderId).add(porder);
//mapOrderTank.get(porder.OrderId).add(porder.ESESO_fld_nombreTanqueL__c);
} else {
System.debug('No lo contiene el mapa de OI');
mapOrderItem.put(
porder.OrderId,
newList<OrderItem>{ porder }
);
//mapOrderTank.put(porder.OrderId, new List<Id>{porder.ESESO_fld_nombreTanqueL__c});
}
2.2. Second run
if (mapOrderItem.containsKey(porder.OrderId)) {
/* && mapOrderTank.containsKey(porder.OrderId)*/System.debug('Lo contiene el map de OI');
mapOrderItem.get(porder.OrderId).add(porder);
//mapOrderTank.get(porder.OrderId).add(porder.ESESO_fld_nombreTanqueL__c);
} else {
System.debug('No lo contiene el mapa de OI');
mapOrderItem.put(
porder.OrderId,
newList<OrderItem>{ porder }
);
//mapOrderTank.put(porder.OrderId, new List<Id>{porder.ESESO_fld_nombreTanqueL__c});
}
Thanks (again) for testing the native parser out, I appreciate the help in checking out the edge cases for it.
May I ask how you did the tests? (i.e. how did you find out the diffs between the standard parser vs the native parser)
I'm curious to know if it's actually the problem with the native parser, or if you found a bug with some unstable formatting in the library itself (unstable here means that multiple subsequent formats change the formatted code, usually it's a bug that needs fixing).
Run prettier to all my codebase using the standard parser
Commit changes
Run prettier to all my codebase using the native parser
Compare differences in git
Following your request, in one of the classes I tried this:
Run prettier
Stage changes
Run prettier again
Compare changes, the comment has moved...
This happens with both native and standard parser, so this is not longer related only to the native parser, I'm updating the title of the issue
mnunezdm
changed the title
Differences between standard parser and native parser formatting
Differences when running prettier more than one time over the same file content
Apr 26, 2024
Hello!!
First of all congrats on the native parser solution, just ran it through my entire company code base (7500 files) and went from 1 hour and 10 minutes on the First run to 10 minutes on the native
After running it I found 4 mismatches between the first run (over an 'ugly' file) and the second run (over a 'prettied' file)
Describe your Issue
1.1. First run
1.2. Second run
2.1. First run
2.2. Second run
3.1. First run
3.2. Second run
4.1. First run
4.2. Second run
Additional information (please fill this out):
npm ls prettier-plugin-apex
): [e.g.[email protected]
]npm ls prettier
): [e.g.[email protected]
]java -version
): [e.g.openjdk version "11"
]$ java -version openjdk version "21.0.2" 2024-01-16 LTS OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode)
Huge congrats again on the performance boost!!!!!!!
The text was updated successfully, but these errors were encountered: