denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.77k stars 5.22k forks source link

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

Open guy-borderless opened 3 months ago

guy-borderless commented 3 months ago

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

nik-webdevelop commented 2 months ago

Encountered this as well