Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide better displays for paths when not fully resolved #45494

Open
DanielRosenwasser opened this issue Aug 18, 2021 · 0 comments
Open

Provide better displays for paths when not fully resolved #45494

DanielRosenwasser opened this issue Aug 18, 2021 · 0 comments
Labels
Domain: Auto-import Domain: Completion Lists The issue relates to showing completion lists in an editor In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

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.

@DanielRosenwasser DanielRosenwasser added Suggestion An idea for TypeScript In Discussion Not yet reached consensus Domain: Completion Lists The issue relates to showing completion lists in an editor Domain: Auto-import labels Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Auto-import Domain: Completion Lists The issue relates to showing completion lists in an editor In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant