2.2.1.2 release notes

 2.2.1.2

  • Issue 2061 - Salesforce has released version 7.141.1 of the CLI which rolls back the breaking changes from 7.140.0. This build removes the workaround added in 2.2.1.1 to use the force:source:legacy:push and force:source:legacy:pull commands. Please make sure that your Salesforce CLI is completely up-to-date, minimally 7.141.1.
  • Issue 2054 - Added Apex support to JetBrains' duplicate code detection code inspection. Note that this feature is only available in JetBrains' commercial IDEs and cannot be used in Community Edition IDEs.

    You can enable, disable, and configure duplicate code detection in Settings / Preferences > Editor > Inspections > General > Duplicated code fragment. The only available configuration value for Apex at present is the minimum "weight" of a duplicate code block. This is a bit of an opaque measurement, but the key notion is that lower values result in smaller duplicated ranges being identified and higher values result in larger duplicated ranges being identified. Whitespace and comments are ignored for purposes of duplicate detection, as are several other syntax elements which can be found as seeming duplicates but for which there is no simple or straightforward deduplication strategy, e.g., body declarations and parameter/argument/type parameter lists.

    At present there are no automated deduplication quick fixes for Apex, though I do intend to add support for method extraction. For that to be most useful, Apex code duplicate detection will need to be enhanced to "anonymize" key elements such as identifier names and string/numeric/boolean literal values, and the instance-specific values can then be passed as arguments to the extracted method. No promises on when that will materialize, but that would be the next major enhancement to this new feature.

    Note that the exact parameters for duplicate detection still likely need some tuning, though after testing the initial defaults against numerous sizeable projects, they seem to hold up nicely. Don't hesitate to report false positives or negatives including clear examples that reproduce the errant behavior.

  • Issue 2059 - Added row sorting to the Log Analyzer configuration trace flags table.
  • Salesforce Functions enhancements and updates
    • Added full support for containerless local function execution. By default, functions started locally now execute directly in the host operating system instead of in a Docker container, though it's still possible to execute functions locally in a Docker container if desired by checking the Use container option when starting a function for local execution. Function deployment and startup times are dramatically faster when executed locally vs. in a container. All local execution features are available when executing not in a Docker container including interactive debugging, automatic function startup if necessary when invoking a function via a run configuration, etc.

      But wait, there's more! As an added bonus, I've also noticed that interactive debugging of TypeScript-based functions now works properly when executed locally without a container, presumably because the source maps are located and used.

    • Removed all obsolete local function execution configuration options, specifically NetworkEnvironment variablesClear cache, and No pull.
    • Added the ability to start, stop, and restart multiple functions locally from the Salesforce Functions Dashboard. You can either select multiple nodes in the functions tree including one or more branch nodes, and all selection-scoped functions which are valid for the selected action are included. You are also now prompted as to exactly which functions would be affected by the action before it is allowed to proceed.
  • PMD enhancements and updates
    • The real-time PMD integration code inspection has once again leveled up and is now called PMD Salesforce instead of PMD Apex and Visualforce (and before that, PMD Apex). This is because support has been added for real-time integration of PMD XML rules, specifically in support of XPath-based XML rules for validation of Salesforce metadata XML files.