DenoDDeno
Powered by
CCPatriotC
Denoβ€’16mo agoβ€’
9 replies
CCPatriot

auto import in VSCode/Zed (general LSP support for auto importing)

Hi all. I'm working with a fresh Deno project in VSCode and can't seem to get import autocompletes to work. All other LSP functionality seems to be working correctly. I have the following
deno.json
deno.json


{
  "tasks": {
    "dev": "deno run --allow-net main.ts"
  },
  "imports": {
    "@hono/hono": "jsr:@hono/hono@^4.6.10"
  }
}
{
  "tasks": {
    "dev": "deno run --allow-net main.ts"
  },
  "imports": {
    "@hono/hono": "jsr:@hono/hono@^4.6.10"
  }
}


If I try to write out
Hono
Hono
, I don't get any prompt to import from
@hono/hono
@hono/hono
. If I manually add the
import { Hono } from "@hono/hono";
import { Hono } from "@hono/hono";
import, following attemps to write out
Hono
Hono
will at least give me an autocomplete that references the
@hono/hono
@hono/hono
dependency, but nothing will automatically add the import to the file.

For what it's worth, I experience the same issues with the LSP in Zed. I also tested with imports from
jsr:@oak/oak
jsr:@oak/oak
to see if there was something off with Hono specifically, but experienced the same issues there.

It looks like there was some recent work to fix auto-importing specifically for npm libraries, so I'm not sure if perhaps that has impacted things here...

Any support is greatly appreciated. Thanks!
GitHub
Issues Β· denoland/vscode_deno
Visual Studio Code plugin for Deno. Contribute to denoland/vscode_deno development by creating an account on GitHub.
Issues Β· denoland/vscode_deno
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

LSP auto-import in workspaces
JolanJJolan / help
5mo ago
Zed Deno Support
KotkoroidKKotkoroid / help
17mo ago
LSP/VSCode stops working
fro.profesionalFfro.profesional / help
3y ago
Automate Export+Import when using deps.ts pattern in VSCode/LSP
jonJjon / help
2y ago