Skip to content

Bug: TS "Infer return type" inserts file specifier #24344

@marvinhagemeister

Description

@marvinhagemeister

When running the Infer function return type command on a function returning JSX we get the file specifier instead of import("preact/jsx-runtime").JSX.Element:

export function Foo(): import("file:///Users/marvinh/Library/Caches/deno/npm/registry.npmjs.org/preact/10.22.0/src/jsx").JSXInternal.Element {
  return <h1>hello world</h1>;
}
deno-infer-type-jsx.mp4

Steps to reproduce

  1. Clone https://github.com/marvinhagemeister/deno-infer-type-repro
  2. Open mod.tsx in vscode
  3. Put the cursor inside the Foo identifier
  4. Run the infer function return type quick fix

Version: Deno 1.44.4

Metadata

Metadata

Assignees

Labels

bugSomething isn't working correctlylsprelated to the language server

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions