You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say we're importing parse from https://deno.land/std/flags/mod.ts.
If we do that at the top of the file with import { parse } from <url>, everything works fine. If I do the parse(Deno.args), and hover over it, I get the correct interface displayed:
If I import it via deno.json, and then just do import { parse } from 'flags', it has the any type.
Just copying the URL to the main TS file instead of the json immediately brings back the type.
Expected:
Always display the proper type information, like it does when importing directly from the URL, without import map.
The text was updated successfully, but these errors were encountered:
Lenni009
changed the title
[bug] type checking doesn't work correctly with deno.json imports
[bug] type display doesn't work correctly with deno.json imports
May 13, 2023
Actually looking at this it seems the flags import is unresolved. So the LSP is probably not detecting the import map. Maybe your deno.json is not in the root directory? If so, that's tracked in #14245 and denoland/vscode_deno#787.
Just tested again, and it worked as expected. Now that you mention it, the import really does look unresolved. I wasn't very experienced back when I opened this issue 😅
Let's say we're importing
parse
from https://deno.land/std/flags/mod.ts.If we do that at the top of the file with
import { parse } from <url>
, everything works fine. If I do theparse(Deno.args)
, and hover over it, I get the correct interface displayed:If I import it via deno.json, and then just do
import { parse } from 'flags'
, it has theany
type.deno.json:
Just copying the URL to the main TS file instead of the json immediately brings back the type.
Expected:
Always display the proper type information, like it does when importing directly from the URL, without import map.
The text was updated successfully, but these errors were encountered: