2.4.1.0 release notes

2.4.1.0

  • Many improvements and fixes for Apex multiline strings and string templates:
    • Generalized string template support so that it works properly for both simple strings and multiline strings.
    • Added support for bidirectional navigation and highlighting of string template variable declarations and references. Note that highlighting of references when the caret is on a ${name} reference in a string literal is still not perfect. Unfortunately this seems to be due to some aggressive caching in the JetBrains IDE itself since the string literal is technically a single element, so I may not be able to improve it beyond its current state.
    • Added support for renaming of string template variables via both the associated map key and any reference to that key.
    • Changed multiline string literal syntax highlighting to match how the analogs are displayed in other first-class languages such as Java and JavaScript/TypeScript. Added indent guides to show the left border of indented multiline string contents.
    • Fixed several issues with multiline string formatting.
    • Whitespace-only lines in multiline string literals are no longer removed by the IDE on save and are padded as appropriate on format.
    • The IDE's Join Lines action now works properly with multiline strings, joining with LF (\n) characters and ultimately into a simple single-line string when the last two lines in the multiline string are joined.
    • Add a new code inspection and quick-fix to convert simple string literals and string concatenation expressions into the associated multiline strings including automatic creation of the string template variable map if necessary. There are several restrictions and limitations on when/how this functionality is available:
      • Multiline strings are only valid in API v67.0+. When converting a simple string literal or string concatenation expression to a multiline string in a file with an insufficient API version, IC automatically updates the Apex source file API version to the project/connection API version if at least 67.0 or the most recent platform API version — currently 67.0 — if not.
      • Currently multiline strings are only valid in Apex source files with LF (\n) line separators. When converting a simple string literal or string concatenation expression to a multiline string, IC automatically converts containing files' line endings accordingly if needed. IC also includes a separate inspection for detecting Apex source files containing multiline strings and non-LF line separators and a quick-fix to change those files' line separators to LF.
      • The inspection is only enabled for simple string literals and string concatenation expressions that begin with a simple string literal and contain no multiline string literals.
      • By default, the inspection is only enabled for simple string literals and string concatenation expressions that contain one or more newline (\n) characters, and the resulting multiline string is split based on those newlines resulting in the exact same contents. These two options can be enabled and disabled as desired. The inspection also includes an option to enable it for string concatenation expressions that do not contain any newlines but do span multiple lines. When this option is enabled and used, the resulting multiline string is split based on the editor line breaks found in the original string concatenation expression. Note that this changes the contents of the resulting string, but in many cases it does so according to the author's original intention. This option is disabled by default and must be enabled explicitly. The results of a multiline string conversion based on inferred line breaks should be reviewed carefully.
      As noted previously, the quick-fix automatically converts all non-string literal expressions found in string concatenation expressions into string template variables. These variables are named based on the original expressions using what I hope are quite expressive and representative names, but if you find that some expressions are yielding incorrect and/or invalid variable names, please provide concrete examples so that I can improve them. As noted above, you can also use the IDE's Rename refactoring to rename string template variables and their usages easily. This inspection can be executed en masse to convert all supported string literals and concatenation expressions into the respective multiline strings using the IDE's Run Inspection by Name... action.
  • Added support for the SOQL FORMULA() function. Note that this is not currently enabled in any of my orgs so I haven't been able to confirm successful deployment, but the grammar has been updated to include support, and IC provides code completions, reference resolution, syntax highlighting, etc., for both the SOQL function and the formula expression contents.
  • Fixed an accidental hard runtime dependency on LSP4IJ.
  • Fixed an issue with SLDS Validator due to potential mismatched installed versions of LSP4J.

NOTE: I'm planning to spend the next week or two finally migrating the public issue tracker and user guide / wiki from Bitbucket Cloud into GitHub (including a long overdue refresh of the user guide content). As a result, there will be a slight pause on planned IC2 releases during this migration. Of course, if anything critical needs to be addressed during this time, I'll take care of it, and as soon as the migration is complete, I'll post links for the new resources. I'll then return to the standard (approximately) weekly IC2 release cadence.