Skip to content

Autocomplete of package name starting with "@" produces double @ #1226

@dimfeld

Description

@dimfeld

Describe the bug
When performing import statement autocomplete on a namespaced package name (i.e. one starting with @) the completed package name ends up with a double @. This only happens in Svelte files, not in JS/TS files.

To Reproduce
Steps to reproduce the behavior:

  1. Create a project with a namespaced package dependency. SvelteKit works well here since it includes @sveltejs/kit.
  2. Open a Svelte file and type import * as p from '@.
  3. Select @sveltejs/kit or any other namespaced package and accept the suggestion.
  4. Notice that the final line is import * as kit from '@@sveltejs/kit' with the @ doubled up.

This feels like an issue of the @ character just not being treated as part of the "existing text" in the autocomplete.

Expected behavior
Just a single @ character in the package name.

System (please complete the following information):

MacOS 12.01 on M1, VS Code 1.61.2, Svelte for VS Code 105.5.0

But the versions don't matter much. I first noticed this in Neovim on Ubuntu Linux with coc.nvim/coc-svelte a few months ago and assumed it was just a Vim problem until I tried to reproduce it in VSCode today and saw it happens there too.

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