positron icon indicating copy to clipboard operation
positron copied to clipboard

JSON files are opened as renv lockfiles

Open wch opened this issue 7 months ago • 1 comments

System details:

Positron and OS details:

Positron Version: 2025.06.0 (Universal) build 91 Code - OSS Version: 1.99.0 Commit: 472340438bbedac9a406cdb308b56e2e38e57249 Date: 2025-05-16T03:34:36.156Z Electron: 34.3.2 Chromium: 132.0.6834.210 Node.js: 20.18.3 V8: 13.2.152.41-electron.0 OS: Darwin arm64 24.4.0

Describe the issue:

Whenever I open or create a JSON file, Positron thinks it is as a renv lockfile. This happens when I open an existing file, or create a new file with a .json extension.

Image

I also noticed there is no plain JSON file type as there is in VS Code. Or at least, it thinks plain JSON is an renv lock file.

This is a screenshot from Positron:

Image

And from VS Code:

Image

wch avatar May 20 '25 16:05 wch

Hmmmm, I guess this is happening because of how we do this:

https://github.com/posit-dev/positron/blob/b665b028cc5d6535fd6779cafe91a42b44336b48/extensions/positron-r/package.json#L404-L410

This is how we add the syntax highlighting for renv.lock, but we have not ended up in a great place.

Related to https://github.com/posit-dev/positron/pull/1479.

juliasilge avatar May 20 '25 19:05 juliasilge

Verified Fixed

Positron Version(s) : 2025.07.0-22
OS Version          : OSX

Test scenario(s)

No issue opening JSON files; renv.lock files open as JSON.

Link(s) to TestRail test cases run or created:

testlabauto avatar Jun 03 '25 14:06 testlabauto