denoland / vscode_deno

Visual Studio Code plugin for Deno
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
MIT License
1.48k stars 142 forks source link

tsconfig prompts don't show up if root dir is a workspace member without a deno.json #1180

Open nathanwhit opened 2 hours ago

nathanwhit commented 2 hours ago

Describe the bug We added helper popups in #1166, but they don't seem to trigger if you're in a workspace member with only a package.json

To Reproduce

❯ deno run -A npm:create-next-app@latest
✔ What is your project named? … my-app
✔ Would you like to use TypeScript? … No / Yes
✔ Would you like to use ESLint? … No / Yes
✔ Would you like to use Tailwind CSS? … No / Yes
✔ Would you like to use `src/` directory? … No / Yes
✔ Would you like to use App Router? (recommended) … No / Yes
✔ Would you like to customize the default import alias (@/*)? … No / Yes
❯ echo '{ "workspace": ["./my-app"], "nodeModulesDir": "manual"  }' >> deno.json
❯ deno install
❯ code ./my-app

Note that the deno extension enables by default, but the prompts don't show up. If you create a deno.json in my-app or if you open the workspace root in vscode, they do.

Expected behavior

Prompts appear if in a workspace member, even if it doesn't have a deno.json

nayeemrmn commented 1 hour ago

This is currently intentional, since we assume that the extension won't enable unless there's a deno.json... I think the problem is we're still promoting "deno.enable": true. We should have been phasing out the usage of this setting in favour of deno.json detection.

Edit: I misunderstood the workspace member part

nathanwhit commented 1 hour ago

This is currently intentional, since we assume that the extension won't enable unless there's a deno.json... I think the problem is we're still promoting "deno.enable": true. We should have been phasing out the usage of this setting in favour of deno.json detection.

It enables even without "deno.enable": true because it's part of the workspace, I have

"enable": null,
  "disablePaths": [],
  "enablePaths": null,

in my language server status, but the LSP is enabled (I assume due to being a workspace member)

nathanwhit commented 1 hour ago

I believe the issue is that it's looking for a tsconfig.json next to the deno.json, but since we're in a workspace member without a deno.json (the deno.json is in the parent dir) that condition isn't met