You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, breadcrumbs and outline don't show anything when having a notebook open. We should come up with a way how this should work and then implement this.
Agreed. While implementing Folding for cells, I actually reinvented the algorithm for markdown outlines again: finding # headers and use them as folding ranges. I'm wondering the outline for a notebook document is a mix of
Markdown headers
Outline for the active cell, which is provided the language
Showing outlines for every cell is a no-op IMHO as it requires creating text models for each cell.
Yeah, that's the challenge here. We can have markdown define the "root structure" of outline but should happen with code cells? Showing outline for them will be expensive because models need to be created - which might already happen anyways when a smart language service is at work... We could differentiate between static outline and dynamic outline
static outline (in the panel and breadcrumbs): Show the structure as defined by markdown headings
dynamic outline (quick outline, breadcrumbs picker): Show the outline of the current cell - be it markdown or code
Not sure if this is useful information or not but for R Markdown notebooks the R language server provides the outline for the whole document, markdown and code chunks included.
Johannes Rieken (@jrieken) Here's a screenshot of an R Markdown (.Rmd) file. Note that the markdown headings and the function definitions in the code chunks are shown in the outline. The R language server is providing the symbols for both.
The editor panel shows how R Markdown files are currently displayed in VS Code. The new VS Code Notebook seems like it will probably be a good fit for them. The point I wanted to highlight is that depending on the language server, it may already be providing symbols for the markdown as well as the code.
CC Kun Ren (@renkun-ken), who implemented the handling of markdown in the R language server (as well as a lot of other features).
One thing to notice is that R language server is implemented in R and works for other editors that support LSP and thus is not designed specifically for VSCode.
Generally, I think mixing markdown outline and document symbols look natural and is easy for users to adopt and work with.
We have now table of contents that always for a notebook, using markdown headings and the first non-empty line of code cells. Calling is done for now and waiting for user feedback before moving on.
Benjamin Pasero (@bpasero) wrt the table of contents provider that I have added, we have #97095 which I am going to use to further purse this
Activity
rebornix commentedon Apr 17, 2020
Agreed. While implementing Folding for cells, I actually reinvented the algorithm for markdown outlines again: finding
#headers and use them as folding ranges. I'm wondering the outline for a notebook document is a mix ofShowing outlines for every cell is a no-op IMHO as it requires creating text models for each cell.
jrieken commentedon Apr 17, 2020
Yeah, that's the challenge here. We can have markdown define the "root structure" of outline but should happen with code cells? Showing outline for them will be expensive because models need to be created - which might already happen anyways when a smart language service is at work... We could differentiate between static outline and dynamic outline
make OutlineGroup fit for being used with other things than providers, …
No more textModel-reference in OutlineModel, #95234
andycraig commentedon Apr 17, 2020
Not sure if this is useful information or not but for R Markdown notebooks the R language server provides the outline for the whole document, markdown and code chunks included.
jrieken commentedon Apr 20, 2020
Andrew Craig (@andycraig) useful! can you point me to more information about this?
andycraig commentedon Apr 20, 2020
Johannes Rieken (@jrieken) Here's a screenshot of an R Markdown (.Rmd) file. Note that the markdown headings and the function definitions in the code chunks are shown in the outline. The R language server is providing the symbols for both.
The editor panel shows how R Markdown files are currently displayed in VS Code. The new VS Code Notebook seems like it will probably be a good fit for them. The point I wanted to highlight is that depending on the language server, it may already be providing symbols for the markdown as well as the code.
CC Kun Ren (@renkun-ken), who implemented the handling of markdown in the R language server (as well as a lot of other features).
renkun-ken commentedon Apr 20, 2020
Thanks Andrew Craig (@andycraig) for introducing me to this discussion.
One thing to notice is that R language server is implemented in R and works for other editors that support LSP and thus is not designed specifically for VSCode.
Generally, I think mixing markdown outline and document symbols look natural and is easy for users to adopt and work with.
11 remaining items
Notebook outline shows icons for markdown and code entries, #95234
only show toc outline for notebooks, focus editor for code cells, #95234
jrieken commentedon May 14, 2020
We have now table of contents that always for a notebook, using markdown headings and the first non-empty line of code cells. Calling is done for now and waiting for user feedback before moving on.
Benjamin Pasero (@bpasero) wrt the table of contents provider that I have added, we have #97095 which I am going to use to further purse this
jrieken commentedon May 29, 2020
to verify:
JacksonKearl commentedon Jun 4, 2020
Finding that
Go to Symbol in Editorshows the correct outline information, but the outline pane is empty?jrieken commentedon Jun 4, 2020
Yeah, we don't yet want to rewrite the whole outline that's why for now it is just quick outline.