Skip to content

Quick fix component imports #1189

@techniq

Description

@techniq

Describe the bug
Currently if you have a component missing it's import, there is no way to add it via Quick Fix (Command + ., light bulb, or hover => Quick Fix...)

CleanShot 2021-10-01 at 07 53 43@2x

CleanShot 2021-10-01 at 07 53 57@2x

CleanShot 2021-10-01 at 07 55 41@2x

The import suggestion does show up during auto complete suggestion (i.e. while you have a partial bit of the component name typed)

CleanShot 2021-10-01 at 07 52 44@2x

CleanShot 2021-10-01 at 07 53 10@2x

This doesn't work great when copy/pasting components between files, or if you miss the autocomplete initially.

A current workaround I use is to remove the last character of the component name so the autocomplete suggestion kicks in. Not optimal, and a little slower especially when you bring in a big block with many references.

To Reproduce
Add a component without an import and attempt to resolve using one of the Quick Fix methods.

Expected behavior
The ability to add an import via Quick Fix (similarly to autocomplete's "auto import ...").

System:

  • OS: MacOS
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode

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