lsp-mode icon indicating copy to clipboard operation
lsp-mode copied to clipboard

Slowdown in lsp-mode because the sever reports errors on TinyTex LaTeX distribution instead of only in the current project

Open maikol-solis opened this issue 1 year ago • 1 comments

Thank you for the bug report

  • [X] I am using the latest version of lsp-mode related packages.
  • [X] I checked FAQ and Troubleshooting sections
  • [X] You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

For a latex file, lsp-mode shows problems with the packages loaded by using usepackage or their dependencies.

This overloads the lsp calls and slows the whole process, making editing the source file nearly impossible.

More detailed debug reports are here (https://github.com/emacs-lsp/lsp-mode/issues/2417#issuecomment-1875831230)

Steps to reproduce

  • Open a new latex file with TinyTex installed (I don't know if it happens with other latex distributions). For example, something simple like this
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amssymb}

\begin{document}
\(\alpha+\beta =1\)

\begin{equation*}
\gamma + \delta = (\beta + 1)^2
\end{equation*}

\end{document}
[Trace - 04:35:01 AM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/maikol/Library/TinyTeX/texmf-dist/tex/latex/base/ltluatex.tex"
}
  • The lsp diagnostics is populated with all the errors on internal packages

image

  • Slowdowns to edit the file because the massive information sent to the server.
  • It happens even if lsp-log-io is nil

Expected behavior

The expected behavior is that the server reports the errors only in the current project. I had a similar issue with eglot, and it could be solved directly on the server side (https://github.com/latex-lsp/texlab/issues/986), but I don't understand why it is still happening on lsp-mode.

Which Language Server did you use?

texlab

OS

MacOS

Error callstack

No response

Anything else?

No response

maikol-solis avatar Mar 04 '24 10:03 maikol-solis

Expected behavior The expected behavior is that the server reports the errors only in the current project. I had a similar issue with eglot, and it could be solved directly on the server side (latex-lsp/texlab#986), but I don't understand why it is still happening on lsp-mode.

Can someone from the serverside help us with that? As you have mentioned it is up to the server to decide what to report.

yyoncho avatar Mar 04 '24 12:03 yyoncho