Skip to content

rm(list = ls()) on top of files correlates with objects being automatically deleted #1558

Closed

Description

@courtiol

While working with VScode, I noticed that when working with specific files I keep loosing the objects in my global environment.
The patterns seems that those files start with a remove call (rm(list = ls())), that is before I create my objects.
I do not run source() or anything of the kind, so I am wondering what may actually run this line in the background.
I suspect, but have no proof, nor reprex, that languageserver may be the culprit but I failed to find anything on the topic.
Of course, that could also come from various other VScode extensions and I did not experiment to dissect the issue.

Has anyone else ever encountered this issue?

Activity

  1. randy3k commented on Sep 6, 2024

    @randy3k
    Member

    I moved it to VScode-R, languageserver only performs static analysis, and it doesn't alter your R runtime.

  2. ThomasSoeiro commented on Sep 23, 2026

    @ThomasSoeiro
    Collaborator
  3. locked and limited conversation to collaborators on Sep 23, 2026
  4. converted this issue into a discussion #1761 on Sep 23, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions