James-Yu / LaTeX-Workshop

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

Intellisense writes extra brace like `\end{env}}` #2114

Closed thegregyang closed 4 years ago

thegregyang commented 4 years ago

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]

You still see this issue?: Yes

Make sure to visit the wiki FAQ before filling an issue.

You visited the wiki?: Yes

If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.

You can compile a TeX document manually?: Yes

Describe the bug [Required]

When using \begin{env} autocomplete, the editor inserts an unnecessary right brace after the autocompleted \end{env}. This seems to be a bug introduced recently, possibly by this commit

To Reproduce

Steps to reproduce the behavior:

  1. type \begin{
  2. choose an environment from the intellisense dropdown
  3. press enter
  4. see that intellisense completes \end{env}} instead of \end{env}

Expected behavior

intellisense completes \end{env} instead of \end{env}}

Logs [Required]

Please paste the whole log messages here, not parts of ones. It is very important to identify problems.

LaTeX Workshop Output [Required]

··· [02:26:36] Initializing LaTeX Workshop. [02:26:36] Creating file watcher for .pdf files. [02:26:39] pdflatex is provided by MiKTeX [02:26:39] Creating LaTeX Workshop http and websocket server. [02:26:39] LaTeX Workshop initialized. [02:26:40] Found root file from active editor: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex [02:26:40] Root file changed from: undefined to c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex. Find all dependencies. [02:26:40] Instantiating a new file watcher for c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex [02:26:40] Creating file watcher for .bib files. [02:26:40] Parsing c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex [02:26:40] Parse fls file. [02:26:40] Server created on 127.0.0.1:57337 [02:26:40] Adding c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex to file watcher. [02:26:40] Adding c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.sty to file watcher. [02:26:40] Adding c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\mymacros.sty to file watcher. [02:26:40] Snippet data loaded. [02:26:40] LaTeX Workshop version: 8.9.0 [02:26:40] VIEW command invoked with mode: file:///c%3A/Users/gregyang/OneDrive/texlipse-workspace/neurips2020template/neurips_2020.tex. [02:26:40] Found root file from active editor: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex [02:26:40] Root file remains unchanged from: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex. [02:26:40] Serving PDF file at http://localhost:57337/viewer.html?file=pdf..YyUzQSU1Q1VzZXJzJTVDZ3JlZ3lhbmclNUNPbmVEcml2ZSU1Q3RleGxpcHNlLXdvcmtzcGFjZSU1Q25ldXJpcHMyMDIwdGVtcGxhdGUlNUNuZXVyaXBzXzIwMjAucGRm [02:26:40] The encoded path is c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.pdf [02:26:40] Open PDF tab for c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.pdf [02:26:42] Handle data type: open [02:26:44] Preview PDF file: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.pdf [02:26:44] Handle data type: request_params [02:26:44] Found root file from active editor: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex [02:26:44] Root file remains unchanged from: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex. [02:26:44] Handle data type: loaded [02:27:31] Found root file from active editor: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex [02:27:31] Root file remains unchanged from: c:\Users\gregyang\OneDrive\texlipse-workspace\neurips2020template\neurips_2020.tex. ···

Developer Tools Console [Required]

To access the log, click 'help' -> 'Toggle Developer Tools' -> 'Console'. Paste anything suspicious.

Extension Host
extensionHost.ts:213 Debugger attached.
log.ts:191  WARN UNRESPONSIVE extension host, 'James-Yu.latex-workshop' took 100% of 5621.226ms, saved PROFILE here: 'C:\Users\gregyang\AppData\Local\Temp\exthost-c127bc.cpuprofile' Array(2)
api.github.com/search/issues?q=is:issue+state:open+in:title+repo:James-Yu/LaTeX-Workshop.git+%22Extension+causes+high+cpu+load%22:1 Failed to load resource: the server responded with a status of 422 (Unprocessable Entity)
log.ts:197   ERR Server returned 422: Error: Server returned 422
    at Object.t.asText (file:///C:/Users/gregyang/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1839:801)
    at b (file:///C:/Users/gregyang/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3072:39)
    at async e._processCpuProfile (file:///C:/Users/gregyang/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:4748:635)
webviewElement.ts:287 [Embedded Page] PDF 8f986a10fe9374fad8c0e3f76e2a884e [1.5 MiKTeX pdfTeX-1.40.21 / LaTeX with hyperref] (PDF.js: 2.3.200)

Screenshots

If applicable, add screenshots to help explain your problem.

image

Desktop [Required]

Additional questions

Are you using LaTeX Workshop with VS Code Remote?

No

If the answer is Yes, please write which one you are using. Write the versions of the remote extension.

Additional context

Add any other context about the problem here.

jlelong commented 4 years ago

Duplicate of #2087