Installed VSCode plugin but still not able to catch deno syntax
See original GitHub issueFollowing the tutorial in the docs:
const res = await fetch("https://jsonplaceholder.typicode.com/todos/1");
const body = new Uint8Array(await res.arrayBuffer());
await Deno.stdout.write(body);
I still get underline on the await:
'await' expressions are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.ts(1375)
And underline on the Deno
Cannot find name 'Deno'.ts(2304)
while if I run the file with deno, it obv runs. But vscode underlines are very irritating as well as it is not giving any type suggestions for Deno
object.
I installed the plugin Deno 1.32.0
by justjavac. I tried doing [command]+[p] and > Enable Deno
, which says deno is already enabled.
I tried to find any similar issue but seems it’s not there while my issue is very basic regarding installation. I went through Readme but not able to solve the problem. Can you please help me what more I need to do to get it working?
Issue Analytics
- State:
- Created 3 years ago
- Comments:22 (5 by maintainers)
Top Results From Across the Web
Using Visual Studio Code | Manual - Deno
The most direct way to do this is to use the Deno: Initialize Workspace Configuration from the vscode command palette. This will activate...
Read more >Deno: VS Code typescript doesnt know ES6 - Stack Overflow
I am building an app with deno and typescript. As my IDE I'm using VS Code. When I'm trying to use modern javascript...
Read more >Configure & use Deno's VSCode extension | The JS runtimes
The first step is to install the extension from VSCode marketplace. Open the extensions tab and search for deno: Installation of the extension...
Read more >Language Server Extension Guide - Visual Studio Code
Language Server is a special kind of Visual Studio Code extension that powers the editing ... and any LSP-compliant code editors can easily...
Read more >Getting Started - ESBuild
#Install esbuild. First, download and install the esbuild command locally. A prebuilt native executable can be installed using npm (which is automatically ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have this same issue in VS Code. I can see ‘Deno 1.0.2’ on the status bar, and other Deno syntax (such as import, await) seems to work (VS Code doesn’t report problems on them, only on the Deno name so far).
I got the same phenomenal in which Deno code suggestion and autocompletion did not work after installing
denoland
’s vscode_deno. After trying around I found the following steps help VS Code understands Deno - though this isn’t a configuration recommended by the plugin’s official documentationCreate a directory named
.vscode
and then create asettings.json
file inside that directory. Put the following JSON config in that fileyour-project-workspace/.vscode/settings.json
Open VS Code Settings
File > Preferences > Settings
(orCtr + ,
on Windows /Cmd + ,
on macOS). Searchdeno
, then selectExtensions > Deno
fron the search result filter.Check the
Controls whether Deno is enabled or not
to enable Deno like the above image capture.Restart VS Code, and hopefully Deno suggestion and autocompletion will work