kabouzeid / nvim-lspinstall

Provides the missing :LspInstall for nvim-lspconfig
MIT License
526 stars 66 forks source link

Consider emmet-ls #34

Open ChristianChiarulli opened 3 years ago

ChristianChiarulli commented 3 years ago

Should be easy since it can be install with npm

https://github.com/aca/emmet-ls

kabouzeid commented 3 years ago

Awesome, I was looking for emmet completions myself :) Will add this soon

kabouzeid commented 3 years ago

@ChristianChiarulli have you tried it? Not sure I want to bundle this, as the emmet-ls lang server doesn't work too well for me.

  1. completion often needs to be triggered manually (eg not automatically on type)
  2. cursor position after completion is <p></p>| instead of <p>|</p>
kabouzeid commented 3 years ago

Will probably add this when the npm release is updated. There are some promising commits in the repo that are not yet published.

kabouzeid commented 3 years ago

If you want this for yourself, just add it to your config somewhere before setup():

require'lspinstall/servers'.emmet = {
  install_script = [[
  ! test -f package.json && npm init -y --scope=lspinstall || true
  npm install emmet-ls
  ]],
  default_config = {
    cmd = { "./node_modules/.bin/emmet-ls", "--stdio" },
    filetypes = { 'html', 'css' },
    root_dir = require'lspconfig'.util.root_pattern(".git", vim.fn.getcwd()),
  }
}

Then you'll be able to :LspInstall emmet

rebuilt commented 3 years ago

@ChristianChiarulli have you tried it? Not sure I want to bundle this, as the emmet-ls lang server doesn't work too well for me.

1. completion often needs to be triggered manually (eg not automatically on type)

2. cursor position after completion is `<p></p>|` instead of `<p>|</p>`

@kabouzeid This is how emmet-ls works for me. I had to use completion-nvim to make it work like this.
My configs are here

However, I'm switching over to use @ChristianChiarulli 's lunarvim project as a base for my new configuration.

emmet-experience

rafamadriz commented 3 years ago

Will probably add this when the npm release is updated. There are some promising commits in the repo that are not yet published.

Hey, just to let you know, the npm package finally got updated a couple of days ago, it's working better for me, although the integration with nvim-compe is not as good yet, there's some snippets that don't expand correctly with compe :(

kabouzeid commented 3 years ago

@rafamadriz which snippets for example?

rafamadriz commented 3 years ago

@kabouzeid Okay it seems like it's all working fine now, for the longest time any snippet that had $ or spaces a{Item $} wouldn't work at all using nvim-compe. Just tried once again and those snippets get properly expanded now.

kabouzeid commented 3 years ago

Thanks for the fast response! Sounds great, I'll give it another try, and bundle the installer in nvim-lspinstall if it's working as expected.