Closed mhmdmodan closed 6 years ago
VS has operator colors :-) It is just default is black.
Function colors somewhat more difficult since it technically requires semantic analysis. However, simple approach would be to color anything that has following (
(except keywords) as functions.
Ah! Thank you, didn't see that in the settings. I'm new to VS :)
As for the function call highlighting, looks like that's what RStudio does too.
Not too complicated, but fairly extensive change. Classifier currently gets a single token while it needs to get token collection and the current token index so it can determine if this is a function. Unfortunately, connection operations currently return elements and not indices. Also, tokenizer needs to run past the changed range since it needs to pick up the brace while it might be off-screen. Example
func|(
<<- edge of the screen
VS request for colors in the range would not include '(` since it is off screen. Tokenizer needs to picks few items beyond .the visual range then
@mhmdmodan - which RStudio scheme it is? In the schemes I have I don't see option for function colors.
@MikhailArkhipov - Hi, it must be enabled in the Code menu under the Display tab first.
https://github.com/Microsoft/RTVS/commit/e83ab28203c1380dae8dbb739174cbc7efa70882
The color name is R Function. Default is black.
RStudio has an optional feature to enable highlighting for functons, which offers a great increase in readability. Additionally, separate highlighting for operators, including custom binary operators (like the pipe %>%) would be quite helpful as well!
Here's a bit of code in RStudio:
And the same with RTVS:
Hopefully this can be implemented in future updates. Thank you!