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

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

Open
Jimdooz opened this issue Oct 28, 2024 · 0 comments
Open

Comments

@Jimdooz
Copy link

Jimdooz commented Oct 28, 2024

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
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