denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
96.88k stars 5.35k forks source link

regression lsp looks for a node_modules folder incorrectly #24863

Closed sigmaSd closed 2 months ago

sigmaSd commented 2 months ago

deno 1.45.5 (release, x86_64-unknown-linux-gnu)

import "npm:cowsay";
DENO_FUTURE=1 hx a.ts

-> lsp error

Could not find a matching package for ‘npm:cowsay’ in a package. json
file. You must specify this as a package.json dependency when the
node_nodules folder is not managed by Deno.

without DENO_FUTURE set, it works correctly

dsherret commented 2 months ago

I'm not able to reproduce this. Is that the full reproduction steps? Are there any config files in the ancestor directories? In vscode I also had to manually enable the deno extension for the folder because the deno extension doesn't get enabled except with a deno.json file present.

dsherret commented 2 months ago

That said, this looks wrong: https://github.com/denoland/deno/commit/a49d0bd10ba2a4745c291f3f413d97396213e4ec#diff-763c48dc07339b6f9b7800e2024d25f6ecd185d243f46a4416abc55917ccf0fcR446