-
Notifications
You must be signed in to change notification settings - Fork 108
Add positron.r.symbols.includeAssignmentsInBlocks
setting
#8412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
E2E Tests 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much! 🙌
}, | ||
"positron.r.symbols.includeAssignmentsInBlocks": { | ||
"type": "boolean", | ||
"default": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"default": false, | |
"default": true, |
I am not a fan of this change, I'm afraid. 😬
I did some experimentation with realistic projects and the old treatment is preferable for everything I tried.
BEFORE:

AFTER:

Situations where one would not want to include assignments within blocks in the symbols have got to be pretty rare, so let's make this new behavior opt in instead of opt out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to discuss this further because I think the point at which the outline becomes too noisy is likely very common.
In packages with a few short functions, as in the screenshots above, I agree it's not that bad. But
even in this best case scenario, is it really helpful to see local variables in the outline? Local variables are more likely to have vague and similar names, and thus more likely to distract rather than inform.
More importantly the main purpose of the outline is to show the structure of the document. The outline is especially important to get oriented in large files with many functions and methods. In these large files, I think local variables clearly distract from the general outline as you can see in the testthat examples brought up by Jenny and Davis who also feel that the current behaviour yields a noisy outline: posit-dev/ark#856 (comment). This will also be the case with e.g. large R6 classes with many methods, and other similar long file / many functions scenarios. Even in your example, I find it much easier to get the general picture of the document in the After screenshot.
It's also worth noting that Python does not show local variables either. Having a consistent experience across languages seems like a plus in a multilingual IDE.
@@ -189,6 +189,11 @@ | |||
"type": "boolean", | |||
"default": true, | |||
"description": "%r.configuration.diagnostics.enable.description%" | |||
}, | |||
"positron.r.symbols.includeAssignmentsInBlocks": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"positron.r.symbols.includeAssignmentsInBlocks": { | |
"ark.symbols.includeAssignmentsInBlocks": { |
Similar to what I outlined in #8419 (comment), let's not use "Positron" in setting display names moving forward. We could do ark.symbols.includeAssignmentsInBlocks
to emphasize to folks where this functionality is coming from? Or something like r.symbols.includeAssignmentsInBlocks
to just knock of the "Positron" from the front of the display name?
For #8330
Extension side of posit-dev/ark#859
Can be merged separately.