deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

Import errors in VS Code after switch to workspaces

Open dmitrigrabov opened this issue 1 year ago • 2 comments
trafficstars

Describe the bug

I am seeing import errors in VS Code in latest version of this repo after the move to workspaces. For example

"Relative import path "@std/io/types" not prefixed with / or ./ or ../ and not in import map from "file:///Users/XXX/workspace/deno_std/archive/tar.ts"deno(resolver-error)

I have Deno: future and Deno: unstable enabled.

Steps to Reproduce

  • Open archive/tar.ts in VS Code
  • See all imports from @std/io and @std/assert display above error

Expected behavior

VSCode extension / LSP should resolve import via workspaces value in root deno.json and not display above import error

Environment

  • OS: MacOS 14
  • deno version: 1.43.1
  • std version: 0.224.0

dmitrigrabov avatar May 02 '24 09:05 dmitrigrabov

Does the LSP actually run with the above Deno version (1.43.1)?

What happens if you restart the language server? (via Cmd + Shift + P -> Deno: Restart Language Server)

kt3k avatar May 02 '24 10:05 kt3k

Yep. LSP runs fine. Seeing this in output

Starting Deno language server...
  version: 1.43.1 (release, aarch64-apple-darwin)
  executable: /Users/XXX/.deno/bin/deno
Connected to "Visual Studio Code" 1.88.1
Hit the language server document preload limit of 1000 file system entries. You may want to use the "deno.enablePaths" configuration setting to only have Deno partially enable a workspace or increase the limit via "deno.documentPreloadLimit". In cases where Deno ends up using too much memory, you may want to lower the limit.
Refreshing configuration tree...
  Resolved Deno configuration file: "file:///Users/XXX/workspace/deno_std/archive/deno.json"
  Resolved lockfile: "file:///Users/XXX/workspace/deno_std/archive/deno.lock"
  ...

dmitrigrabov avatar May 02 '24 10:05 dmitrigrabov

This is https://github.com/denoland/deno/issues/22694.

nayeemrmn avatar May 02 '24 13:05 nayeemrmn

Thanks for the pointer, Nayeem. Let's track there. Closing this one

kt3k avatar May 03 '24 01:05 kt3k