Closed sorawee closed 1 year ago
Unfortunately, there is no easy of declaring the content of a macro as verbatim, which is precisely what would solve the current issue. It is possible to declare environments as verbatim using latex-workshop.latex.verbatimEnvs
.
Achieving the same for macros is far more difficult as finding the closing brace delimiting the macro can be tricky because of brace nesting. We may give it a try and see how robust it is.
Personally, I think it's fine that the file will fail to parse. What I should have made more clear is that I am more concerned with basic functionalities (building, viewing pdf, editing, saving), which should not be affected by this issue.
Can we impose a time limit on the parser call, and don't do advanced functionalities on the file if the limit exceeds?
What is the value of latex-workshop.intellisense.fastparse.enabled
? If it is false
, can you try to set it to true
?
It is already true
.
It’s indeed unified-latex that lags (5000+ms). I will look into the issue.
In principle, parsing should not prevent users from other actions. I’m yet to figure out what’s wrong with that.
We have a temporary and dirty (but works well) solution: For now, all $
signs (not \$
) is replaced by a harmless |
before parsing with unified-latex
. I have created an issue to the upstream https://github.com/siefkenj/unified-latex/issues/35 and will keep an eye.
2e585b8 is not a viable solution. I will work at the upstream https://github.com/siefkenj/unified-latex/issues/35 to solve this issue once and for all.
Fixed in bb16132
Pre-checks*
Environment*
The Issue*
Reproduction Steps
Consider the following file:
\end{document}
).\begin{center}...\end{center}
high enough to make it evidently stuck on my computer, but not too high that it appears to hang forever. Adding more\begin{center}...\end{center}
will make it hang longer (exponentially for each adding). Removing\begin{center}...\end{center}
will make it hang less.Expected Behavior
Logs
LaTeX Workshop Output*
\usepackage{listings}
\lstdefinelanguage{test}{ morekeywords={<$>}, alsoletter={<>$}, }
\begin{document}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\begin{center} \lstinline[language=test]{a <$> b} \end{center}
\end{document}: Expected "Big", "Bigg", "\", "autoref", "begin", "big", "bigg", "eqref", "label", "left", "linebreak", "newline", "ref", or "text" but "e" found. Location context: {"start":{"offset":188,"line":14,"column":2},"end":{"offset":189,"line":14,"column":3}} . [09:06:27.124][Cacher] Parsed LaTeX AST with LU in 467.47 ms: %WS1%/doc.tex . [09:06:32.616][Cacher] Parsed LaTeX AST in 5490.88 ms: %WS1%/doc.tex . [09:06:32.777][Cacher] Failed parsing LaTeX AST. [09:06:32.790][Cacher] Use RegExp to update elements of %WS1%/doc.tex . [09:06:32.993][DupLabel] Checking for duplicate labels: %WS1%/doc.tex . [09:06:33.5][Cacher] Updated elements of %WS1%/doc.tex . [09:06:33.19][Cacher] Updated bibs of %WS1%/doc.tex . [09:06:33.35][Cacher] Cached %WS1%/doc.tex . [09:06:33.39][Event] FILE_PARSED: "%WS1%/doc.tex" [09:06:33.74][Cacher] Parsing .fls %WS1%/doc.fls . [09:06:33.127][Cacher] Found .aux %WS1%/doc.tex from .fls %WS1%/doc.fls , parsing. [09:06:33.134][Cacher] Parsed .aux %WS1%/doc.tex . [09:06:33.156][Cacher] Parsed .fls %WS1%/doc.fls . [09:06:33.177][Structure] Structure force updated with 0 root sections for %WS1%/doc.tex . [09:06:33.198][Event] STRUCTURE_UPDATED [09:06:35.556][Viewer] Handle data type: open [09:06:35.827][Server] Preview PDF file: file://%WS1%/doc.pdf [09:06:37.809][Viewer] Handle data type: loaded [09:06:37.809][Event] VIEWER_PAGE_LOADED [09:06:38.74][Event] VIEWER_STATUS_CHANGED: {"pdfFileUri":"file://%WS1%/doc.pdf","scale":"auto","scrollMode":0,"sidebarView":0,"spreadMode":0,"scrollTop":0,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true} [09:06:38.74][Event] VIEWER_STATUS_CHANGED: {"pdfFileUri":"file://%WS1%/doc.pdf","scale":"auto","scrollMode":0,"sidebarView":0,"spreadMode":0,"scrollTop":0,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true} [09:06:38.75][Event] VIEWER_STATUS_CHANGED: {"pdfFileUri":"file://%WS1%/doc.pdf","scale":"auto","scrollMode":0,"sidebarView":0,"spreadMode":0,"scrollTop":0,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true} [09:06:38.75][Event] VIEWER_STATUS_CHANGED: {"pdfFileUri":"file://%WS1%/doc.pdf","scale":"auto","scrollMode":0,"sidebarView":0,"spreadMode":0,"scrollTop":0,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true} [09:06:38.80][Event] VIEWER_STATUS_CHANGED: {"pdfFileUri":"file://%WS1%/doc.pdf","scale":"auto","scrollMode":0,"sidebarView":0,"spreadMode":0,"scrollTop":0,"scrollLeft":0,"trim":0,"synctexEnabled":true,"autoReloadEnabled":true}
package.json (LOSES): inlineCompletionsAdditions, terminalDataWriteEvent product.json (WINS): inlineCompletionsAdditions 2023-06-07 09:06:28.257 [info] [perf] Render performance baseline is 31ms 2023-06-07 09:06:30.562 [info] UNRESPONSIVE extension host: starting to profile NOW 2023-06-07 09:06:33.217 [info] UNRESPONSIVE extension host: received responsive event and cancelling profiling session 2023-06-07 09:06:33.747 [warning] UNRESPONSIVE extension host: 'james-yu.latex-workshop' took 91.6148157152655% of 2441.839ms, saved PROFILE here: 'file:///var/folders/8v/ssfgpb5d67n4jrvmszsh7y800000gn/T/exthost-032bf8.cpuprofile'
2023-06-07 09:14:40.224 [error] Error: Aborted onWillSaveTextDocument-event after 1750ms at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1844:13556 2023-06-07 09:14:41.264 [info] UNRESPONSIVE extension host: starting to profile NOW 2023-06-07 09:14:42.395 [error] Error: Aborted onWillSaveTextDocument-event after 1750ms at vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1844:13556 2023-06-07 09:14:45.229 [info] UNRESPONSIVE extension host: received responsive event and cancelling profiling session 2023-06-07 09:14:46.029 [warning] UNRESPONSIVE extension host: 'james-yu.latex-workshop' took 96.41605360944111% of 3840.424ms, saved PROFILE here: 'file:///var/folders/8v/ssfgpb5d67n4jrvmszsh7y800000gn/T/exthost-2e0657.cpuprofile' 2023-06-07 09:14:48.786 [info] UNRESPONSIVE extension host: starting to profile NOW 2023-06-07 09:14:53.345 [info] UNRESPONSIVE extension host: received responsive event and cancelling profiling session 2023-06-07 09:14:54.172 [warning] UNRESPONSIVE extension host: 'james-yu.latex-workshop' took 93.68096632324936% of 4297.723ms, saved PROFILE here: 'file:///var/folders/8v/ssfgpb5d67n4jrvmszsh7y800000gn/T/exthost-96cb5a.cpuprofile' 2023-06-07 09:14:57.071 [info] UNRESPONSIVE extension host: starting to profile NOW 2023-06-07 09:15:02.421 [warning] UNRESPONSIVE extension host: 'james-yu.latex-workshop' took 98.00339270365677% of 4923.418ms, saved PROFILE here: 'file:///var/folders/8v/ssfgpb5d67n4jrvmszsh7y800000gn/T/exthost-d6572b.cpuprofile' 2023-06-07 09:15:08.406 [info] UNRESPONSIVE extension host: starting to profile NOW 2023-06-07 09:15:13.908 [warning] UNRESPONSIVE extension host: 'james-yu.latex-workshop' took 98.36969268833501% of 4944.77ms, saved PROFILE here: 'file:///var/folders/8v/ssfgpb5d67n4jrvmszsh7y800000gn/T/exthost-0ebf1b.cpuprofile'