vscode-markdown icon indicating copy to clipboard operation
vscode-markdown copied to clipboard

Unable to display second-level selection menu of `\begin{...}` environment

Open Yue-Zhengyuan opened this issue 1 year ago • 3 comments

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

bug

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)

Yue-Zhengyuan avatar Oct 14 '22 10:10 Yue-Zhengyuan

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"
        }
    },

yzhang-gh avatar Oct 14 '22 18:10 yzhang-gh

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).

Yue-Zhengyuan avatar Oct 15 '22 10:10 Yue-Zhengyuan

Can you try to add some user-defined snippets and check whether they work well? https://code.visualstudio.com/docs/editor/userdefinedsnippets#_choice

yzhang-gh avatar Oct 15 '22 16:10 yzhang-gh

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...

user_snippet

Yue-Zhengyuan avatar Oct 24 '22 13:10 Yue-Zhengyuan

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)

yzhang-gh avatar Oct 24 '22 14:10 yzhang-gh

It seems that this problem is fixed at least on VS Code 1.74.3. I am closing this issue now.

Yue-Zhengyuan avatar Jan 31 '23 01:01 Yue-Zhengyuan