【问题标题】:How do you use an Emmet shortcut inside a tabstop from a VSCode Snippet?如何在 VSCode Snippet 的制表位内使用 Emmet 快捷方式?
【发布时间】:2020-10-13 21:13:20
【问题描述】:

我在我的 VSCode 中创建了几个自定义用户片段,并添加到 html.json 文件中。我的想法是能够在 PHP 标记的内部和外部进行标签和编辑。

在 HTML 中使用 PHP 的 if else 示例:

"Ife:": {
        "prefix": ":ife",
        "body": [
            "<?php if($1): ?>",
            "\t$2",
            "<?php else: ?>",
            "\t$3",
            "<?php endif; ?>",
            "$0"
        ],
        "description": "Ife:"
    }

我遇到的问题是,当我在 PHP 标记之外使用 tab 并且我想使用 Emmet 快捷方式时,Emmet 不起作用。我可以一直跳到 $0,然后如果我将光标放回 $2 或 $3,那么我可以使用 Emmet 快捷方式。

那么,Emmet 不能与 sn-ps 的制表位一起使用还是我做错了什么?

【问题讨论】:

    标签: php html visual-studio-code emmet vscode-snippets


    【解决方案1】:

    好的,24 小时后,我意识到这是一个影响范围更广的问题,通常会影响所有 Intellisense,并且可以在以下条件下进行配置:

    文件 > 首选项 > 设置

    搜索editor.suggest.snippetsPreventQuickSuggestions

    你们可以在这里阅读更多讨论:Intellisense not working in code snippets - VS Code

    【讨论】:

      猜你喜欢
      • 2020-07-15
      • 2013-08-01
      • 1970-01-01
      • 2020-05-09
      • 1970-01-01
      • 1970-01-01
      • 2017-01-12
      • 2016-07-06
      • 2019-07-01
      相关资源
      最近更新 更多