Skip to content

VSCode does not display correct types inside a .d.ts + .js project. #1353

@brasswood

Description

@brasswood

Describe the bug
VSCode does not display the correct types inside a .d.ts + .js project.

To Reproduce

  1. Create a new deno project
  2. Open it in VSCode
  3. Replace all files in it with the following files:

deno.json:

{
  "tasks": {
    "dev": "deno run --watch main.ts"
  },
  "imports": {
    "@std/assert": "jsr:@std/assert@1"
  },
  "exports": "./mod.js",
  "compilerOptions": {
    "strict": false,
    "checkJs": true
  }
}

mod.js:

// @ts-self-types="./mod.d.ts"

function fetchData(url, options, method, parseJSON) {}

mod.d.ts:

declare function fetchData(url: URL, options: any, method?: string, parseJSON?: boolean): Promise<any>;

export {
    fetchData
}

Expected behavior
When hovering over fetchData in mod.js, the signature should be

function fetchData(url: URL, options: any, method?: string, parseJSON?: boolean): Promise<any>

Actual behavior
The signature is

function fetchData(url: any, options: any, method: any, parseJSON: any): void

(Maybe this actually is expected behavior, in which case I could call this issue a feature request :))

Screenshots

Image

Versions
vscode: 1.107.1 deno: 2.6.3 typescript: 5.9.2 extension: 3.47.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions