emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.8k stars 892 forks source link

texlab: Autocomplete in \ref{} is empty when using colon. #3461

Open WannabeSmith opened 2 years ago

WannabeSmith commented 2 years ago

Thank you for the bug report

Bug description

Apologies if this is not an lsp-mode issue.

When referring to a section, the autocomplete breaks if I enter a colon ":".

It's a common convention to use colons in section/subsection/theorem/proposition/etc. labels. Thus, I might give my introduction the label \label{section:introduction}, but if I'd like to see an autocompleted list of all sections, it breaks as soon as I type the colon separating "section" and "introduction".

This seems to not be an issue with the server texlab, since I cannot reproduce the issue in VSCode.

See the following screen capture.

https://user-images.githubusercontent.com/5490890/162868400-ce517788-bdd2-4e1a-a99d-e3fd0b4bed7a.mov

Steps to reproduce

Begin referring to a section by typing \ref{section and then enter : to see the autocompleted list disappear. Use the following file as a starting point.

\documentclass{article}

\begin{document}

\section{Introduction}
\label{section:introduction}

\end{document}

Expected behavior

The autocomplete list should not disappear when typing a colon :. It should remain visible while typing all of \ref{section:introduction}.

Which Language Server did you use?

texlab.

OS

MacOS

Error callstack

No response

Anything else?

No response

yyoncho commented 2 years ago

My guess is that : is a trigger character that causes prefix miscalculation.