JetBrains / web-types

JSON standard for documenting web component libraries for IDEs, documentation generators and other tools
Apache License 2.0
278 stars 25 forks source link

lit support in inline html`` template literal #64

Closed m4olivei closed 9 months ago

m4olivei commented 1 year ago

I'm not seeing support for lit html, despite appearing to have it here: https://github.com/JetBrains/web-types/tree/master/packages/lit/lit%402.0.0. I'm using PHPStorm 2022.3.1.

Specifically I'm expecting to see auto completion for event attributes (@click for instance) within a typical lit render method, but it's not working, e.g.

import {LitElement, html} from 'lit';
import {customElement} from 'lit/decorators.js';

@customElement('my-element')
class MyComponent extends LitElement {
  // ...
  render() {
    return html`
      <button @click="${() => console.log('hello world'); }">Click me</button>
    `;
  }
}

Is there something I need to do to get this support for my project? I noticed that lit is missing from the registry.json file. Could that be the issue? Why is lit one of the only packages in this monorepo not listed there?

Thanks!

piotrtomiak commented 1 year ago

Hi @m4olivei! To get Lit support in your Node.js project, please install @web-types/lit as a dev dependency, only Vue support is automatically downloaded at this moment. Please note that Lit support is currently very limited.

piotrtomiak commented 9 months ago

I have updated packages/registry.json and lit Web Types will now be automatically downloaded by the IDE.