Skip to content

Quick Fix -> Infer type of... - completes an invalid type code for JSDoc #1628

@lukaszpolowczyk

Description

@lukaszpolowczyk

Describe the bug

This JSDoc code was generated by the quick fix -> Infer type function:

infer.mp4

In js file Infer type prompts correctly:

infer-js.mp4

Is it you that needs/can/should fix it?

Originally posted by @lukaszpolowczyk in #1618 (comment)

As he wrote:

Just a side note unrelated to the root problem. Your JSDoc should be before the export keyword. It only works because of how we transform code behind the scene. And I can't guarantee it won't change in the future. It also doesn't work in a normal js file.

Originally posted by @jasonlyu123 in #1618 (comment)

Reproduction

As per the video.

Expected behaviour

Infer should complete the correct code.

System Info

  • OS: Arch Linux
  • IDE: VSCode

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions