James-Yu / LaTeX-Workshop

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

Surrounding text with autocompletion doesn't work #3536

Closed RivinHD closed 1 year ago

RivinHD commented 1 year ago

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, restart VS Code, 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

Describe the bug [Required]

In the new VS Code version 1.73.1, surrounding text with a command using autocomplete no longer works. It deletes the selected text and replaces it with the selected command from autocomplete. (Tested on Windows and Ubuntu). However, in the older version 1.72.2 it works perfectly fine.

To Reproduce

Steps to reproduce the behavior:

  1. write a text e.g. test
  2. select the text
  3. write \ and autocomplete to \(
  4. the selected text is replaced by \(\)

Expected behavior

The test should be surrounded by brackets \(test\).

Logs [Required]

LaTeX Workshop Output [Required]

[20:28:25] Initializing LaTeX Workshop.
[20:28:25] Extension root: c:\Users\vn\.vscode\extensions\james-yu.latex-workshop-9.0.1
[20:28:25] $PATH: S:\Programs\Eclipse Adoptium\jdk-17.0.3.7-hotspot\bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Program Files\Python39\Scripts\;C:\Program Files\Python39\;S:\Programs\Python\Scripts\;S:\Programs\Python\;C:\Program Files (x86)\Razer\ChromaBroadcast\bin;C:\Program Files\Razer\ChromaBroadcast\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\vn\AppData\Local\Microsoft\WindowsApps;C:\Users\vn\AppData\Local\GitHubDesktop\bin;S:\Programs\VS Code\bin;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;S:\Programs\texlive\2022\bin\win32;C:\Users\vn\AppData\Local\Microsoft\WindowsApps;C:\Users\vn\AppData\Local\GitHubDesktop\bin;S:\Programs\VS Code\bin;S:\Programs\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;S:\Programs\Eclipse Adoptium\jdk-17.0.3.7-hotspot\bin;S:\Programs\Blender;C:\Users\vn\.dotnet\tools
[20:28:25] $SHELL: undefined
[20:28:25] $LANG: undefined
[20:28:25] $LC_ALL: undefined
[20:28:25] process.platform: win32
[20:28:25] process.arch: x64
[20:28:25] vscode.env.appName: Visual Studio Code
[20:28:25] vscode.env.remoteName: undefined
[20:28:25] vscode.env.uiKind: 1
[20:28:25] Configuration for workspace: undefined
[20:28:25] editor.acceptSuggestionOnEnter: "on"
[20:28:25] latex-workshop.bind.enter.key: true
[20:28:25] latex-workshop.docker.enabled: false
[20:28:25] latex-workshop.docker.image.latex: ""
[20:28:25] latex-workshop.hover.preview.mathjax.extensions: []
[20:28:25] latex-workshop.intellisense.package.enabled: true
[20:28:25] latex-workshop.intellisense.update.aggressive.enabled: true
[20:28:25] latex-workshop.intellisense.update.delay: 500
[20:28:25] latex-workshop.latex.autoBuild.run: "onFileChange"
[20:28:25] latex-workshop.latex.build.forceRecipeUsage: true
[20:28:25] latex-workshop.latex.outDir: "%DIR%/.build"
[20:28:25] latex-workshop.latex.recipes: [
 {
  "name": "latexmk (xelatex)",
  "tools": [
   "xelatexmk"
  ]
 },
 {
  "name": "latexmk 🔃",
  "tools": [
   "latexmk"
  ]
 },
 {
  "name": "latexmk (latexmkrc)",
  "tools": [
   "latexmk_rconly"
  ]
 },
 {
  "name": "latexmk (lualatex)",
  "tools": [
   "lualatexmk"
  ]
 },
 {
  "name": "pdflatex ➞ bibtex ➞ pdflatex × 2",
  "tools": [
   "pdflatex",
   "bibtex",
   "pdflatex",
   "pdflatex"
  ]
 },
 {
  "name": "Compile Rnw files",
  "tools": [
   "rnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "Compile Jnw files",
  "tools": [
   "jnw2tex",
   "latexmk"
  ]
 },
 {
  "name": "tectonic",
  "tools": [
   "tectonic"
  ]
 }
]
[20:28:25] latex-workshop.latex.tools: [
 {
  "name": "latexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-shell-escape",
   "-pdf",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "lualatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-shell-escape",
   "-lualatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "xelatexmk",
  "command": "latexmk",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-shell-escape",
   "-bibtex",
   "-xelatex",
   "-outdir=%OUTDIR%",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "latexmk_rconly",
  "command": "latexmk",
  "args": [
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "pdflatex",
  "command": "pdflatex",
  "args": [
   "-synctex=1",
   "-interaction=nonstopmode",
   "-file-line-error",
   "-shell-escape",
   "%DOC%"
  ],
  "env": {}
 },
 {
  "name": "bibtex",
  "command": "bibtex",
  "args": [
   "%DOCFILE%"
  ],
  "env": {}
 },
 {
  "name": "rnw2tex",
  "command": "Rscript",
  "args": [
   "-e",
   "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')"
  ],
  "env": {}
 },
 {
  "name": "jnw2tex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")"
  ],
  "env": {}
 },
 {
  "name": "jnw2texmintex",
  "command": "julia",
  "args": [
   "-e",
   "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")"
  ],
  "env": {}
 },
 {
  "name": "tectonic",
  "command": "tectonic",
  "args": [
   "--synctex",
   "--keep-logs",
   "%DOC%.tex"
  ],
  "env": {}
 }
]
[20:28:25] latex-workshop.viewer.pdf.internal.keyboardEvent: "auto"
[20:28:25] Creating a new file watcher.
[20:28:25] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}}
[20:28:25] Creating PDF file watcher.
[20:28:25] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{}}
[20:28:25] Creating Bib file watcher.
[20:28:25] watcherOptions: {"useFsEvents":false,"usePolling":false,"interval":300,"binaryInterval":1000,"awaitWriteFinish":{"stabilityThreshold":250}}
[20:28:25] Set $LATEXWORKSHOP_DOCKER_LATEX: ""
[20:28:26] [Server] Creating LaTeX Workshop http and websocket server.
[20:28:26] LaTeX Workshop initialized.
[20:28:26] Trigger characters for intellisense of LaTeX documents: ["\\",",","{"]
[20:28:26] Bibtex format config: {"tab":"  ","case":"lowercase","left":"{","right":"}","trailingComma":false,"sort":["key"],"alignOnEqual":true,"sortFields":true,"fieldsOrder":[],"firstEntries":["string","xdata"]}
[20:28:26] Current workspace folders: undefined
[20:28:26] Found root file from active editor: s:\Temp\test.tex
[20:28:26] Root file changed: from undefined to s:\Temp\test.tex
[20:28:26] Start to find all dependencies.
[20:28:26] Root file languageId: latex
[20:28:26] Reset file watcher.
[20:28:26] Parsing a file and its subfiles: s:\Temp\test.tex
[20:28:26] Parse fls file.
[20:28:26] Cannot find fls file: s:\Temp\.build\test.fls
[20:28:26] Linter for root file started.
[20:28:26] Linter for root command: chktex
[20:28:26] Linter for root command args: ["-wall","-n22","-n30","-e16","-q","-n46","-f%f:%l:%c:%d:%k:%n:%m\n","s:\\Temp\\test.tex"]
[20:28:26] [Server] Server successfully started: {"address":"127.0.0.1","family":"IPv4","port":64052}
[20:28:26] Added to file watcher: s:\Temp\test.tex
[20:28:26] Snippet data loaded.
[20:28:26] [Server] valdOrigin is http://127.0.0.1:64052
[20:28:26] Checking for duplicate labels: s:\Temp\test.tex.
[20:28:26] Linter for root successfully finished in 0s 507ms
[20:28:26] The .chktexrc file not found.
[20:28:26] Linter log parsed with 0 messages.
[20:28:28] Manager.fileWatcher.getWatched: {"s:\\Temp":["test.tex"]}
[20:28:28] Manager.filesWatched: ["s:\\Temp\\test.tex"]
[20:28:28] BibWatcher.bibWatcher.getWatched: {}
[20:28:28] BibWatcher.bibsWatched: []
[20:28:28] PdfWatcher.pdfWatcher.getWatched: {}
[20:28:28] PdfWatcher.pdfsWatched: []
[20:28:28] PdfWatcher.watchedPdfVirtualUris: []
[20:28:28] PdfWatcher.ignoredPdfUris: []
[20:28:34] Linter for active file started.
[20:28:34] Linter for active command: chktex
[20:28:34] Linter for active command args: ["-wall","-n22","-n30","-e16","-q","-n46","-I0","-f%f:%l:%c:%d:%k:%n:%m\n"]
[20:28:34] Parsing a file and its subfiles: s:\Temp\test.tex
[20:28:34] Parse fls file.
[20:28:34] Cannot find fls file: s:\Temp\.build\test.fls
[20:28:34] Checking for duplicate labels: s:\Temp\test.tex.
[20:28:35] Linter for active successfully finished in 0s 367ms
[20:28:35] The .chktexrc file not found.
[20:28:35] Linter log parsed with 0 messages.
[20:28:36] Linter for active file started.
[20:28:36] Linter for active command: chktex
[20:28:36] Linter for active command args: ["-wall","-n22","-n30","-e16","-q","-n46","-I0","-f%f:%l:%c:%d:%k:%n:%m\n"]
[20:28:36] Parsing a file and its subfiles: s:\Temp\test.tex
[20:28:36] Parse fls file.
[20:28:36] Cannot find fls file: s:\Temp\.build\test.fls
[20:28:36] Checking for duplicate labels: s:\Temp\test.tex.
[20:28:36] Linter for active successfully finished in 0s 390ms
[20:28:36] The .chktexrc file not found.
[20:28:36] Linter log parsed with 0 messages.
[20:28:37] Linter for active file started.
[20:28:37] Linter for active command: chktex
[20:28:37] Linter for active command args: ["-wall","-n22","-n30","-e16","-q","-n46","-I0","-f%f:%l:%c:%d:%k:%n:%m\n"]
[20:28:37] Parsing a file and its subfiles: s:\Temp\test.tex
[20:28:37] Parse fls file.
[20:28:37] Cannot find fls file: s:\Temp\.build\test.fls
[20:28:37] Checking for duplicate labels: s:\Temp\test.tex.
[20:28:38] Linter for active successfully finished in 0s 359ms
[20:28:38] The .chktexrc file not found.
[20:28:38] Linter log parsed with 0 messages.
[20:28:38] Linter for active file started.
[20:28:38] Linter for active command: chktex
[20:28:38] Linter for active command args: ["-wall","-n22","-n30","-e16","-q","-n46","-I0","-f%f:%l:%c:%d:%k:%n:%m\n"]
[20:28:38] Parsing a file and its subfiles: s:\Temp\test.tex
[20:28:38] Parse fls file.
[20:28:38] Cannot find fls file: s:\Temp\.build\test.fls
[20:28:38] Checking for duplicate labels: s:\Temp\test.tex.
[20:28:38] Linter for active successfully finished in 0s 361ms
[20:28:38] The .chktexrc file not found.
[20:28:38] Linter log parsed with 1 messages.
[20:28:44] Current workspace folders: undefined
[20:28:44] Found root file from active editor: s:\Temp\test.tex
[20:28:44] Keep using the same root file: s:\Temp\test.tex
[20:28:44] Linter for root file started.
[20:28:44] Linter for root command: chktex
[20:28:44] Linter for root command args: ["-wall","-n22","-n30","-e16","-q","-n46","-f%f:%l:%c:%d:%k:%n:%m\n","s:\\Temp\\test.tex"]
[20:28:45] Linter for root successfully finished in 0s 420ms
[20:28:45] The .chktexrc file not found.
[20:28:45] Linter log parsed with 0 messages.

Developer Tools Console [Required]

workbench.desktop.main.js:sourcemap:609 CRITI Extension 'ms-toolsai.jupyter' wants API proposal 'notebookDebugOptions' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.
workbench.desktop.main.js:sourcemap:2147 Overwriting grammar scope name to file mapping for scope text.tex.
Old grammar file: file:///s%3A/Programs/VS%20Code/resources/app/extensions/latex/syntaxes/TeX.tmLanguage.json.
New grammar file: file:///c%3A/Users/vn/.vscode/extensions/james-yu.latex-workshop-9.0.1/syntax/TeX.tmLanguage.json
register @ workbench.desktop.main.js:sourcemap:2147
workbench.desktop.main.js:sourcemap:2147 Overwriting grammar scope name to file mapping for scope text.tex.latex.
Old grammar file: file:///s%3A/Programs/VS%20Code/resources/app/extensions/latex/syntaxes/LaTeX.tmLanguage.json.
New grammar file: file:///c%3A/Users/vn/.vscode/extensions/james-yu.latex-workshop-9.0.1/syntax/LaTeX.tmLanguage.json
register @ workbench.desktop.main.js:sourcemap:2147
workbench.desktop.main.js:sourcemap:2147 Overwriting grammar scope name to file mapping for scope text.bibtex.
Old grammar file: file:///s%3A/Programs/VS%20Code/resources/app/extensions/latex/syntaxes/Bibtex.tmLanguage.json.
New grammar file: file:///c%3A/Users/vn/.vscode/extensions/james-yu.latex-workshop-9.0.1/syntax/Bibtex.tmLanguage.json
register @ workbench.desktop.main.js:sourcemap:2147
workbench.desktop.main.js:sourcemap:2147 Overwriting grammar scope name to file mapping for scope text.tex.markdown_latex_combined.
Old grammar file: file:///s%3A/Programs/VS%20Code/resources/app/extensions/latex/syntaxes/markdown-latex-combined.tmLanguage.json.
New grammar file: file:///c%3A/Users/vn/.vscode/extensions/james-yu.latex-workshop-9.0.1/syntax/markdown-latex-combined.tmLanguage.json
register @ workbench.desktop.main.js:sourcemap:2147
workbench.desktop.main.js:sourcemap:2147 Overwriting grammar scope name to file mapping for scope source.cpp.embedded.latex.
Old grammar file: file:///s%3A/Programs/VS%20Code/resources/app/extensions/latex/syntaxes/cpp-grammar-bailout.tmLanguage.json.
New grammar file: file:///c%3A/Users/vn/.vscode/extensions/james-yu.latex-workshop-9.0.1/syntax/cpp-grammar-bailout.tmLanguage.json
register @ workbench.desktop.main.js:sourcemap:2147
workbench.desktop.main.js:sourcemap:609  INFO [perf] Render performance baseline is 22ms

Desktop [Required]

Additional questions

Are you using VSCodium?

No

Are you using the Snap or Flatpack versions of VS Code?

Yes (only Ubuntu)

Are you using LaTeX Workshop with VS Code Remote?

No

jlelong commented 1 year ago

Duplicate of #3533