Skip to content

Auto import in module script adds import in component script #927

@ebeloded

Description

@ebeloded

Describe the bug

When trying to use built-in auto import feature inside of module context script, the import line gets added to the component script instead.

To Reproduce

Type readable (or any other importable value) inside of a module script and use suggested auto-import. If a component script block exists, the import will be added there, instead of being added to the module script block.

Note that typescript.suggest.autoImports feature should be set to true (which is default)

Expected behavior

Expected import statement to show up in the script block where suggestion originates.

Screenshots

auto-import-in-module-script.mov

System (please complete the following information):

  • OS: Mac OS
  • 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