Emmet-ls 选项在 nvim(nvchad) 中不起作用

问题描述 投票:0回答:1

lua/custom/configs/lspconfig.lua:

lspconfig.emmet_ls.setup {
  on_attach = on_attach,
  capabilities = capabilities,
  filetypes = {
    "css",
    "eruby",
    "html",
    "javascript",
    "javascriptreact",
    "less",
    "sass",
    "scss",
    "svelte",
    "pug",
    "typescriptreact",
    "vue",
  },
  init_options = {
    html = {
      options = {
        -- For possible options, see: https://github.com/emmetio/emmet/blob/master/src/config.ts#L79-L267
        ["output.selfClosingStyle"] = "xhtml",
      },
    },
  },
}

index.tsx:

input /// clicking enter in completion list -----> <input type="text">

我复制了这个配置,并根据github中emmet-ls的参考进行了编辑。

有人可以帮我解决这个问题吗?

我期待 emmet-ls 给我

<input type="text" />
而不是
<input type="text">
我什至尝试将 init_options 中的 html 单词更改为 typescriptreact 但仍然不起作用。

neovim emmet nvim-lspconfig neovim-plugin
1个回答
0
投票

您安装了

emmet_ls
软件包吗?

npm install -g emmet-ls

我一直在寻找 nvim 的 Emmet 配置并尝试了您建议的配置。一旦我安装了 emmet-ls,它就开始工作了

© www.soinside.com 2019 - 2024. All rights reserved.