Skip to content

Provide better displays for paths when not fully resolved #45494

@DanielRosenwasser

Description

@DanielRosenwasser

In #44713, we started to do partial resolutions of paths for auto-import completions. This is great, however, it would be nice if we could do a small amount of work for common cases just to clean up paths that go through node_modules even without further keystrokes.

  • In cases where the resolution strategy is node and there are no path mappings, we could try to rewrite some number of dotted segments, followed by node_modules into package_name/... until fully resolved.
  • In other cases, we could even just use containingFolderName/filename

Of course, there are risks here since in JS, string math isn't always cheap. In cases where you have hundreds of thousands of auto-imports from node_modules, this could still get expensive.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions