vscode-markdown
vscode-markdown copied to clipboard
Unable to display second-level selection menu of `\begin{...}` environment
What's the problem
After typing \begin{}
in math equations, the extension shows a list of available math environments, but is unable to suggest as I continue to type. Normally, if I continue to type al
in {}
, the extension should suggest align
, aligned
, etc, but it does not show this second-level menu. This problem has existed for a long time (several months) on my machine; but I am not sure whether this is due to an upper level bug in VS Code.
GIF demonstration
Version
Markdown-all-in-one: 3.5.0-7cda0ac941c125d75a075ac1d21bfbd71b19b17a VS Code: 1.72.1, commit 129500ee4c8ab7263461ffe327268ba56b9f210d OS: macOS 12.6 (Darwin arm64 21.6.0)
Thanks for the report.
I also see the suggestions disappear on typing a
, although they appear again after al
. To me it is more likely a VS Code bug as I just provide the snippets. Can you try these settings?
"[markdown]": {
"editor.quickSuggestions": {
"comments": "on",
"strings": "on",
"other": "on"
}
},
Copying your settings to my settings.json
does not solve the problem. I also tried disabling all other extensions but the issue still exists. In my case the suggestion does not appear after al
or even align
(it just disappears and does not show up again).
Can you try to add some user-defined snippets and check whether they work well? https://code.visualstudio.com/docs/editor/userdefinedsnippets#_choice
Sorry for late response. I tried adding the following snippets:
"Set arraystretch": {
"prefix": "stretch",
"body": [
"\\def \\arraystretch{1.5}"
],
"description": "Set array stretch"
}
Since now VS Code interprets the equation part in markdown as part of LaTeX, I have added the snippet to both markdown.json
and latex.json
. But when I tried typing \def
nothing happens (see the gif). I don't know whether I have added the snippet in the correct way...
Then you can check whether it is because of other extensions, e.g. disable all extensions, and then half of them, and so on. (https://code.visualstudio.com/blogs/2021/02/16/extension-bisect, although its result is not always correct)
It seems that this problem is fixed at least on VS Code 1.74.3. I am closing this issue now.