James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.47k stars 519 forks source link

Minimap section headers are not shown #4223

Closed tobiasdiez closed 4 months ago

tobiasdiez commented 4 months ago

Please fill the following fields with a star (*) and provide as much related information as possible.

Pre-checks*

Please change the following [ ] to [x] for confirmation.

  • [ ] The issue has not been reported in this repository.
  • [ ] The issue remains after disabling all other extensions and restarting Visual Studio Code.
  • [ ] The FAQ cannot address the issue.
  • [ ] The issue is not related to compiling a document, or the document can be successfully compiled in the OS terminal but not in Visual Studio Code with this extension.

Environment*

Please write exact version numbers instead of descriptors such as latest.

  • Operating System: Win 11
  • Visual Studio Code Version: 1.89
  • LaTeX Workshop Version: latest
  • TeX Distribution Version: tex live

Please list the environment and version number if you are using VSCodium, Snap or Flatpack versions of Visual Studio Code, and/or Visual Studio Code Remote Containers/SSH/WSL.

  • I am using XXX whose version is YY.ZZ

The Issue*

VS code recently added section headers to the minimap, see https://code.visualstudio.com/updates/v1_88#_minimap-section-headers. This is however not working for the folding markers added by this extension for \section commands.

Reproduction Steps

Have a document with \section{Test} and look at the minimap.

Expected Behavior

The section name should appear in the minimap.

Logs

LaTeX Workshop Output*

Please paste the whole log messages below, not parts of ones. The log should start with New log placeholder %WS1% registered.

[Paste the log here. Do not remove the surrounding backquotes (`).]

Developer Tools Console

Please paste the whole log messages below, not parts of ones. This console logs can sometimes be very important in many cases. To access the log, click Help -> Toggle Developer Tools -> Console.

[Paste the log here. Do not remove the surrounding backquotes (`).]

Anything Else?

Add any other context about the problem below.

James-Yu commented 4 months ago

The minimap now recognizes and renders sections defined by folding markers, such as //#region in TypeScript, or comments that use MARK:. This lets you quickly scan and navigate across large files.

It’s a vscode side feature request.

tobiasdiez commented 4 months ago

As the code shows https://github.com/microsoft/vscode/pull/190759/files#diff-65a0218d42adca167f6ca9accf9a2dfc46c2fe84d3e1cbe0269202af243c92d0R62 all regions matched by the language services foldingRules are taken into account, i.e. by LanguageConfigurationService.getLanguageConfiguration(languageId).foldingRules. There is also nothing specific to TS's #region in this PR as far as I can see, hence my hope that you can also make it work for Latex. How is the folding handled in this extension?

James-Yu commented 4 months ago

https://github.com/James-Yu/LaTeX-Workshop/blob/master/src/language/folding.ts