Skip to content

Ark: Diagnostics: Populate library() symbols statically #2649

@lionel-

Description

@lionel-

Currently we inspect the runtime state of the search path to determine if a symbol is in scope. This has all sorts of downsides, the biggest one being that scripts get decorated with distracting diagnostics until the user has evaluated all library calls:

Screenshot 2024-04-04 at 15 31 50

Instead of inspecting the current state of R, we should determine symbols in scope from lexical analysis. This way each line of code will get correct diagnostics independently from the state of the runtime. This will also allow to flag this as problematic even when the user has attached ggplot2:

ggplot(data) # <-- not in scope

library(ggplot2)

Part of #2321

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: diagnosticsIssues related to Diagnosticsarea: kernelsIssues related to Jupyter kernels and LSP serversbugSomething isn't workinglang: r

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions