Vscode_deno: Allow using default TypeScript tooling for specific dirs/files

Created on 4 Feb 2021  路  8Comments  路  Source: denoland/vscode_deno

To Reproduce

  1. Write some TypeScript code for the client, e.g.:
document.body.appendChild(document.createElement("div"))

Expected behavior

I can write client-side code inside a project where I use Deno, using TypeScript defaults (e.g. using DOM APIs).

One of the great selling points of JS on the server is that it's possible to share client and server code. It makes a lot of sense to develop those in the same repo, but I can't figure out how to get back the normal TypeScript dev experience for my client code folders.

Observed behaviour

VSCode gets cranky if I try to use any DOM APIs.

  • All uses of the DOM API are marked as syntax errors.
  • If I try to write document.body by hand, the editor automatically replaces document with decodeURIComponent after I type the .. 馃槴

In combination with #313, this means I'm constantly cleaning up after the Deno extension. I also lose the regular benefits of TypeScript.

Versions

macOS 10.15.7
VSCode Version: 1.52.1
Deno extension version 2.3.3

deno --version
deno 1.7.1 (release, x86_64-apple-darwin)
v8 8.9.255.3
typescript 4.1.3

enhancement

Most helpful comment

We are aiming for a week or so, but workspace folders aren't part of yet. I will take a look and see how hard they are to implement.

All 8 comments

I totally agree!

We need some kind of include/exclude options for this plugin.

In huge repos, when you wanna add some deno, but you still need to maintain the other typescript code that depends on node_modules, you cannot just enable this plugin, it will turn your project all red.

It's not always convenient to split up the code to different repos with different stacks, plugins etc

We will solve this in the 3.X version of the extension by supporting workspace folders, which allows per-folder vscode settings.

Ref: https://github.com/denoland/deno/issues/8643

We will solve this in the 3.X version of the extension by supporting workspace folders, which allows per-folder vscode settings.

Ref: denoland/deno#8643

馃槏

Is this close to being usable, or should I expect to work around it for a while?

We are aiming for a week or so, but workspace folders aren't part of yet. I will take a look and see how hard they are to implement.

Relates to #297 as well

Relates to #297 as well

Indeed, so it seems!

We are aiming for a week or so, but workspace folders aren't part of yet. I will take a look and see how hard they are to implement.

Any luck on that? :-D

I will take a look and see how hard they are to implement.

Any luck on that? :-D

I looked, they are hard. They are likely to be after import completions.

I will take a look and see how hard they are to implement.

Any luck on that? :-D

I looked, they are hard. They are likely to be after import completions.

馃槩

Thanks for looking into it, though!
I'll keep an eye on this issue, since it's likely to make a big difference in when I can start adopting deno in some of my projects. 鈽猴笍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xXACCEXx picture xXACCEXx  路  6Comments

Ragzouken picture Ragzouken  路  5Comments

trentjones21 picture trentjones21  路  4Comments

justdayan picture justdayan  路  7Comments

Ciantic picture Ciantic  路  10Comments