Open lionel- opened 3 months ago
Yes Positron currently highlights normal identifiers as keywords, which is strange
Adding here for consideration, as mentioned here, since this issue tracks syntax highlighting for Positron.
It would be great if the 'classic' RStudio themes were available in Positron. A good example is RStudio's Tomorrow Night Bright, which is better suited for R code than Microsoft's VS Code extension.
I think some changes should be made to the syntax highlighting in R, to better distinguish tokens/symbols. Take this code for example:
lapply(l, function(component) {
unlist(sapply(
parameters,
function(pattern) {
grep(pattern = pattern, x = component, perl = TRUE, value = TRUE)
},
simplify = FALSE
), use.names = FALSE)
})
At least I use colored brackets, else these would probably also all be in one color:
Here are some suggestions, actually order of importance (for me personally):
FALSE
, function
, if
, ...).+
, -
, =
etc. should get a different color than the default grey that also get variables3rd point is also not found in VSCode, but the first two points can be found in the syntax highlight of VSCode:
Positron Version: 2024.07.0 (system setup) build 2024.07.0-89 Code - OSS Version: 1.91.0 Commit: 08b25a7c9a8ce879674850f76728517302bc91e3 Date: 2024-07-23T03:23:04.686Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631
Version: 1.91.1 (system setup) Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:06:49.809Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631
Tentatively bumping this to the 2024.10 milestone as I think the R experience can be currently quite bad with certain themes.
With a dark theme here is how R code looks like:
Compare this to the same theme with Rust code:
The highlighting in the R file seems excessive because every single token is styled with a colour. I think that suggests something is off with our tm grammar?
Here is the tm info (obtained with
editor.action.inspectTMScopes
) for an R identifier:And for a Rust one:
I don't know much about these grammars but the
keyword.operator
scope stands out to me in the R case.