Skip to content

Commit

Permalink
feat: add initialize workspace command
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Feb 5, 2021
1 parent abbe84a commit f020eaf
Show file tree
Hide file tree
Showing 15 changed files with 682 additions and 124 deletions.
77 changes: 49 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,42 @@
# Deno for Visual Studio Code

![GitHub Workflow Status](https://img.shields.io/github/workflow/status/denoland/vscode_deno/ci)

![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/denoland.vscode-deno)
![Visual Studio Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/denoland.vscode-deno)
![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/denoland.vscode-deno)
![Visual Studio Marketplace Rating (Stars)](https://img.shields.io/visual-studio-marketplace/stars/denoland.vscode-deno)

<img align="right" src=https://raw.githubusercontent.com/denoland/vscode_deno/main/deno.png height="150px">

This extension adds support for using [Deno](https://deno.land) with Visual
This extension adds support for using [Deno](https://deno.land/) with Visual
Studio Code, powered by `deno lsp`.

> ⚠️ **Important:**
> This branch contains the source code for the upcoming v3 version of the
> extension, powered by `deno lsp`. This version is still in development and is
> currently released on the Visual Studio marketplace as
> [**Deno (Canary)**](https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno-canary).
> The stable release is still v2. You can find the source code for this version
> in the `v2` branch.
> ⚠️ **Important:** You need to have a version of Deno CLI installed (v1.6 or
> later) and available in your path before attempting to use this extension.
> [Check here](https://deno.land/#installation) for instructions on how to
> install the Deno CLI.
## Features

- TypeScript typechecking, quick fixes, hover cards, IntelliSense, and more,
powered by Deno's built-in TypeScript
- `deno lint` integration, with inline diagnostics <!--, quick fixes, and hover cards for lint rules-->
- `deno fmt` code formatting provider
- 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.

## Usage

1. Install the Deno and this extension.
2. Open the VS Code command palette with `Ctrl+Shift+P`, and run the `Deno: Init`
command.
1. Install the Deno CLI, available in your path.
2. Install this extension.
3. Open the VS Code command palette with `Ctrl+Shift+P`, and run the
`Deno Language Server: Initialize Workspace Configuration` command.

## Configuration

Expand All @@ -41,38 +48,52 @@ extension has the following configuration options:
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.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.config`: The file path to a `tsconfig.json` 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.
_string, default `null`, examples: `./tsconfig.json`, `/path/to/tsconfig.json`, `C:\path\to\tsconfig.json`_
- `deno.importMap`: The file path to an import map. This is the equivalent to using
`--import-map` on the command line.
the workspace, or an absolute path. _string, default `null`, examples:
`./tsconfig.json`, `/path/to/tsconfig.json`, `C:\path\to\tsconfig.json`_
- `deno.importMap`: The file path to an import map. This is the equivalent to
using `--import-map` on the command line.
[Import maps](https://deno.land/manual/linking_to_external_code/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.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`_
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.lint`: Controls if linting information will be provided by the Deno
Language Server.
Language Server. _boolean, default `false`_
- `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

We appreciate your help!

To build the extension locally, clone this repository and run the following steps:
To build the extension locally, clone this repository and run the following
steps:

1. Open this folder in VS Code.
2. Run `npm i`.
3. Run `npm run compile`.
4. Run the `Launch Client` launch task from the VSCode debug menu.

Most changes and feature enhancements do not require changes to the extension
though, as most information comes from the Deno Language Server itself, which is
integrated into the Deno CLI. Please check out the
[contribution guidelines](https://github.com/denoland/deno/tree/master/docs/contributing)
for the Deno CLI.

## Thanks

This project was inspired by [justjavac/vscode-deno](https://github.com/justjavac/vscode-deno) and
[axetroy/vscode-deno](https://github.com/axetroy/vscode-deno). Thanks for their contributions.
This project was inspired by
[justjavac/vscode-deno](https://github.com/justjavac/vscode-deno) and
[axetroy/vscode-deno](https://github.com/axetroy/vscode-deno). Thanks for their
contributions.

## License

Expand Down
41 changes: 38 additions & 3 deletions Releases.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
# Releases

Releases of the extension can be downloaded from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno).
Releases of the extension can be downloaded from
[Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno).

### v3.0.0-pre.1 / 2020.11.30
### [canary/0.0.8](https://github.com/denoland/vscode_deno/compare/canary/0.0.7...canary/0.0.8) / 2021.02.01

- feat: code lens for references (#308)
- feat: disable most of builtin language service when deno enabled (#307)

### [canary/0.0.7](https://github.com/denoland/vscode_deno/compare/canary/0.0.6...canary/0.0.7) / 2021.01.24

- feat: add back JSON schema for import maps (#283)
- feat: add deno cache command (#291)
- feat: plugin ignores getImplementation requests when Deno enabled (#302)
- feat: change textDocument/rename to use LSP (#292)
- fix: pass NO_COLOR when starting lsp (#293)

### [canary/0.0.6](https://github.com/denoland/vscode_deno/compare/canary/0.0.5...canary/0.0.6) / 2020.12.13

- fix: include typescript-deno-plugin in vsix (#285)

### [canary/0.0.5](https://github.com/denoland/vscode_deno/compare/canary/0.0.4...canary/0.0.5) / 2020.12.09

- chore: release on canary/* tag

### [canary/0.0.4](https://github.com/denoland/vscode_deno/compare/canary/0.0.3...canary/0.0.4) / 2020.12.09

- chore: disable built in completions (#279)

### [canary/0.0.3](https://github.com/denoland/vscode_deno/compare/v3.0.0-pre.1...canary/0.0.3) / 2020.12.08

- feat: suppresses quick info and document highlights (#266)
- feat: suppress references and definitions (#270)
- feat: extension activates on deno virtual files (#275)
- fix: Update version so it can be published on marketplace (#272)
- fix: plugin settings match language server settings (#276)

### [v3.0.0-pre.1](https://github.com/denoland/vscode_deno/compare/v2.3.3...v3.0.0-pre.1) / 2020.11.30

This is a full rewrite of the extension to use the upcoming `deno lsp` feature.

Expand Down Expand Up @@ -39,7 +73,8 @@ This is a full rewrite of the extension to use the upcoming `deno lsp` feature.
### [v2.2.1](https://github.com/denoland/vscode_deno/compare/v2.2.0...v2.2.1) / 2020.09.09

- fix: remove ansi codes from install output (#185)
- fix: deno.land/x cache will always renew on vscode restart after 24 hours (#191)
- fix: deno.land/x cache will always renew on vscode restart after 24 hours
(#191)
- fix: ignore 'rule' for this line does not work on the first line (#192)
- build: release .vsix artifact during release (#195)

Expand Down
Loading

0 comments on commit f020eaf

Please sign in to comment.