-
Notifications
You must be signed in to change notification settings - Fork 29
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
Cell names do not show in document outline (VSCode) #167
Comments
Thanks for this, we are hoping to make some big improvements in outlining/indexing over the next few months and will make code blocks part of this. |
Excellent - thanks! 😊 |
This would be a super nice feature to have! I've been making do with creating subheadings for different code chunks. |
Thank you for this. I'm coming from posit-dev/positron#3822 and was instructed to bring it up here instead. Not an issue, but a shameless request related to this. Great work btw. For Quarto documents (.qmd), RStudio shows only headings and subheadings in the outline, like you can see below on the left. Positron (and now I know VSCode), on the other hand, shows headings, subheadings and (code cell) like you can see on the right. Now this looks great for defined code chunk listings that are named for cross refs, but very crowded for the rest of unnamed code chunks. I am aware that you can click on "collapse all" like below, but that will collapse to first level headings only and you lose some ability to quickly navigate the document, especially in this case, where you go back and forth, perhaps trying out different elasticities in a very specific subsection to see poverty results at the end or going back to see how you set something up. I am aware also that you can individually open up each heading. Now, I'm not saying to get rid of "(code cell)", because it encourages you to name your chunks and it's a superb feature, but I would appreciate it if there was perhaps a "toggle code cells" option, independent from collapse/expand for the Outline panel, so that you could limit it to headings and subheadings in Rmd, qmd's and other document type files. Thank you. |
Returning to the main issue of code cells appearing in the Outline and breadcrumbs as I do not know if that bears any relation to the Outline symbol gathering mechanism, but it does at least give a useful addition to the breadcrumb if you want to know what is the name of the code cell you are currently editing in. As another diagnostic input to this issue, @renatovargas I know that you'd rather not see them at all, because you prefer the RStudio Outline-style navigation on the right to the statusbar navigation at the bottom... ...however I notice in your issue screenshot you had some code cells which were named and some that weren't Oh, and if you DO want people to seriously consider adding the feature you mention in your comment above, it might be best if you raise it as a separate issue thread, so that it does not get lost in this conversation. |
Thank you for raising these questions @artmg.
Oh, I do like those references to code chunks (and Positron's position of the outline too), but I would want to have the option to toggle them on and off (with a tick box) independently of hierarchy expand/collapse level because the unnamed ones make it too crowded when expanded, and I like to navigate to subheadings easily without that clutter if I so choose. However, if all of a sudden I want to go to a specific code chunk, I would just toggle them on, and boom, I'm there.
Sure, that is not arbitrary. The ones that are named were specifically labeled using hash-pipe YAML comments to be able to cross reference to them from the narrative. I did not name the ones I didn't need to cross-reference. Just make sure you don't mix hash-pipe comments with inline ones like For example, for the first named item in the screenshot you are quoting, the code looks like the code below (disregard the
The first chunk in the image that has no name afterwards
Well, I think that beggars can't be choosers. We already get so much for free that I would feel bad being pushy. I brought it up somewhere else and was instructed to add it here instead by Julia because this thread consolidates several related functionalities and this issue is still open, so let's be patient with the team. |
ahhh, so the neater alternative to @promicrobial 's workaround of adding additional subheading above the code blocks would be to insert a 'hash pipe label' just inside the code block, such as #| label: cars to correctly label the code cell 'cars', thus, in both the outline and the breadcrumbs or if one felt compelled to abide by quarto list cross-referencing standards for code blocks then This hash pipe label workaround appears to give the closest approximation to the outline authors might hope for, and as R and other execution environments will treat the hash pipe as a label, it is otherwise transparent Thanks for this great tip @renatovargas As to your 'getting things for free' comment, please bear in mind that the gratis nature of libre open-source is strongly supported by voluntary community effort. Your personal time commitment to reporting and updating guides both users and developers. Participating positively on issues like this is making more of a difference than you might realise in driving projects like this forward. You are paying with your time, which some people see as more precious than currency, so it's worth remembering that morally you one of the net positive contributors here 😃 |
Cell names are really useful for navigating. By this I mean
This works well in RStudio to help navigate to relevant code cells/chunks. However, I have not found a way to do this in Quarto when using VSCode. When I view the outline the names of code cells do not appear.
The text was updated successfully, but these errors were encountered: