• Stars
    star
    1,468
  • Rank 32,033 (Top 0.7 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Visual Studio Code plugin for Deno

Deno for Visual Studio Code

GitHub Workflow Status

Visual Studio Marketplace Version Visual Studio Marketplace Installs Visual Studio Marketplace Downloads Visual Studio Marketplace Rating (Stars)

This extension adds support for using Deno with Visual Studio Code, powered by the Deno language server.

⚠ī¸ Important: You need to have a version of Deno CLI installed (v1.13.0 or later). The extension requires the executable and by default will use the environment path. You can explicitly set the path to the executable in Visual Studio Code Settings for deno.path.

Check here for instructions on how to install the Deno CLI.

Basic Usage of the Extension

Features

  • Type checking for JavaScript and TypeScript, including quick fixes, hover cards, intellisense, and more.
  • Integrates with the version of the Deno CLI you have installed, ensuring there is alignment between your editor and the Deno CLI.
  • Resolution of modules in line with Deno CLI's module resolution strategy allows caching of remote modules in Deno CLI's cache.
  • Integration to Deno CLI's linting functionality, including inline diagnostics and hover cards.
  • Integration to Deno CLI's formatting functionality.
  • Allow specifying of import maps and TypeScript configuration files that are used with the Deno CLI.
  • Auto completion for imports.
  • Workspace folder configuration.
  • Testing Code Lens.
  • Provides Tasks for the Deno CLI.

Usage

  1. Install the Deno CLI.
  2. Install this extension.
  3. Ensure deno is available in the environment path, or set its path via the deno.path setting in VSCode.
  4. Open the VS Code command palette with Ctrl+Shift+P, and run the Deno: Initialize Workspace Configuration command.

We recognize that not every TypeScript/JavaScript project that you might work on in VSCode uses Deno — therefore, by default, this extension will only apply the Deno language server when the setting deno.enable is set to true. This can be done via editing the settings or using the command Deno: Initialize Workspace Configuration.

While you can enable Deno globally, you probably only want to do that if every JavaScript/TypeScript workspace you work on in VSCode is a Deno based one.

Commands

The extension provides several commands:

  • Deno: Cache - instructs Deno to fetch and cache all the dependencies of the current file open in the editor. This is similar to doing deno cache on the command line. Deno will not automatically fetch and cache remote dependencies.

    ℹī¸   If there are missing dependencies in a module, the extension will provide a quick fix to fetch and cache those dependencies, which invokes this command for you.

  • Deno: Initialize Workspace Configuration - will enabled Deno on the current workspace and allow you to choose to enable linting and Deno unstable API options.

  • Deno: Language Server Status - displays a page of information about the status of the Deno Language Server. Useful when submitting a bug about the extension or the language server.

  • Deno: Reload Import Registries Cache - reload any cached responses from the configured import registries.

  • Deno: Welcome - displays the information document that appears when the extension is first installed.

Formatting

The extension provides formatting capabilities for JavaScript, TypeScript, JSX, TSX, JSON and markdown documents. When choosing to format a document or setting up a default formatter for these type of files, the extension should be listed as an option.

When configuring a formatter, you use the extension name, which in the case of this extension is denoland.vscode-deno. For example, to configure Deno to format your TypeScript files automatically on saving, you might set your settings.json in the workspace like this:

{
  "deno.enable": true,
  "deno.lint": true,
  "editor.formatOnSave": true,
  "[typescript]": { "editor.defaultFormatter": "denoland.vscode-deno" }
}

Or if you wanted to have Deno be your default formatter overall:

{
  "deno.enable": true,
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "denoland.vscode-deno"
}

The formatter will respect the settings in your Deno configuration file, which can be explicitly set via deno.config or automatically detected in the workspace. You can find more information about formatter settings at Deno Tools - Formatter.

ℹī¸   It does not currently provide format-on-paste or format-on-type capabilities.

Configuration

You can control the settings for this extension through your VS Code settings page. You can open the settings page using the Ctrl+, keyboard shortcut. The extension has the following configuration options:

  • deno.enable: Controls if the Deno Language Server is enabled. When enabled, the extension will disable the built-in VSCode JavaScript and TypeScript language services, and will use the Deno Language Server (deno lsp) instead. boolean, default false
  • deno.enablePaths: Controls if the Deno Language Server is enabled for only specific paths of the workspace folder. Defaults to an empty list.
  • deno.path: A path to the deno executable. If unset, the extension will use the environment path to resolve the deno executable. If set, the extension will use the supplied path. The path should include the executable name (e.g. /usr/bin/deno, C:\Program Files\deno\deno.exe).
  • deno.cache: Controls the location of the cache (DENO_DIR) for the Deno language server. This is similar to setting the DENO_DIR environment variable on the command line.
  • deno.cacheOnSave: Controls if the extension should cache the active document's dependencies on save.
  • deno.codeLens.implementations: Enables or disables the display of code lens information for implementations for items in the code. boolean, default false
  • deno.codeLens.references: Enables or disables the display of code lens information for references of items in the code. boolean, default false
  • deno.codeLens.referencesAllFunctions: Enables or disables the display of code lens information for all functions in the code. Requires deno.codeLens.references to be enabled as well. boolean, default false
  • deno.codeLens.test: Enables or disables the display of test code lens on Deno tests. boolean, default false. This feature is deprecated, see deno.testing below
  • deno.codeLens.testArgs: Provides additional arguments that should be set when invoking the Deno CLI test from a code lens. array of strings, default [ "--allow-all" ].
  • deno.config: The file path to a configuration file. This is the equivalent to using --config on the command line. The path can be either be relative to the workspace, or an absolute path. It is recommended you name this file either deno.json or deno.jsonc. string, default null, examples: ./deno.jsonc, /path/to/deno.jsonc, C:\path\to\deno.jsonc
  • deno.documentPreloadLimit: Maximum number of file system entries to traverse when finding scripts to preload into TypeScript on startup. Set this to 0 to disable document preloading.
  • deno.importMap: The file path to an import map. This is the equivalent to using --import-map on the command line. Import maps provide a way to "relocate" modules based on their specifiers. The path can either be relative to the workspace, or an absolute path. string, default null, examples: ./import_map.json, /path/to/import_map.json, C:\path\to\import_map.json
  • deno.inlayHints.enumMemberValues.enabled - Enable/disable inlay hints for enum values.
  • deno.inlayHints.functionLikeReturnTypes.enabled - Enable/disable inlay hints for implicit function return types.
  • deno.inlayHints.parameterNames.enabled - Enable/disable inlay hints for parameter names. Values can be "none", "literals", "all".
  • deno.inlayHints.parameterNames.suppressWhenArgumentMatchesName - Do not display an inlay hint when the argument name matches the parameter.
  • deno.inlayHints.parameterTypes.enabled - Enable/disable inlay hints for implicit parameter types.
  • deno.inlayHints.propertyDeclarationTypes.enabled - Enable/disable inlay hints for implicit property declarations.
  • deno.inlayHints.variableTypes.enabled - Enable/disable inlay hints for implicit variable types.
  • deno.inlayHints.variableTypes.suppressWhenTypeMatchesName - Suppress type hints where the variable name matches the implicit type.
  • deno.internalDebug: If enabled the Deno Language Server will log additional internal diagnostic information.
  • deno.lint: Controls if linting information will be provided by the Deno Language Server. boolean, default true
  • deno.maxTsServerMemory: Maximum amount of memory the TypeScript isolate can use. Defaults to 3072 (3GB).
  • deno.suggest.imports.hosts: A map of domain hosts (origins) that are used for suggesting import auto completions. (See: ImportCompletions for more information.)
  • deno.testing.args: Arguments to use when running tests via the Test Explorer. Defaults to [ \"--allow-all\" ].
  • deno.testing.enable: Enable the testing API for the language server. When folder is Deno enabled, tests will be available in the Test Explorer view. Defaults to true.
  • deno.unstable: Controls if code will be type checked with Deno's unstable APIs. This is the equivalent to using --unstable on the command line. boolean, default false

Contribute

Learn how to setup & contribute to this project

Thanks

This project was inspired by justjavac/vscode-deno and axetroy/vscode-deno. Thanks for their contributions.

License

The MIT License

More Repositories

1

deno

A modern runtime for JavaScript and TypeScript.
Rust
93,907
star
2

fresh

The next-gen web framework.
TypeScript
12,234
star
3

rusty_v8

Rust bindings for the V8 JavaScript engine
Rust
3,094
star
4

deno_std

Deno standard library
TypeScript
2,705
star
5

deno_lint

Blazing fast linter for JavaScript and TypeScript written in Rust
Rust
1,514
star
6

dnt

Deno to npm package build tool.
Rust
1,211
star
7

saaskit

A modern SaaS template built on Fresh.
TypeScript
1,195
star
8

dotland

[Archived] deno.land website
TypeScript
958
star
9

deno_install

Deno Binary Installer
PowerShell
945
star
10

deno_docker

Latest dockerfiles and images for Deno - alpine, centos, debian, ubuntu
Dockerfile
876
star
11

fastwebsockets

A fast RFC6455 WebSocket implementation
Rust
837
star
12

deno-lambda

A deno runtime for AWS Lambda. Deploy deno via docker, SAM, serverless, or bundle it yourself.
TypeScript
836
star
13

deno_blog

Minimal boilerplate blogging.
TypeScript
459
star
14

denokv

A self-hosted backend for Deno KV
TypeScript
456
star
15

deployctl

Command line tool for Deno Deploy
TypeScript
331
star
16

showcase_chat

TypeScript
302
star
17

roll-your-own-javascript-runtime

Rust
298
star
18

merch

The Deno shop!
TypeScript
283
star
19

deno_bindgen

Write high-level Deno FFI libraries in Rust.
Rust
275
star
20

wasmbuild

Build tool to use Rust code in Deno and the browser.
TypeScript
263
star
21

deno_core

The core engine at the heart of Deno
Rust
262
star
22

deno_doc

Documentation generator for Deno
Rust
251
star
23

setup-deno

Set up your GitHub Actions workflow with a specific version of Deno
JavaScript
248
star
24

meet-me

A calendly clone in Deno and hosted on Deno Deploy
TypeScript
245
star
25

deno_kv_oauth

High-level OAuth 2.0 powered by Deno KV.
TypeScript
245
star
26

eszip

A compact file format to losslessly serialize an ECMAScript module graph into a single file
Rust
220
star
27

deno-gfm

Server-side GitHub Flavored Markdown rendering for Deno
TypeScript
220
star
28

deno_emit

Transpile and bundle JavaScript and TypeScript under Deno and Deno Deploy
TypeScript
217
star
29

webgpu-examples

TypeScript
214
star
30

doc_website

Archived. New version at https://github.com/denoland/docland
TypeScript
195
star
31

manual

Deprecated - find these resources on docs.deno.com instead
TypeScript
162
star
32

node_shims

npm packages providing shims for the Deno namespace and other globals. Useful for running Deno-first programs on Node.
TypeScript
149
star
33

deno_ast

Source text parsing, lexing, and AST related functionality for Deno
Rust
148
star
34

denobyexample

[Archived] Deno by example - short examples showcasing how to use Deno. Now the examples have been moved to https://github.com/denoland/deno-docs / https://docs.deno.com/examples
TypeScript
146
star
35

fresh_charts

A server-side-rendered charting library for Fresh
TypeScript
136
star
36

deploy_examples

Examples for Deno Deploy
TypeScript
125
star
37

docland

The documentation generation website for Deno
TypeScript
120
star
38

deno_graph

The module graph logic for Deno CLI
Rust
111
star
39

deno_task_shell

Cross-platform shell for deno task.
Rust
104
star
40

deno_registry2

The backend for the deno.land/x service
TypeScript
92
star
41

showcase_todo

Collaborative todo-list app built with Deno and Fresh
TypeScript
82
star
42

deno_third_party

TypeScript
78
star
43

monch

Inspired by nom, but specifically for strings.
Rust
77
star
44

examples

A simple todo app using Deno and React.
TypeScript
77
star
45

tic-tac-toe

A global, real-time multiplayer TicTacToe game for Deno đŸĻ•
TypeScript
75
star
46

deploy_feedback

For reporting issues with Deno Deploy
74
star
47

deno-astro-adapter

A Deno adapter for running Astro applications on the Deno runtime.
TypeScript
67
star
48

pixelpage

Pixel page is an r/place style shared pixel art canvas 🎨đŸĻ•
TypeScript
64
star
49

v8

floating patches for rusty_v8
TypeScript
60
star
50

rust-urlpattern

Rust implementation of the `URLPattern` web API
Rust
58
star
51

docs

Deno documentation, examples and API Reference. Powered by Lume.
TypeScript
57
star
52

fresh-wordpress-themes

https://wp-blog-example.deno.dev/ https://wp-sweets-co.deno.dev/
TypeScript
53
star
53

apiland

The API server for deno.land
TypeScript
52
star
54

deno-astro-template

Template repo for an Astro site, preconfigured to run with Deno and Deno Deploy
Astro
49
star
55

sui

Embed custom RO data into precompiled executables
Rust
47
star
56

wanted_modules

Is there a missing deno module that is preventing you from building something? Let us know here.
46
star
57

cargo_gn

Cargo GN integration
Rust
40
star
58

wasmbuild_example

Example of using wasmbuild.
JavaScript
38
star
59

deno_cache_dir

Deno CLI's module cache
Rust
38
star
60

ga

Utilities for server side processing of Google Analytics in Deno CLI and Deploy
TypeScript
38
star
61

serde_v8

Moved to https://github.com/denoland/deno
Rust
36
star
62

import_map

An implementation of WICG Import Maps specification
Rust
30
star
63

flaky_test

atttribute macro for running a flaky test multiple times
Rust
30
star
64

chromium_build

Deno floats patches to //build here (they will be sent upstream eventually)
Python
29
star
65

fresh-blog-example

An example for building a blog with Fresh.
TypeScript
28
star
66

libffi-rs

Fork of libffi-rs which corrects autotools usage
C
22
star
67

deno_npm

npm registry client and dependency resolver used in the Deno CLI.
Rust
22
star
68

deno-sveltekit-template

A starter template for running SvelteKit on Deno Deploy
JavaScript
22
star
69

chatspace

Real-time, collaborative GPT frontend built with Deno KV
TypeScript
22
star
70

doc_components

A set of components for rendering deno_doc doc nodes
TypeScript
21
star
71

rustls-tokio-stream

AsyncRead/AsyncWrite interface for rustls-on-Tokio
Rust
21
star
72

subhosting_ide_starter

Basic starter app for a browser-based IDE using the Deno Subhosting API
JavaScript
21
star
73

deno-vue-example

An example of using Vue with Deno.
Vue
20
star
74

terraform-deploy-provider

Terraform provider for Deno Deploy
Go
20
star
75

deploy_lume_example

An example demonstrating using static site generators on Deno Deploy
TypeScript
20
star
76

monaco-nextjs-demo

A demo Next.js app that features an in-browser IDE built with Monaco.
JavaScript
20
star
77

image-resizing-api

A simple image resizing API written in Deno.
TypeScript
19
star
78

kv_api

WORK IN PROGRESS: Attach a flexible REST API to your Deno web app to manage data in Deno KV
TypeScript
19
star
79

deno-kv-hackathon

Rules, details, and place to submit your project for the Deno KV hackathon.
18
star
80

automation

Automation scripts used for denoland org repos
TypeScript
17
star
81

react18-with-deno

A starter app and tutorial with React18 and Deno.
TypeScript
17
star
82

chromium_buildtools

forked from chromium to use git submodules instead of gclient
Python
17
star
83

benchmark_data

TypeScript
16
star
84

terraform-provider-deno

Terraform provider for hosted Deno APIs
Go
15
star
85

deno-nuxt-template

A template repo for a Nuxt project preconfigured for Deno Deploy
TypeScript
14
star
86

fresh-deno-kv-oauth-demo

Fresh + Deno KV OAuth demo
TypeScript
14
star
87

x-to-jsr

TypeScript
14
star
88

serverless-coldstart-benchmarks

Configuration, benchmarking scripts, and raw data for serverless cold start benchmarks.
Jupyter Notebook
14
star
89

icu

For floating patches on top of https://chromium.googlesource.com/chromium/deps/icu.git
C++
12
star
90

fresh_template

template repository for a Fresh project
12
star
91

deno-vite-plugin

Vite plugin to enable Deno resolution inside vite.
TypeScript
12
star
92

experimental-deno-specifiers-example

TypeScript
12
star
93

deno_lockfile

Rust
12
star
94

fresh-auth-example

TypeScript
11
star
95

deno_config

Rust
11
star
96

deno_media_type

Media type used in Deno.
Rust
11
star
97

notebook

TypeScript
10
star
98

nextgen-install

HCL
10
star
99

v8_valueserializer

A Rust implementation of V8's ValueSerializer and ValueDeserializer
Rust
10
star
100

website_feedback

For reporting issues & suggestions for deno.com and deno.land
9
star