Skip to content
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

Show symbols in file (i.e. Outline) #768

Closed
gandalfsaxe opened this issue Aug 30, 2018 · 15 comments
Closed

Show symbols in file (i.e. Outline) #768

gandalfsaxe opened this issue Aug 30, 2018 · 15 comments

Comments

@gandalfsaxe
Copy link

Description

LaTeX Workshop does not help VSCode recognize symbols, i.e. you can't jump to a section of text with the Go To Symbol in File... command (⌘⇧O). I suggest making this into symbols for easy navigation:

  • chapter
  • section
  • subsection
  • subsubsection

How symbols look in LaTeX currently

image

It also means that the Outline pane is empty, which would otherwise be populated by the the list of symbols (i.e. sections):

image

How symbols look in Markdown

As an example, here is how the symbol list looks for a typical Markdown file:
image

And the Outline contains the same but collapsable:

image

@gandalfsaxe
Copy link
Author

Btw I do see there's a "LaTeX Outline", but it doesn't currently work; if I click to open it, it contains nothing:

image

And also give this error:

image

@jlelong
Copy link
Collaborator

jlelong commented Aug 30, 2018

Can you post a minimal example reproducing the LaTeX Outline problem? I thought it had been fixed.

@gandalfsaxe
Copy link
Author

Huh when I checked again it works now. I'll let you know if it happens again, and if I see a pattern in what could cause it.

Anyway my feature request of using the various section levels + chapters as a symbol list still stands, it'd be really useful 🙂

@werunom
Copy link

werunom commented Sep 3, 2018

+1 vote for this. Similar request has been done here.

@jlelong - the latex-outline problem fix (tracked here) probably has not yet been pushed. In my case, it is still not working.
When the fix might be released?

jlelong added a commit that referenced this issue Sep 3, 2018
A log is printed when outline is unable to resolve a filename.
This is related to #768.
@James-Yu
Copy link
Owner

James-Yu commented Sep 7, 2018

Will be released shortly.

@James-Yu James-Yu closed this as completed Sep 7, 2018
@gandalfsaxe
Copy link
Author

The purpose of this issue was primarily too add chapters, sections, subsections and subsubsections to the symbols list, i.e. command ⇧⌘O on Mac, Ctrl+Shift+O and Windows. Is that what's being released shortly? This wasn't really about populating an outline in the sidebar, but making that same outline available in the symbols list.

The only symbol I've noticed being detected is for figures. Symbols for various levels of sections would be much more useful.

@James-Yu
Copy link
Owner

James-Yu commented Sep 9, 2018

Sections worked originally. The new release is not about providing a new feature but refining it. If there is no outline shown for your project for now, pleae provide your source file since it is currently working for other projects.

@gandalfsaxe
Copy link
Author

@James-Yu I want to distinguish between outline being available in the sidebar, which I suspect you may be talking about vs. outline being available in "Go to symbol in file" command (workbench.action.gotoSymbol), which is really what this issue was about.

@James-Yu
Copy link
Owner

James-Yu commented Sep 9, 2018

Actually in either versions of the extension, the outline view can be populated by the LaTeX content. If it's empty, something wrong happened.

In the current version:

image

image

If the outlines above is not expected behavior, please give a more concrete example.

@gandalfsaxe
Copy link
Author

Ok here are concrete examples 🙂

This is the outline you're talking about

screenshot 2018-09-09 at 17 02 20

This is the "current file symbol list" I'm talking about

screenshot 2018-09-09 at 17 03 22

It's populated by equations and figures right now. What I would like to see is the same content of "Outline / LaTeX Outline" in this symbol list.

What the symbol list looks like with markdown

screenshot 2018-09-09 at 17 04 34

Basically I want the same of LaTeX

The purpose of having sections in symbol list

..is to be able to quickly jump to a section using fuzzy search. Such is possible with Markdown in VSCode (using the "Markdown All in One" extension, or as demonstrated here for the markdown editor Caret:

I think it'd be fine to have both figures, equations and outline in the symbols list, i.e. not have the outline replace, but added to the current list of symbols.

@James-Yu
Copy link
Owner

James-Yu commented Sep 10, 2018

It is implemented in the current new version. An example:
wechat photo editor_20180910103257
It is unlikely that figures and tables will be included due to the complex syntax structures these two floats have.

@gandalfsaxe
Copy link
Author

Ah, excellent! Very nice.

As for figures and tables, why not just include the figure/table label if it exists, otherwise the caption if it exist, otherwise just list a generic figure? That's what happens if you "Go to Symbol in Workspace..." (⌘T) anyway:

image

@James-Yu
Copy link
Owner

Because regex seems not powerful enough to identify which environment the current \caption is in. I'll look into it, but it seems not quite likely.

@James-Yu
Copy link
Owner

This one should serve the purpose.

image

@gandalfsaxe
Copy link
Author

Yes I think that’s good actually.

It’s strange the commands are called the same, with the distinction of being symbols in file and symbols in workspace. Obviously it’s also a different set of symbols l, not just a question of scope.

Anyway this issue is surely concluded now with a satisfying conclusion. Thanks for your work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants