Nova

Extensions


Readme

R-Nova

R-Nova provides R support for Nova. The following features are currently included.

  • Syntax definitions for R and R Markdown, to allow highlighting of these files in Nova. Functions and variables in user code are also symbolicated for ease of navigation.
  • Code completion for R, including both standard symbols (from the base package) and dynamically parsed function, argument and variable names from the current project.
  • A prebuilt task for running tests against R packages, compatible with testthat and tinytest.
  • An interface to the languageserver R package to provide linting and other language server features for R code.

Further functionality is being added gradually for deeper integration. If you would like to support development of the extension, code contributions (via GitHub) and tips (via PayPal) are both welcome.

The R logo, used as the extension icon, is © 2016 The R Foundation. It is redistributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International license (CC-BY-SA 4.0). The Tree-sitter grammar used internally is © 2024 the tree-sitter-r authors, released under an MIT licence.


Changelog

Version 0.5

  • A Tree-sitter parser, based on the grammar from the tree-sitter-r project, is now included with the extension for faster and more versatile syntax handling.
  • The Tree-sitter parser additionally symbolicates classes defined with setClass() and setRefClass, from the methods package, and handles right-assignment (->) to variables.
  • if, while, for and return statements are now clips rather than simple completions. The function declaration clip no longer assumed the function will be assigned to a name, as it may be anonymous.
  • Symbolicated function arguments should now be shown within rather than after the parentheses, comma separated as expected.

Version 0.4

  • The extension now includes clips for some common code patterns, such as loading packages and defining functions.

Version 0.3.2

  • Highlighting has been improved for string escapes and constants.

Version 0.3.1

  • The "Test Package" task could fail with an error about a missing script, due to a file permissions issue. A workaround has been added to resolve this.

Version 0.3

  • If the workspace looks like an R package with tests (having a DESCRIPTION file and tests subdirectory), the extension now provides a prebuilt task for running the tests against the package. This is compatible with the testthat and tinytest unit testing frameworks.
  • Function arguments are now also available as completions.
  • Various syntax improvements have been made, for example to properly capture comments within function arguments and multiline string literals. The new pipe operator in R 4.1.0 is also now included.

Version 0.2

  • Code completion is now supported for R code. The extension provides static completions for base package functions and constants, and dynamic completion of parsed function and variable symbols.
  • Functions and variables in user code are now symbolicated, for ease of navigation and for code completion.
  • Code folding is now supported for braced code blocks.
  • Several other improvements have been made to the syntax definition for better code highlighting.

Version 0.1

  • Initial release.

License

Copyright 2024 Jon Clayden.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.