Skip to content

Any plans for an edit_positron_settings() function for examining/editing Positron's settings.json? #2111

Open

Description

@davidkane9

Hello! usethis is a great package! Functions like edit_r_profile() are wonderful, both for advanced users and for new students.

Are there any plans to add a function like edit_positron_settings() for examining/editing the settings.json file which controls Positron? I (and my students) would definitely use this, if it were available.

Activity

  1. jennybc commented on Mar 11, 2025

    @jennybc
    Member

    The new use_air() function (#2109) crosses this Rubicon, so yes I can imagine this happening. But that PR also surfaced a pretty big problem which is that jsonlite is currently not set up to help edit JSONC:

    #2109 (comment)

    I don't think we can really dig in to editing this file without such a capability.

    jeroen/jsonlite#394

  2. added
    feature
    on Mar 11, 2025
  3. jennybc commented on Jul 9, 2025

    @jennybc
    Member

    Another feature of real .vscode/settings.json files that is at least tolerated by VS Code and Positron is trailing commas. So that is another thing that would be appealing in a very lenient JSON parser, in addition to comment support.

    I'm talking about the comma after "Posit.air-vscode" here:

    {
        "[r]": {
            "editor.formatOnSave": true,
            "editor.defaultFormatter": "Posit.air-vscode",
        },
        "[quarto]": {
            "editor.formatOnSave": true,
            "editor.defaultFormatter": "quarto.quarto"
        }
    }

    I had the above (by accident, actually) and saw this when playing around with use_air():

    use_air()
    #> Error in parse_con(txt, bigint_as_char): parse error: invalid object key (must be a string)
    #>           er": "Posit.air-vscode",     },     "[quarto]": {         "e
    #>                      (right here) ------^

    It's not a great error.

  4. jennybc commented on Jul 23, 2025

    @jennybc
    Member

    I think I would also want Positron itself to report the location of the targetted settings file versus (trying) to replicate the logic here in usethis, for all OSes, server vs. desktop, etc etc. So that means we'd need to expose something in the Positron API.

  5. added this to the Backlog milestone on Jul 23, 2025
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

    edit 🧞‍♂️feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions