denoland / vscode_deno

Visual Studio Code plugin for Deno
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
MIT License
1.5k stars 146 forks source link

Bug: VSCode LSP doesn't recognize deep types when using `sloppy-imports` #1199

Open Jimdooz opened 4 weeks ago

Jimdooz commented 4 weeks ago

Problem

When using Deno's unstable feature sloppy-imports, VSCode's Language Server Protocol (LSP) fails to properly handle type definitions that are re-exported through intermediary files.

Steps

Project Structure

project/
  ├── deno.json
  └── main.ts
shared/
  ├── mod.ts
  └── type.ts

File Contents

project/deno.json

{
    "unstable": ["sloppy-imports"]
}

project/main.ts

import { ABC } from "../shared/mod.ts"

const _letter: ABC = "";

shared/mod.ts

export type { ABC } from "./type"

shared/type.ts

export type ABC = "A" | "B" | "C"

Expected behavior

Versions