denoland / deno

A modern runtime for JavaScript and TypeScript.

Home Page:https://deno.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

guy-borderless opened this issue · comments

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

Encountered this as well