Skip to content
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

The JSDoc descriptions for slot props is not parsed correctly #61

Closed
alexprey opened this issue Feb 13, 2021 · 1 comment · Fixed by #63
Closed

The JSDoc descriptions for slot props is not parsed correctly #61

alexprey opened this issue Feb 13, 2021 · 1 comment · Fixed by #63
Assignees
Labels
breaking bug Something isn't working enhancement New feature or request Svelte V3 Issue related to Svelte V3 components
Milestone

Comments

@alexprey
Copy link
Collaborator

alexprey commented Feb 13, 2021

Look at the following examples:

{#each items as item}
        <!-- 
            Render the one item markup based on data passed in slot property.
            @param {GenericListItem} prop The item of the list that should be rendered.
         -->
        <slot prop={item}></slot>
{/each}

In output for slot property we have only name, but ignore any description and type reading for that.

Actual output

            "parameters": [
                {
                    "name": "prop",
                    "visibility": "public"
                }
            ]

Expected output

            "parameters": [
                {
                    "name": "prop",
                    "description": "The item of the list that should be rendered.",
                    "type": {
                        "kind": "type",
                        "type": "GenericListItem"
                    },
                    "visibility": "public"
                }
            ]

Techinical details

Changes for this fix corelated with #47 issue. The issue #47 already has changes that will be merged soon, please start fix from branching on following commit: 9a7bfc4

@alexprey alexprey added bug Something isn't working enhancement New feature or request Svelte V3 Issue related to Svelte V3 components labels Feb 13, 2021
@alexprey alexprey added this to the 4.0.0 milestone Feb 13, 2021
@alexprey alexprey self-assigned this Feb 19, 2021
@alexprey
Copy link
Collaborator Author

After check the typings file, I found that it has wrong specification of slot parameters. So, it should be reworked. Thats why I mark this issue with braking label.

How it now:

export interface IScopedCommentItem {
    description?: string | null;
    visibility?: JSVisibilityScope;
    keywords?: JSDocKeyword[];
}
export interface ISvelteItem extends IScopedCommentItem {
    name: string;
    locations?: SourceLocation[];
}
export interface SvelteSlotParameter extends ISvelteItem {}

But should be like following structure:

export interface SvelteSlotParameter {
    name: string;
    type: JSDocType;
    description?: string;
    locations?: SourceLocation[];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking bug Something isn't working enhancement New feature or request Svelte V3 Issue related to Svelte V3 components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant