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

LSP: auto import doesn't work correctly with project-root-for-absolute-imports mapping #23870

Open
guy-borderless opened this issue May 17, 2024 · 1 comment

Comments

@guy-borderless
Copy link

guy-borderless commented May 17, 2024

Version: Deno 1.43.4 (but occurs with older versions too)
If the project root is mapped for absolute imports with

{
  "imports": {
    "/": "./",
    "./": "./"
  }
}

The LSP incorrectly auto-imports from files in subdirectories.
Here is an example repo

The LSP imports from a non-existent path
import { ImportFn } from "./importme.ts";
Instead of
import { ImportFn } from "/importme.ts";

image
1716212539

@guy-borderless
Copy link
Author

guy-borderless commented May 19, 2024

Ideally, I'd like both paths (relative ../ and remapped /) to be suggested. The preference for a relative or absolute import is dependent on the project's structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant