Skip to content

Duplicate import path completions when multiple root directories are present #57368

@PhoebeSzmucer

Description

@PhoebeSzmucer

🔎 Search Terms

autocomplete, duplicate suggestions, duplicate imports, root dirs

🕗 Version & Regression Information

💻 Code

When rootDirs are src/ and build/dts, and the directory structure is following:

app/
  src/
    index.ts
    dir/
      a.module.scss
  build/
    dts/
      index.d.ts
      dir/
        a.module.scss.d.ts

🙁 Actual behavior

Import completions when invoked from index.ts (using import {} from "./) have a duplicate entry for dir

Screenshot 2024-02-10 at 21 42 14

🙂 Expected behavior

Only a single entry for dir is present.

Additional information about the issue

The bug occurs because when we're combining completions from the point of view of each root dir, we're not deduplicating the entries.

This issue has existed for a long time, but it was made more obvious after #55233 fixed a related bug.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editor

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions