Skip to content

LitElement static property obj declaration #415

@emm88n

Description

@emm88n

there seems to be a proposed implementation on the original repository

problem:
this syntax is not being parsed by the plugin:

// from https://lit.dev/playground/#sample=examples/hello-world
import {html, css, LitElement} from 'lit';

export class SimpleGreeting extends LitElement {
  static styles = css`p { color: blue }`;

  static properties = { // <- it's this syntax, attribute is not detected in syntax completion
    name: {type: String},
  };

  constructor() {
    super();
    this.name = 'Somebody';
  }

  render() {
    return html`<p>Hello, ${this.name}!</p>`;
  }
}
customElements.define('simple-greeting', SimpleGreeting);

i.e. , when I try to a syntax completion for the "name" attribute, plugin doesn't show suggestions. but when I try for syntax completion of ".name" property, plugin works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions