Skip to content

Release 3.2.0

Compare
Choose a tag to compare
@FIameCaster FIameCaster released this 26 Mar 17:16
· 52 commits to main since this release

New features

Added comment toggling, automatic indentation, and tag-closing to nearly all languages. Previously this was only present in markup, markdown, xml, css, jsx, tsx, python and some c-like languages (18e814c)

Added two parameters to the matchBrackets() extension used to customize which punctuation tokens can be matched together. The extension now searches both the first and last characters in punctuation tokens instead of just the last character. This comes at a slight performance cost, but only testing the last character didn't work for a few languages (64c6041)

Added the ending position of the bracket to the Bracket type (64c6041)

Changes

The fullEditor() setup along with its web component have been marked as deprecated. This is because they'll get merged together with the basicEditor() setup in the next major release (2897736)

The NPM package no longer contains minified JavaScript code (#7) (56907f1)

Improvements

  • Improved patterns of multiline tokens in Haml, Pug and Sass grammars (fb025d9, 9e7f0f2)
  • Added bracket comments to CMake (c3c7614)
  • Small refactors to many Prism grammars (0cebe12)
  • Whitespace is no longer required between attributes in JSX tags (0a1d28a)
  • Improved escaping of braces in XQuery using {{ (4672340)

Better templating (7943a7c)

The placeholders for the templating are now simply whitespace instead of looking like ___PH0___. This has multiple advantages:

  1. It works with all grammars. Previously, grammars that could split the placeholders into multiple tokens couldn't be used as host grammars.
  2. It's less complex, requiring significantly less code.
  3. It sometimes leads to better highlighting.

Additionally, recursion was used to insert multiple placeholders into the same string. Highlighting '<??>'.repeat(5000) with PHP would therefore lead to a stack overflow. Rewriting this to a loop fixes the potential stack overflows and improves performance. In most cases the performance increase is in the ballpark of 10-20%, but in best-case scenarios it can be multiple times faster.

Bug fixes

  • Fixed selection often being incorrect after an undo (fc3c678, e4382f5)
  • JSX tags with a block comment at the end like <div /* */> no longer behave like self-closing tags (0a1d28a)
  • JSX fragments now automatically close when typing
  • HTML tags such as <a href=foo/> no longer behave like self-closing tags (0a1d28a)
  • Self closing tags are no longer case sensitive, so for example <INPUT> would be self-closing in HTML (0a1d28a)