-
Autobracing is a new feature applied to if statements, for loops, while loops, repeat loops, and function definitions. This feature will automatically add
{}around the body of these code elements in certain cases to maximize readability, consistency, and portability (#225, #334).For example:
if (condition) a # Becomes: if (condition) { a }
fn <- function( a, b ) a + b # Becomes: fn <- function( a, b ) { a + b }
Single line if statements and function definitions are still allowed in certain contexts:
list(a = if (is.null(x)) NA else x) map(xs, function(x) x + 1)
-
Added support for a
skipfield inair.toml(#273).This is an extension of the
# fmt: skipcomment feature that provides a single place for you to list functions you never want formatting for. For example:skip = ["tribble", "graph_from_literal"]
This
skipconfiguration would skip formatting for these function calls, even without a# fmt: skipcomment:tribble( ~x, ~y, 1, 2, 3, 4 ) igraph::graph_from_literal(A +-+ B +---+ C ++ D + E)
We expect this to be useful when working with packages that provide domain specific languages that come with their own unique formatting conventions.
-
Fixed an issue where
air.tomlsettings were not being applied to the correct R files (#294).
- Language server configuration variables are now fully optional, avoiding issues in editors like Zed or Helix (#246).
-
Parenthesized expressions now tightly hug (#248).
-
We now allow up to 2 lines between top-level elements of a file. This makes it possible to separate long scripts into visually distinct sections (#40).
-
Unary formulas (i.e. anonymous functions) like
~ .x + 1now add a space between the~and the right-hand side, unless the right-hand side is very simple, like~fooor~1(#235). -
Semicolons at the very start or very end of a file no longer cause the parser to panic (#238).
-
Assigned pipelines no longer double-indent when a persistent line break is used (#220).
-
Hugging calls like:
list(c( 1, 2 ))
are no longer fully expanded (#21).
-
Assigned pipelines no longer double-indent (#220).
-
Added support for special "skip" comments.
Use
# fmt: skipto avoid formatting the following node and all of its children. In this case, thetribble()call and all of its arguments (#52).# fmt: skip tribble( ~a, ~b, 1, 2 )
Use
# fmt: skip fileto avoid formatting an entire file. This comment must appear at the top of the file before any non-comment R code (#219).
-
Air has gained support for excluding files and folders (#128).
-
Air now excludes a set of default R files and folders by default. These include generated files such as
cpp11.RandRcppExports.R, as well as folders that may contain such files, likerenv/andrevdep/. If you'd prefer to have Air format these files as well, set the newdefault-excludeoption tofalse. -
To add additional files or folders to exclude, use the new
excludeoption. This accepts a list of.gitignorestyle patterns, such asexclude = ["file.R", "folder/", "files-like-*-this.R"].
-
-
Linux binaries are now available. Note that your Linux distribution must support glibc 2.31+ for the binary to work (#71).
-
ARM Windows binaries are now available (#170).
-
Initial public release, yay!
Note that we first released 0.2.0 as 1.0.0. If you have installed the VS Code extension or the CLI program as 1.0.0, please uninstall it.
-
Fixed an issue where the language server failed to start due to logging being initialized twice.
-
Added a synchronization mechanism between IDE and Air settings. See documentation for more information https://posit-dev.github.io/air/configuration.html#settings-synchronization.
-
Renamed
ignore-magic-line-breaktopersistent-line-breaks(#177). -
In the CLI, errors and warnings are now written to stderr. This allows you to see issues that occur during
air format, such as parse errors or file not found errors (#155). -
New global CLI option
--log-levelto control the log level. The default iswarn(#155). -
New global CLI option
--no-colorto disable colored output (#155). -
Air now supports
.air.tomlfiles in addition toair.tomlfiles. If both are in the same directory,air.tomlis preferred, but we don't recommend doing that (#152).
-
The default indent style has been changed to spaces. The default indent width has been changed to two. This more closely matches the overwhelming majority of existing R code.
-
Parse errors in your document no longer trigger an LSP error when you request document or range formatting (which typically would show up as an annoying toast notification in your code editor) (#120).
-
air formatis now faster on Windows when nothing changes (#90). -
air format --checknow works correctly with Windows line endings (#123). -
Magic line breaks are now supported in left assignment (#118).
-
The LSP gains range formatting support (#63).
-
The
air formatcommand has been improved and is now able to take multiple files and directories.
- Initial release.