Deno IntelliSense on Visual Studio Code
You have to install the official Deno VSCode plugin to get the autocomplete feature for Deno. Then you have to enable the plugin for your project. This plugin also removes async/await
and .ts
extension errors for Deno projects.
Let me explain in more detail step by step.
Deno snippets for VS Code
First, install the official Deno beta extension.
Then open your project folder and create a folder called .vscode
in your project directory if it doesn't exist. Also create settings.json
file in .vscode
folder.
Next, open the settings.json
file and add the JSON text from below.
{
"deno.enable": true
}
Check the screenshot below to verify that if you did everything correctly.
You might be wondering why to use settings.json
in the project folder. Well, enabling Deno in your global config will enable Deno for your other Typescript projects which is you don't want to. Also, code completion for Deno doesn't work with the global configuration.
Alright, Now create index.ts
file to check if the plugin is working fine like the official plugin gif below, If not then try reloading the VSCode window.
Conclusion
When I first installed that extension, IntelliSense was not working for me. Then I realized I missed a step from the documentation. I just explained in more detail what the docs said and that's all.
Well, Good Luck With Deno!