Sublime Forum

LSP-html not working

#1

Hi there! Can someone help me out? I’ve got LSP and LSP installed for HTML, CSS, and TypeScript. JavaScript and CSS are working fine, but I’m having trouble with HTML.
also, I’ve installed emmet it auto-complete tags on tab but don’t recommend any tags.
Any ideas on how to fix this? Thanks a lot!

0 Likes

St have auto complete buit-in for HTML and CSS?
#2

Alright, when I enter an opening angle bracket, it provides me with tag suggestions. I’m used to writing HTML without typing out the brackets in the code. I simply write the tag names. Is there a way to achieve this?

0 Likes

#3

Unlikely, since the LSP server provides completion depends on context.

I found this https://github.com/aca/emmet-ls but I didn’t try.

1 Like

#4

Make sense, Microsoft has there own implementation for many of these things. After spending a while on it, I arranged my sublime setup to do what I did in Visual Studio Code. I mainly work on the front-end.

About setting up emmet-ls, I got the npm package installed, but it’s not working. I couldn’t find more info to fix it. any help would be appreciated.

0 Likes

#5

LSP is known to not work well together with the Emmet package if you have a server running (e.g. LSP-html), because LSP aggressively closes popups (usually after every keypress).

I’ve got the emmet-ls server working after npm install -g emmet-ls and with

{
  "clients": {
    "emmet-ls": {
      "enabled": true,
      "command": ["emmet-ls", "--stdio"],
      "selector": "text.html | source.css | source.js | source.jsx | source.ts | source.tsx | source.less | source.sass | source.scss"
        }
  }
}

in the LSP settings, but I’ve only tested in HTML with a simple example from the GIF in the Readme page, and I don’t use much HTML, so I can’t compare with the Emmet package from Package Control.

1 Like

#6

thanks for your help. I tried your method I think it worked but had issues, now I’m confused about what causing this issue!

I have added some details to a new post.

0 Likes