Initial Workspace Viewer str() functionality#583
Merged
renkun-ken merged 1 commit intoREditorSupport:masterfrom Mar 22, 2021
danielbasso:workspace-str-functionality
Merged
Initial Workspace Viewer str() functionality#583renkun-ken merged 1 commit intoREditorSupport:masterfrom danielbasso:workspace-str-functionality
renkun-ken merged 1 commit intoREditorSupport:masterfrom
danielbasso:workspace-str-functionality
Conversation
renkun-ken
approved these changes
Mar 20, 2021
Member
renkun-ken
left a comment
There was a problem hiding this comment.
LGTM
Tested on macOS and Ubuntu and it works nicely.
Contributor
Author
|
Not related at all with the PR, but i don't know where to ask: could you guys enable the 'Discussion Tab' for this project? I have some questions about the project inner workings that I would like to clarify, but the only way to communicate right now is through issues, which IMO is not ideal since issues should be specific for bugs or feature requests. |
Member
|
I agree that we could enable the discussion. We need @Ikuyadeu to proceed in the project settings. |
Member
|
@danielbasso @renkun-ken OK, now I opened Discussion. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem did you solve?
As stated in #577, the current workspace viewer displays a list of globalEnv objects without further detail. For lists and dataframes, would be nice to see a sub-list of its elements, like the function
str()output. I've implemented this functionality taking advantage of the already implemented.Rprofileoption forsrc()-like output on hover,vsc.str.max.level = 0 | 1 | 2Screenshot
Take for example this code:
vsc.str.max.level = 2vsc.str.max.level = 1vsc.str.max.level = 0(as before)As far as I tested, it is robust to line breaks (

\n); it won't show any tooltip or View/Remove buttons for the subitens (harder to implement that I expected); It will only show expandable icons (>) for objects of list type:Known issue: as it uses the same option for
str()display on object hover, you can't set one option apart from the other. I decided to let it this way mainly because two reasons:The option name
vsc.str.max.levelis generic enough to allow this and;It would have required extra work to implement another option just for this, risking breaking something that is already working. I can't think of any concrete example of someone that would lika an complete
str()on hover and none in the workspace, or vice-versa. Seemed to me an extra work for little return.