-
Notifications
You must be signed in to change notification settings - Fork 21
[jet-brains-integration] Include source module and symbol in web-types #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import { removeQuoteWrappers } from "../../utilities"; | ||
| import type * as schema from "custom-elements-manifest"; | ||
| import type { CEM, Component } from "./types"; | ||
| import type { CEM, Component, ComponentWithModule } from "./types"; | ||
|
|
||
| export const EXCLUDED_TYPES = [ | ||
| "any", | ||
|
|
@@ -51,17 +51,18 @@ export function getComponentDescription( | |
| export function getComponents( | ||
| customElementsManifest: CEM, | ||
| exclude?: string[] | ||
| ): Component[] { | ||
| ): ComponentWithModule[] { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs to be reverted. |
||
| return ( | ||
| customElementsManifest.modules?.map( | ||
| (mod) => | ||
| mod?.declarations?.filter( | ||
| (dec) => | ||
| !exclude?.includes(dec.name) && | ||
| ((dec as Component).customElement || (dec as Component).tagName) | ||
| ) || [] | ||
| mod?.declarations | ||
| ?.filter( | ||
| (dec) => | ||
| !exclude?.includes(dec.name) && (dec.customElement || dec.tagName) | ||
| ) | ||
| .map((dec) => ({ ...dec, module: mod })) || [] | ||
| ) || [] | ||
| ).flat() as Component[]; | ||
| ).flat(); | ||
| } | ||
| /** | ||
| * Gets a list of public properties from a CEM component | ||
|
|
@@ -111,7 +112,7 @@ export function getComponentMethods( | |
| member.kind === "method" && | ||
| member.privacy !== "private" && | ||
| member.description?.length && | ||
| !member.name.startsWith("#") | ||
| !member.name.startsWith("#") | ||
| ) as schema.ClassMethod[]; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| export * from "./cem-utilities.js"; | ||
| export * from "./description-templates.js"; | ||
| export type { CEM, Component } from "./types.js"; | ||
| export type { CEM, Component, ComponentWithModule } from "./types.js"; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,10 @@ export interface Component extends schema.CustomElementDeclaration { | |
| }; | ||
| } | ||
|
|
||
| export interface ComponentWithModule extends Component { | ||
| module: CustomModule; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is correct. There shouldn't be an array of components in a component.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The addition of the module here is necessary to pass module.path along. But you're right WebTypeElement also needs to be adjusted.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| } | ||
|
|
||
| export interface CustomModule extends schema.JavaScriptModule { | ||
| /** | ||
| * The declarations of a module. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.