-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imports
from deno.json
causing deno(import-prefix-missing)
in multi-root workspaces
#845
Comments
imports
from deno.json
causing deno(import-prefix-missing)
imports
from deno.json
causing deno(import-prefix-missing)
in multi-root workspaces
@KonghaYao The problem are multi-root workspaces. |
Hi @KrofDrakula, Can I check if you performed any special configuration to allow this to work in a single-root workspace? Based on the comment by @KonghaYao, #718, #805, #833, and my own usage, it seems to be broken there as well. |
@jeslinmx No, I just opened a new window (which I guess creates a blank workspace that I don't save) and the Deno project within in as a folder, no special configuration necessary for me. |
Thanks for the report folks. Do you still experience these problems with Deno v1.35? There were several improvements to the import map handling in the LSP and I'm wondering if this problem still persists. |
I'm experiencing these problems with Deno v1.35.0, Deno VSCode Extension v3.19.1. Note I don't see this error when building with Deno v1.35.0 on the command line. I only see the issue in VSCode. |
Experiencing the same issue on Deno v1.35.0. I had it "working" by using |
+1 on this issue. I've got a limited understanding, but perhaps it's worthwhile to consider enabling the For example // workspace/.vscode/projects.code-workspace
{
"folders": [
{
"name": "Workspace",
"path": "../"
},
{
"name": "Project 1",
"path": "../project1"
},
{
"name": "Project 2",
"path": "../project2"
}
],
"settings": {
// Deno
"deno.enable": true,
"deno.enablePaths": ["./project1", "./project2"],
"deno.unstable": true,
"deno.suggest.imports.autoDiscover": true,
"deno.lint": true,
"deno.path": "./.devenv/profile/bin/deno",
// -- This doesn't work today because it can only be specified for a single project --
// "deno.importMap": "./project1/deno.jsonc",
}
} // workspace/project1/.vscode/settings.json
{
"deno.enable": true,
"deno.importPath": "./deno.jsonc" // <----------- ADD SUPPORT FOR THIS
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
} |
Closing in favour of #787. |
To Reproduce
NOTE: This works when opening a deno project in an exclusive VS Code window. Using this in a multi-root project breaks.
After enabling Deno for the workspace, use the following
deno.json
configuration:In a file in the workspace, try importing the bare identifier:
Running this file with Deno works as expected, so the import identifier works.
Expected behavior
Import maps should resolve using the LSP in the editor to match how Deno runs.
Screenshots
Versions
vscode: 1.77.3
deno: 1.33.1
extension: 3.17.0
The text was updated successfully, but these errors were encountered: