Skip to content
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

Turn on Deno VSCode for Certain File Pattern #264

Closed
shadowtime2000 opened this issue Nov 28, 2020 · 4 comments
Closed

Turn on Deno VSCode for Certain File Pattern #264

shadowtime2000 opened this issue Nov 28, 2020 · 4 comments

Comments

@shadowtime2000
Copy link

Is your feature request related to a problem? Please describe.

Some projects use denoify to convert NPM packages to Deno modules.

Describe the solution you'd like

It would be great if it was possible to enable the Deno VSCode thing for files that match a certain pattern or something so I don't get a ton of Typescript errors when importing with a .ts file extension with modules ending in .deno.ts.

@lucacasonato
Copy link
Member

This is currently not possible due to limitations in VS Code typescript server. See #196.

It might be possible in the future once we use our own deno lsp. See denoland/deno#8515.

@borekb
Copy link

borekb commented Jan 19, 2021

Is this something this extension can do on its own or does it also need support from the (built-in) TS/JS language server of VSCode?

I'm trying the Canary version of this extension (v3) that utilizes deno lsp already but there are still a lot of errors in our monorepo that mixes Node.js and Deno projects.

@lucacasonato
Copy link
Member

Covered by #314

@borekb
Copy link

borekb commented May 12, 2021

@lucacasonato I'm trying Deno 1.10.1 + extension v3.4.0 right now and I'm not sure if I'm using it right but the experience is not great. Overall, I think that this issue which is about file patterns (vs. workspace folders which #314 uses) is still valid and could be reopened.

First, we don't use multi-root workspaces and are trying to avoid them – they add complexity, things like file picker (cmd-p) or search or the SCM panel are complicated with workspace-related concepts that we simply don't need in a monorepo we work in.

Anyway, I've tried creating this workspace setup just to test things:

.
├── .vscode/
│   └── settings.json         ← our current settings.json
├── nodejs-project-a/
│   └── index.ts
├── nodejs-project-b/
│   └── index.ts
├── deno-scripts/
│   ├── .vscode/
│   │   └── settings.js       ← new one, with `deno.enable = true`
│   └── deno.ts
└── test.code-workspace

This silenced errors in deno.ts but I don't get any autocompletion anyway:

Screen Shot 2021-05-12 at 11 15 36

The Output panel doesn't indicate anything wrong:

Screen Shot 2021-05-12 at 11 17 03

Even if this worked, workspaces have downsides for us as noted above and we'd love to be able to do something like this:

// Plain .vscode/settings.json in our repo root:
{
  "deno.enableForPaths": ["deno-scripts"]
}

(Not a great name, just trying to illustrate the point.)

Would this be possible? Would help us a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants