CCPatriot
CCPatriot2w ago

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
{
"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, I don't get any prompt to import from @hono/hono. If I manually add the import { Hono } from "@hono/hono"; import, following attemps to write out Hono will at least give me an autocomplete that references the @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 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.
1 Reply
tenko
tenko3d ago
have the same problem using effect had it since v2.0 was hoping that it would eventually figure itself out still not fixed it could be how i have my vscode setup not sure