Skip to content

Latest commit

 

History

History
371 lines (251 loc) · 21.1 KB

CHANGELOG.md

File metadata and controls

371 lines (251 loc) · 21.1 KB

3.0.0

Please follow this guide to upgrade Prettier Apex to this new major version.

Dependency Changes

  • Support Prettier v3 (issue). You cannot use this version with Prettier v2, please plan your upgrade accordingly.
  • Drop support for NodeJS < 18.11.0.

Internal Changes

  • Prettier Apex is now distributed as an ECMAScript Module. This shouldn't affect normal usage of the library, but if you are importing code from Prettier Apex you may need to change your code to adapt.
  • Allow user to customize the secret used to shut down the parsing server.
  • Allow user to specify the protocol (HTTP/HTTPS) that the parsing server uses.

2.3.0

Formatting Changes

  • Add support for User Mode in Database Operations (issue).

Dependency Changes

  • Support Prettier v3 (issue). You cannot use this version with Prettier v2, please plan your upgrade accordingly.
  • Drop support for NodeJS < 16.19.0.

2.2.0

Formatting Changes

  • Add a new option apexForceCurly that allows to force curly brackets for if-else and loop blocks issue.
  • Enhance the apexFormatAnnotations option by merging it with the apexAnnotationsArgsSpacing option. The apexAnnotationsArgsSpacing option is not available separately anymore. If apexFormatAnnotation option is enabled it would also format annotation arguments to lower came case issue.
  • Make the apexFormatStandardTypes option less powerful, removing the ability to correct chained methods calls. Now, the option will only work for types in declarations. This was made to increase reliability and make the output more predictable since it was possible that the variable name would be misinterpreted and printed uppercase, for example.
  • Allow an extra line break in the beginning of the class/interface declaration issue.
  • Change the formatting behaviour for apexFormatInlineComments. It's now a choice option. Check out how it can be used in the changelog examples issue.

2.1.1

Internal Changes

  • Fix the issue with the package installation that was caused by husky.

2.1.0

Internal Changes

  • start-apex-server takes optional -c flag, which will be passed on to apex-ast-serializer as a comma-delimited list of allowed origins that will be added to the CORS headers returned by the parsing server.
  • start-apex-server pipes internal logs to console, so that errors can be caught more quickly by users.

Formatting Changes

  • Fix an issue with the apexSortModifiers option which removes a method modifier if there is an own-line comment between annotation and method (issue).
  • Fix an issue with the apexExplicitAccessModifier option when all trigger variables are treated as fields, adding non needed private keyword (issue).
  • Fix an issue with the apexExplicitAccessModifier option when the webservice method gets an access modifier (issue).
  • Fix an issue with the apexExplicitAccessModifier option when the method parameters get private modifier (issue).
  • Update the apexFormatAnnotations option to convert the testmethod method modifier to the @IsTest annotation (issue).
  • Change the formatting of webservice and testmethod modifiers to be always printed in lowercase instead of webService and testMethod.

2.0.3

Formatting Changes

  • Fix an issue with the apexExplicitAccessModifier option. Now it won't work for the anonymous Apex files.

2.0.0

Formatting Changes

  • Add option to format inline comments (apexFormatInlineComments)
  • Add option to format annotation names to always be upper camel case (apexFormatAnnotations)
  • Add option to add spaces between annotation arguments keys and values (apexAnnotationsArgsSpacing)
  • Add option to make closing bracket remain on the same line if the block is empty (apexEmptyBlockBracketLine)
  • Add additional space before the opening bracket for the collections initialization: new Map<> {
  • Add option to format standard Apex types references (apexFormatStandardTypes)
  • Add option to format properties so that if getter or setter has only one statement they are aligned in one line (apexExpandOneLineProperties)
  • Add option to explicitly put the private keyword if the access modifier was not provided (apexExplicitAccessModifier)
  • Add option to place class member modifiers in the specific order. For fields: <access> static final transient, for methods: <access> static/override virtual/abstract (apexSortModifiers)

1.12.0

Formatting Changes

  • Fix binaryish expressions having wrong indentation inside parentheses (issue).
  • Keep original position for comments in between If-Else blocks and Try-Catch blocks, accordingly fix issue with unprinted comment (issue).

Internal Changes

  • Use yarn for internal dependency management instead of npm. If you forked this repository before this change, make sure to follow CONTRIBUTING.md to set up your environment again.
  • start-apex-server and stop-apex-server no longer exports any methods. This should not affect any user functionality, but if you are a developer who's relying on those methods, please import start and stop from http-server instead.

1.11.0

Dependency Changes

  • Drop support for NodeJS < 14.

Internal Changes

  • Prettier Apex has been converted to Typescript, enabling faster response time to internal jorje changes from Salesforce.

CLI Changes

  • Breaking: Locations for start-apex-server.js and stop-apex-server.js are changed - they are now in the dist directory.
  • Add ability to specify host and port options for built-in parsing server (issue).

Formatting Changes

  • Add support for SOQL Geolocation Expression (issue).
  • Fix SOQL Time literals always getting printed in UTC timezone.
  • Fix wrong indentations inside long SELECT functions (issue).
  • Remove extraneous newline at the end of long GROUP BY and WITH DATA CATEGORY clauses (issue).
  • Fix unstable leading comment formatting for ternary expressions (issue).
  • Add support for prettier-ignore comments in the middle of IfElseBlock (issue).
  • Use user input to improve line break heuristics in short SOQL/SOSL queries (issue).
  • Fix unstable leading comments before Block Statement.
  • Support trailing prettier-ignore comments (issue).
  • Fix failure to call apex-ast-serializer because of excessively long CLASSPATH on Windows (issue).
  • Fix unstable end of line comments in binaryish expressions.

1.10.0

Dependency Changes

  • Drop support for NodeJS < 12.

Formatting Changes

  • Fix last comment inside New Expression turning into trailing comment (issue).
  • Fix prettier-ignore comment getting attached to modifier node instead of surrounding expressions (issue).

1.9.1

  • Fix Enum cases using wrong separator in switch statements (issue).

1.9.0

Dependency Changes

  • Drop support for Java < 11.
  • Add support for Java 16.

Formatting Changes

  • Fix SOQL query string getting quoted incorrectly in LIKE expressions (issue).
  • Prefer list init syntax new Object[0] in certain situations (issue) - thanks to @brianmfear.

1.8.0

  • Remove extraneous indentation and blank line for HAVING clauses (issue).

Internal changes

  • Upgrade dependencies to fix security issues.
  • Move CI/CD pipeline from Travis to Github Actions.

1.7.0

  • Add support for Safe Navigation Operator (doc).
  • Always break up TYPEOF SOQL queries (issue).
  • Remove extraneous grouping in certain binary-ish expressions (issue).

1.6.0

  • Handle new jorje structure for types in enhanced for loops.
  • Clearer error message when failing to connect to standalone Apex parser server (issue).
  • Handle SOQL Select Distance Expression (issue).
  • Use alignment instead of indentation to provide clarity for ternary expressions (issue).
  • Use uppercase TRUE, FALSE, NULL in SOQL expressions (issue).

1.5.0

  • Fix incorrect formatting of for loop inits without initialization (issue).

1.4.0

Dependency Changes

  • Support Prettier 2.0 (issue).
  • NodeJS support limited to version >= 10.13.0 - driven by Prettier 2.0.

Formatting Changes:

  • Remove extraneous leading empty line in anonymous code blocks.

Misc

  • Sync parser name with Visual Studio Code language Id for Anonymous Apex (issue).

1.3.0

  • Remove extraneous whitespaces between Enum modifiers (issue).

1.2.0

  • Preserve code points from original source code (issue).

1.1.0

Dependency Changes

  • Prettier >= 1.19 is now required to be used with this plugin, in order to support new option type string.

CLI Changes

  • Add option apexStandaloneHost, default to localhost.

Formatting Changes

  • Fix last comment in Annotations being put in wrong location (issue).
  • Fix Name Value Parameters using more newlines than necessary (issue).

1.0.0

API Changes

  • Remove --apex-anonymous option, use apex-anonymous parser instead (issue).

Formatting Changes

  • By default, add curly bracket spacing for maps, lists and sets (issue).
  • Fix extraneous linebreaks being added after this variable expression (issue).
  • Fix wrong comment position in a long method/variable chain (issue).
  • Fix extraneous linebreaks for empty parameter list in long method declarations (issue).
  • Fix SOQL query numbers losing negative value (issue).
  • Fix method call expressions containing this and super having an extra indentation level.
  • Fix trailing comment wrong location after last element in list/set/map init literals (issue).

1.0.0-rc.6

  • Fix incorrect format for decimals/doubles (issue).
  • Add support for Number Expression in SOQL Geolocation Literal (issue).
  • Fix duplicated trailing empty lines for multiple expressions on the same line (issue).
  • Fix expressions in Name Value Parameters not being indented (issue).
  • Fix SOQL queries in binaryish expressions having extraneous indentations (issue).
  • Fix SOQL query number being printed as different types (big-decimal to int) in certain situations.

1.0.0-rc.5

  • CLI/Option change:
    • Add apex-insert-final-newline option (issue).
  • Remove newline before SOQL expression in ForInit (issue).
  • Add space before colon in ForEnhancedControl (issue).

1.0.0-rc.4

  • Add support for AnnotationString (issue).

1.0.0-rc.3

  • Update dependency requirement for Prettier.
  • Fix incorrect format for SOQL query with multiple types in FROM clause (issue).
  • Fix incorrect order of expressions in SOSL query (issue).
  • Add support for class and interface generics (issue).

1.0.0-rc.2

  • Remove references to deleted vendor file apex-ast-serializer-ng.

1.0.0-rc.1

  • CLI/Option change:
    • Remove apex-verify-ast option. Please use --debug-check instead.
  • Implement comments using Prettier's API.
  • Add support for prettier-ignore directive (issue).
  • Add support for --require-pragma and --insert-pragma CLI directives.
  • Use internal HTTP server instead of Nailgun for built in parser.
  • Fix unstable comments in between If/Else blocks.
  • Fix unstable comments in between Try/Catch/Finally blocks.
  • Fix unstable comments in WhereCompoundExpr.
  • Fix unstable comments for NestedExpr.
  • Fix unstable formatting for Method Declaration with no body.
  • Fix unstable comments for Annotations.
  • Fix unstable leading comments to ValueWhen and ElseWhen blocks.
  • Throw errors when encountering unknown node types.

1.0.0-beta.2

  • Fix long static method calls producing undeployable code (issue).

1.0.0-beta.1

  • Add support for Anonymous Code block with --apex-anonymous option.
  • CLI/Option change:
    • use-standalone-server option is now apex-standalone-parser, and it is now a choice between none and built-in.
    • server-port option is now apex-standalone-port.
    • Add apex-verify-ast option.
  • Fix dangling comments being printed incorrectly for Triggers (issue). Thanks to @praksb, @ntotten and @vazexqi for their help on getting jorje fixed.
  • Fix SOQL unary expression not generating space before next expression.
  • Add support for SOQL WHERE Calculation Expression (issue).
  • Add support for parameter modifiers (issue).
  • Add support for while loop without body (issue).
  • Add support for for loop without body (issue).
  • Add support for Java expressions/typerefs (issue).
  • Fix Package Version Expression.
  • Fix Unicode characters being printed incorrectly (issue).
  • Workaround for certain cases of AST verification failing (issue).
  • Fix overlapping node with comment when comment contains special characters.
  • Fix awkward breaks for long method call chain (issue),
  • Remove breaks in Map types (issue).
  • Fix binary/boolean expressions breaking after operation despite available space (issue).
  • Fix leading comment to SOQL inner query being misindentified as trailing comment to previous column clause (issue).
  • Fix awkward breaks for multiline binaryish expressions (issue).
  • Fix formatting for Apex types containing expressions but do not add groups and/or breaks.
  • Fix SOQL/SOSL boolean expressions having extra parentheses (issue).
  • Fix ternary expressions not breaking correctly (issue).
  • Fix comments not being indented in binaryish expressions (issue).
  • Fix array index indentation surrounding variable expressions and method call expressions.
  • Fix unstable IfBlock trailing comments.
  • Fix unstable NameValueParameter trailing comments.
  • Fix unstable WhereOpExpr trailing comments.

1.0.0-alpha.9

  • Fix trailing comments after class names not being printed (issue).
  • Add new lines in empty blocks for Enum.
  • Add new lines to long list of annotation parameters.
  • Add new lines to long list of method declaration parameters.
  • Add new line after last usage parameter in long list for triggers.
  • Add new lines to long list of conditions in loops.
  • Fix missing alias in FROM expression (issue).
  • Fix double quotes being escaped unnecessarily (issue).
  • Fix inline comments in blocks being attached to wrong node (issue).
  • Fix comments being pushed to next lines because of node's trailing empty line (issue).

1.0.0-alpha.8

  • Fix comments not being printed if they appear before the root node (issue).
  • Fix dangling comments not being printed for Class, Interface, Enum and Block Statement (issue).
  • Add new lines in empty blocks (issue).
  • Fix trailing comment being mistaken as leading comment in certain situations, because jorje provides wrong start and end indexes for some node types (issue).

1.0.0-alpha.7

  • Fix Annotated Declaration being indented too far (issue).
  • Getter and setter will no longer break if they can fit on the same line.
  • Add documentation for configuration options.

1.0.0-alpha.6

  • Fix formatting for trailing comments at the end of block statements (issue).
  • Fix issue in which comments right before semi colon are not printed (issue).
  • Assert that all comments have been printed out in the formatted code.
  • Fix long expressions not breaking into multi lines (issue).

1.0.0-alpha.5

  • Fix apex-ast-serializer executables not having their execute bits set on *nix (issue).

1.0.0-alpha.4

  • Support WITH SECURITY_ENFORCED in SOQL (issue).
  • Fix npm scripts pointing to old files.

1.0.0-alpha.3

  • Fix DML operation having double indents (issue).
  • Rename scripts to start and stop Apex Parser Server.

1.0.0-alpha.2

  • Use Prettier's default options for tabWidth and printWidth.
  • Invoke apex-ast-serializer directly by default, with option to use Nailgun server.

1.0.0-alpha.1

  • Initial release.