Latex-workshop: [Feature Request] Adopt New Vscode Outline

Created on 28 Jun 2018  Â·  18Comments  Â·  Source: James-Yu/LaTeX-Workshop

Description

I think VScode's native Outline view is quite extensible now, so instead of cluttering the sidebar with both vscode's Outline and Latex Workshop's Latex Outline, I believe it would be better do discard Latex Outline and mimic its behavior in Outline. Other extension developers (Markdown, etc...) have already started doing this.
Attached is a picture for reference: image

enhancement

Most helpful comment

A good alternative would be to add a new badge (look into GitLens extensions).

screenshot from 2018-07-17 12-20-55

All 18 comments

It's a good enhancement of vscode and the extension. However, the API is still subject to changes according to https://github.com/Microsoft/vscode/issues/34968, and I need to evaluate it when ready.

It would be great if you could include \label{}, sections, subsections, etc. together in the same outline view.

A good alternative would be to add a new badge (look into GitLens extensions).

screenshot from 2018-07-17 12-20-55

+1 for the badge, the explorer is already full as it is for large projects.

I would also vote for using the new outline. Because, when I have opened markdown file and a tex file simultaneously, there are two outlines in the explorer sidebar - one is the default new outline and the other is the latex outline. With this, when I swap between a markdown file and a tex file, I have to keep shuffling between two outlines. And in the case of markdown files, there is a redundancy. Attaching a gif for reference...

@James-Yu tried the new commit and it's quite broken. With the following document hierarchy :
ROOT TEX (parent)

\input{FirstDOC.tex}
\input{SecondDOC.tex}
\input{ThirdDOC.tex}
\input{FourthDOC.tex}
\input{FifthDOC.tex}
\input{SixthDOC.tex}

Write 1 section in all of the inputs, then
Write 2-3 subsections in FifthDOC.tex and SixthDOC.tex. Notice the incorrect Outline view.

Will check now.

To be honest, this is an upstream problem with vscode. Currently the outline view does not respect multi-file outline symbols. Seems no workaround is available now.

You may notice that by default, the outline is sorted by position, which simply breaks on multi-file projects. This is also the reason why the structure is incorrect.

@James-Yu Thanks for looking into this. Maybe instead of the outline view, we can use a Badge webview as suggested by other users?
image

GitLens manages to do a lot of things so I think there's more support

That might be the only solution currently. However this involves some refactoring. I'll try finish it in the next few days.

@James-Yu Great work on the badge in the new release! So far it's been fine, but I have one small feature request if it's possible. Can we add the output pdf in the view of that badge below the structure? Clicking it should open it in pdf viewer or in chrome as set in user preferences.

Also another suggestion. Currently, when you open vscode in a directory like this:

- LatexProject1
–– TexFile1
–– ...
- LatexProject2
–– TexFile2
–– ...

There is nothing shown in the view. It would be nice to see the structure of projects under

.
..
...
LatexProject2
.
..
...

It is not possible to add a custom HTML view to the sidebar as far as I'm concerned. Though a list of commands is possible.

As to the second one, there is no plan to support multiple projects in sub-folders. This is related to the workflow of vscode/the extension. Typically one opens each project in an individual workspace. Suppose there is a LaTeX project in a folder which is in the root of another javascript project, which has its node_modules. The extension will be struggling to identify the 1000 modules inside.

Closing this issue for now. Comments and suggestions are welcomed.

@James-Yu Maybe we could add something like Utils tab in the badge view that will list some common commands:

Format Document
Forward Synctex
Open PDF in Vscode
Open PDF in Chrome
...

Yes that can be a useful feature. I am thinking of a good way to have them presented.

image
Gitlens has 2 tabs in its view. In our case one can be called Structure and the other can be called ...
It's also possible to add icons to the commands, so that will be nice.
image

This is an example of TODO+ extension view.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jose-a-sa picture jose-a-sa  Â·  4Comments

TiemenSch picture TiemenSch  Â·  6Comments

tenhobi picture tenhobi  Â·  4Comments

iainmstott picture iainmstott  Â·  5Comments

sth4nth picture sth4nth  Â·  3Comments