This extension brings flowR to Visual Studio Code and Positron. See the installation instructions to get started! With this extension, you gain access to the following features (as the extension is under active development, many more features are planned):
If you notice anything that could be improved, have a feature request, or notice a bug, please open an issue! Reporting an IssueUsing the bug icon opens the issue form in your default browser:
So far, the extension appeared in the following publications:
For general publications on flowR, please check the main flowR Repository. UseThis section provides a brief overview of the features provided by this extension and how to use them. See below for instructions on how to install the extension. PrerequisitesInstalling the extension is sufficient for all features!
Yet, flowR may benefit from a local R installation (which has to be available on your Additionally, we recommend using the R extension for Visual Studio Code or the R extension for Positron along with this extension. For more information on R development in Visual Studio Code, you can also check out this helpful article. In case of migration from RStudio to Positron you can also check out this article. LintingBy default, the extension enables all linting rules available in flowR except To manually invoke the linter, you can use the "Code Quality Analysis (Linter)" command. Additionally, you can modify under what conditions the linter automatically refreshes its results in the extension's settings.
Linting results found in the code will be highlighted with a squiggly line underneath them, and will additionally appear in VS Code's Problems view. Hovering over a linting results also provides a link to the relevant wiki page, where you can find more information about the rule and potential fixes.
For issues that have quick fixes available, you can use the lightbulb icon in your code window, hover over the ⚠️ icon in VS Code's Problems view, or use the builtin Quick Fix command.
SlicingSlicing describes the process of reducing a program to just the parts relevant to a specific variable or figure. A backward slice includes all parts of the program that a variable or figure depends on (the relevant code), while a forward slice includes all parts of the program that a variable has an influence on. With the extension loaded, select a variable you are interested in and either press Alt+S to highlight a backward slice for it once or Alt+P to mark the position and continuously update the backward slice as you edit the file. With the command palette (Ctrl+Shift+P), you can additionally highlight forward slices. The editor will gray out all code that is not part of the generated slice. By default, the editor will also show you a reconstruction of any backward slices in a separate view (this can be changed in the settings). If you want to clear the slice highlight, press Alt+C or use the icon in the upper right of your editor:
Note, that there are other ways to slice, for example with the Dependency View. Detailed ExplanationYou can generate a backward slice of the currently highlighted variable in any R code by using the "Show Relevant Code for Cursor Position Once (Backward Slice)" command. All code that is not part of the generated slice will then be grayed out. To generate a forward slice, use the "Show Influence for Cursor Position Once (Forward Slice)" command. Optionally, you can also use one of the two "Toggle Slice" options, which will automatically cause the slice to be updated when code changes occur or when the cursor is moved. You can also view the reconstruction of a piece of code based on the current backward slice. The "Show Current Backward Slice in Editor (Reconstruct)" command opens a view next to the current editor that will automatically update the reconstruction as you slice. By default, this should be shown to you automatically whenever you create a backward slice (but this can be changed in the settings). To clear the slice highlighting, use the "Clear Current Slice Presentation" command or the crossed out eye icon in the upper right of the editor. If a slice comes out empty, flowR tells you why (for example, the cursor is not on an R expression, the file has syntax errors flowR could only partially recover from, the slices of the marked positions have nothing in common, or flowR itself failed): as a warning when you sliced explicitly, in the status bar while the slice updates continuously, and in the reconstruction. If you close the reconstruction (or the diff view, see the When you mark multiple positions (Alt+P), the editor shows the union of their slices by default. Use "Toggle Union/Intersection of Position Slices" (setting "Removal Slice" (editor context menu, or the trash button next to a dependency) marks the statements only the expression under the cursor (or the dependency) needs, and shows the script without them in a diff view. Example: removing "Toggle Negative Slice" (setting
Dependency View
Using the extension, the sidebar should contain a flowR icon whose Overview view holds more information on the current file, listing the libraries loaded, the files read and written, and the sourced scripts. If you expand the respective sections, clicking on the found entries should open them in the editor. The arrow buttons next to an entry (also in its context menu) slice for it: backward for the code it depends on, forward for the code it influences. Entries are grouped by dataset, file or package. Paths show the file name (shortened in the middle if long) with the folder aside; calls show the function with its package aside ( Line Category IndicatorsA slim colored bar next to the line numbers (and a mark in the overview ruler) shows what a line does. It appears when you open an R file. A line with several categories shows the one furthest along the analysis (library and plot: plot). Hover the line's code for the categories and the reason, e.g.
Only categories enabled in the dependency view are marked. Toggle the bars with the color button in the dependency view's title bar or Search"Search Variables, Functions and Strings" (search button in the dependency view, or the command palette) searches the current file using flowR's dataflow graph.
Document SymbolsflowR provides symbols for the outline, breadcrumbs and Go to Symbol in Editor (Ctrl/Cmd+Shift+O) in R and R Markdown: assigned variables and functions (nested by function), and dependencies such as libraries, imported data, plots and outputs. If the R extension's language server runs, it already lists assignments, so flowR only adds the dependencies. Change this with Package InformationHovering over a call in an R file tells you which package it stems from — for example, hovering over Ctrl/Cmd+click (Go to Definition) resolves to: a locally defined function or variable's own definition; a package function's exact source line on GitHub (e.g. Set AutocompletionOnce a script If the R extension's language server is available (it is installed, MCP ServerOn desktop, flowR registers its MCP server ( Project ViewWhen the open workspace contains an R project manifest — a Signature DatabaseflowR resolves the exports, definitions, versions and dependencies of R packages from a precomputed signature database, so hovers, go-to-definition and autocompletion work out of the box without a local R installation. It also backs the project view's manifest matching and dependency resolution during slicing. The Signature DB tab in the flowR sidebar shows what is actually downloaded, browsable down to individual packages, versions and functions:
Use the download icon on the view's title bar to sync everything that is missing, or the download/remove icons on an individual scope's row to fetch or delete just that one — for Current CRAN you are asked which shard(s) you want. Nothing is downloaded automatically unless The active database (which scopes are downloaded) is shown when hovering the flowR status-bar item and in the REPL banner. In the browser (e.g. on vscode.dev), the extension ships with the Base R scope bundled, since the other scopes cannot be downloaded there. Package information and suggestions for CRAN packages such as Value ResolutionYou can get information on the values inferred by flowR by hovering over variables in R source files. This will show you a summary of the inferred values, including types and possible values. DataflowYou can generate and view the dataflow graph for any R source file by using the "Show Dataflow Graph" command while the file is open in the active editor (open the command palette with Ctrl+Shift+P and search for the command). The dataflow graph will then be displayed in an interactive tab on the side, where you can pan and zoom to inspect it. There is also a simplified version that contains less details! In the future, we plan on including the ability to select nodes in the dataflow graph and have relevant code sections highlighted, and vice versa.
REPLflowR offers a REPL, a "read-eval-print loop", which allows you to interactively explore the features of flowR. You can open a new REPL either with the "Launch a new flowR REPL" command (in the command palette which you can open with Ctrl+Shift+P) or by clicking on the shell icon of the flowR sidebar:
This opens a new terminal in which you can interact with the (local) flowR installation:
InstallingFrom Visual Studio MarketplaceYou can get the extension here: https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr. Example Installation
From Open VSXYou can get the extension here: https://open-vsx.org/extension/code-inspect/vscode-flowr. From GitHub ReleaseYou can find official releases of the extension in the Releases section of the repository. Simply select the version you would like to download, open up the asset's section at the bottom, and download the From Visual Studio Code, open the Extensions tab and click on the three dots in the top right to select "Install from VSIX..." Alternatively, you can use the Command Palette to select the option directly. Then, you can select the This works the same way in Positron. The repository for Visual Studio Code is the same as the one for Positron, so you can use the same From Build ArtifactYou can easily download the most recent build of the extension by heading to the Actions tab, where you will find a list of runs. Selecting the most recent run will display a summary of it, at the bottom of which you can find the Artifacts section and the Then, you can install it the same way as you would the Issues and Feature RequestsIf you have an issue with the extension, or you have a good idea for a new feature, you can open an issue from within the extension, prefilled with information about your setup. To do so, press the feedback button in the dependency view or run "flowR: Give Feedback (Opens Browser)". DevelopmentBuilding and Running from SourceAfter cloning the repository, required dependencies can be installed using npm:
Note that this does not install R, which is also not strictly required for development, but (obviously) highly encouraged. Opening the cloned repository in Visual Studio Code allows using the existing launch configurations which can launch Visual Studio Code with the extension enabled. To use them, open the Run and Debug view and press the Run button at the top, or use the F5 shortcut to start debugging. You can then open the example folder contained in this repository to try out the extension for yourself. To build the extension into a This will also work for Positron, as the extension is the same for both Visual Studio Code and Positron. Testing
Releasing and flowR UpdatesA commit on The Git HooksThis repository contains some git hooks to ensure that linting and other actions happen. Register these hooks by running:
Contributorsvscode-flowr is part of flowr, which is actively developed by Florian Sihler under the
GPLv3 License. |
















