Status/Resolution/Reason: To Fix//BugVerified
Reporter/Name(from Bugbase): Aaron Neff / ()
Created: 04/18/2018
Components: Editor Features, Code Formatting
Versions: 2018
Failure Type: Usability Issue
Found In Build/Fixed In Build: 308133 /
Priority/Frequency: Major / Most users will encounter
Locale/System: / Windows 10 64 bit
Vote Count: 2
Issue for: CFB's Formatter does not always work
Steps to Reproduce:
1) Select the following code, and do CTRL+SHIFT+F
-----------
<cfscript>
switch(foo) {
case "one": {
asdf = "asdf";
break;
}
}
</cfscript>
-----------
2) See formatting was applied successfully. Good.
3) Revert to the incorrect formatting, then remove the semicolons and retry CTRL+SHIFT+F
4) See Formatter did nothing. Bad.
5) Select the following code, and choose CTRL+SHIFT+F
-----------
<cfscript>
myVar = [1,1.1,1*1,"1.1",createDate(2018,1,1).convert("local2utc"),true,"yes"];
writeOutput("<ol>");
myVar.each(function(element) {
writeOutput('<li>' & element & ' is ' & element.getClass().getName() & '</li>');
});
writeOutput("</ol>");
myJSON = serializeJSON(myVar);
writeOutput('JSON: ' & myJSON);
myVar = deserializeJSON(myJSON);
writeOutput("<ol>");
myVar.each(function(element) {
writeOutput('<li>' & element & ' is ' & element.getClass().getName() & '</li>');
});
writeOutput("</ol>");
</cfscript>
-----------
6) See Formatter did nothing. Bad.
Note: The above are just examples. It's pretty easy to break the Formatter.
Attachments:
Comments: