emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.72k stars 861 forks source link

lsp-html - update to new version of custom data and add new configuration options #4399

Closed themkat closed 3 months ago

themkat commented 3 months ago

Updating custom data

I could not get custom data to work on my machine with a simple option/property/setting. From reading the vscode html tools source code, it seems that this extension uses the property internally in the same way we do here (read diffs in this PR). In summary:

When the content of these files have been sent to the server, it seems to work perfectly. I can complete, view hover information and more. I used various projects, like the example project from the vscode team. I added an extra custom data definition with some bogus to make it more interesting:

{
  "version": 1.1,
  "tags": [
    {
      "name": "dafuq",
      "description": "The super cool new tag for the cool kids",
      "attributes": [
        { "name": "isThisShit" },
        {
          "name": "test",
          "values": [
            {
              "name": "is-working"
            }
          ]
        }
      ]
    }
  ]
}
image image image

Completion of attributes also works perfectly. I just have to be sure to activate yas-minor-mode (or similar templating system).

Fixes #4327 (probably)

New configuration options

Added lsp-html-hover-documentation and lsp-html-hover-references, which are both on by default (even if not set from the language server side). I think it makes sense to be able to set these, especially on older machines where I try to get more performance out of turning off features.

jcs090218 commented 3 months ago

One small warning:

lsp-html.el:191:2: Warning: docstring wider than 80 characters
themkat commented 3 months ago

One small warning:

lsp-html.el:191:2: Warning: docstring wider than 80 characters

Fixed it in latest commit 🙂

jcs090218 commented 3 months ago

Thank you!