JetBrains / web-types

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

Is there a solution for scenarios where the components are registered by a dedicated file? #63

Closed maxacarvalho closed 1 year ago

maxacarvalho commented 1 year ago

Hi, I'm trying to solve an issue where my Vue components' code-completion won't work if they are not registered within the main.ts file.

Here's the gist of it

In this case, the code-completion works 😄

// main.ts

import { createApp } from "vue";

// component
import Button from "primevue/button";

init();

function init() {
  const app = createApp(App);

  app.component("PrimeButton", Button);
}

In this case, the code-completion does not work 😢

// main.ts

import { createApp } from "vue";

import { registerComponents } from "./registerComponents";

init();

function init() {
  const app = createApp(App);

  registerComponents(app);
}
// registerComponents.ts

import type { App } from "vue";

import Button from "primevue/button";

export function registerComponents(app: App): void {
  app.component("PrimeButton", Button);
}
piotrtomiak commented 1 year ago

@maxacarvalho This is an issue with WebStorm support for Vue. Please file an issue here: https://youtrack.jetbrains.com/issues/WEB