Skip to content

Anonymous Functions Appear in Outline #15368

Open

Description

@emstruong

System details

RStudio 2024.09.0+375 "Cranberry Hibiscus" Release (c8fc7ae, 2024-09-16) for Ubuntu Jammy
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2024.09.0+375 Chrome/124.0.6367.243 Electron/30.4.0 Safari/537.36, Quarto 1.5.57

RStudio Edition : Desktop
RStudio Version :  2024.09.0+375 "Cranberry Hibiscus" Release (c8fc7aee6dc218d5687553f9041c6b1e5ea268ff, 2024-09-16) for Ubuntu Jammy
OS Version      :  Ubuntu Jammy 22.04
R Version       :  4.4.1

Steps to reproduce the problem

  1. Use a function that uses anonymous functions in .R script file
tryCatch(
    {...},
    error = function(x) {
      return(NA)
    }
  )
  1. Open outline using Ctrl + Shift + O.
  2. See the anonymous function in outline

Describe the problem in detail

The anonymous 'error' function probably shouldn't be showing up in the outline. Anonymous functions are not meant to be re-used across the code base and it's cluttering the outline to have a non-descriptive function name appear. This also happens with lapply().

Describe the behavior you expected

For it to not appear in the outline.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Oct 26, 2024
  2. removed
    new
    on Oct 28, 2024
  3. added this to the Mariposa Orchid milestone on Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions