vscode_deno icon indicating copy to clipboard operation
vscode_deno copied to clipboard

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

Open Jimdooz opened this issue 1 year ago • 0 comments

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

  • VSCode should recognize the ABC type through the re-export
  • Type checking should flag the empty string assignment as invalid
  • IntelliSense should suggest valid values ("A", "B", "C") image

Versions

  • vscode: 1.94.2
  • deno: v2.0.3
  • extension: v3.42.0

Jimdooz avatar Oct 28 '24 09:10 Jimdooz