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

document symbols numbering as in toc #1251

Merged
merged 2 commits into from
Oct 26, 2024

Conversation

nolanking90
Copy link
Contributor

Fix #910
Created new command variants for \contentline and \numberline, and added section_numbers to aux doc data struct.
Now, uses the numbering from the table of contents to number sections in the documents symbols list.
This PR changes the expected output of the document symbol unit test, so the test is updated as well.

\documentclass{article}

\begin{document}

\section{First Section}\label{asec:outer} % 1 Section
	\begin{equation}\label{eq:myEQ}
		1 + 1 = 2
	\end{equation}

	\subsection{Subsection}{First Subsection} % 1.1 Subsection

\section{Another Section} % 2 Section'
	\subsection{Dummy} % 2.1 Dummy
	\subsection*{Subsection'}\label{sec:inner} % Subsection'

\end{document}

produces the following document symbols

main.tex|5 col 24| [Module] 1 First Section
main.tex|6 col 18| [Constant] Equation (1)
main.tex|10 col 2| [Module] 1.1 Subsection
main.tex|12 col 1| [Module] 2 Another Section
main.tex|13 col 2| [Module] 2.1 Dummy
main.tex|14 col 27| [Module] Subsection'

@nolanking90 nolanking90 marked this pull request as ready for review October 26, 2024 03:07
Copy link
Member

@pfoerster pfoerster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@pfoerster pfoerster merged commit d20e1db into latex-lsp:master Oct 26, 2024
10 checks passed
@nolanking90 nolanking90 deleted the feature-document-symbols branch October 26, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numbering on textDocument/documentSymbol
2 participants