Skip to content

Workspace symbols should not affect local diagnostics and jump to definition #11112

@lionel-

Description

@lionel-

Diagnostics for defined symbols currently use workspace symbols as a source of definitions. This causes definitions in a file to silence "undefined symbol" diagnostics in another file:

# file1.R
foo <- 1


# file2.R
foo # No diagnostic

RStudio is much less liberal. It requires that you source() a script to populate symbols explictly. For instance:

# file2.R
source("file1.R")
foo # Correctly defined

These features should behave more like "document symbols" than "workspace symbols":

  • Diagnostics for undefined symbols
  • Go to definition

Ideally we'd populate the definitions statically if the sourced file has a static file path. In the meantime we can rely on the dynamic search path, which is what RStudio does as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions