2 Star 3 Fork 2

Axetroy / vscode-deno

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

English | 中文简体

Visual Studio Code Deno extension

GitHub Workflow Status Coverage Status DeepScan grade

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

GitHub code size in bytes GitHub repo size GitHub

添加 Visual Studio Code 对 Deno 的支持.

screenshot

特性:

Deno 的智能提示

Deno Support

模块导入自动补全

Import

支持加载 ES 模块

Import

代码诊断和快速修复

Diagnostics

可选的 Deno 内置的格式化工具

Format

基于 LSP 的 C/S 架构模型

该扩展使用 LSP 分离出 客户端/服务端

这意味着复杂的工作处理将会在服务端运行

扩展不会让你的 Visual Studio Code 变慢

Process

支持 `Import Maps` 的模块导入

import_map

支持外部的类型声明

该扩展支持以下方式加载外部声明的文件

这些方式都被 Deno 支持

  1. 编译注释
// @deno-types="./foo.d.ts"
import * as foo from "./foo.js";

目前它不会在扩展中实现.

  1. 三斜杠引用指令
/// <reference types="https://raw.githubusercontent.com/date-fns/date-fns/master/typings.d.ts" />

import { format } from "https://deno.land/x/date_fns/index.js";

format(new Date(), "yyyy/MM/DD");
  1. X-TypeScript-Types 自定义返回头
import { array } from "https://cdn.pika.dev/fp-ts";

const M = array.getMonoid<number>();
console.log("concat Array", M.concat([1, 2], [2, 3]));
Deno 版本管理的集成

我已经写了一个 Deno 的版本管理工具 github.com/axetroy/dvm

我推荐你使用它进行版本管理

使用方式

  1. Visual Studio Marketplace 下载并启用扩展

  2. 为你的 Deno 项目启用扩展:

    在 Deno 的项目目录中创建文件 .vscode/settings.json:

    // .vscode/settings.json
    {
      "deno.enable": true
    }
  3. Enjoy!

配置

  • deno.enabled - 是否启用扩展. 默认值 false

  • deno.import_map - Import Map 的文件路径. 默认值 null

我们不推荐你在全局配置中配置他们。而应该在项目目录的 .vscode/settings.json 文件中

// .vscode/settings.json
{
  "deno.enable": true,
  "deno.import_map": "./path/to/import_map.json"
}

扩展也提供了 Deno 的格式化工具,通过在 .vscode/settings.json 中设置

// .vscode/settings.json
{
  "[typescript]": {
    "editor.defaultFormatter": "axetroy.vscode-deno"
  },
  "[typescriptreact]": {
    "editor.defaultFormatter": "axetroy.vscode-deno"
  }
}

参与贡献

跟随以下步骤参与贡献,社区的发展需要您的力量

  1. Fork 项目

  2. 克隆到您的电脑中:

    $ git clone https://github.com/your_github_name/vscode-deno.git
    $ cd vscode-deno
    $ yarn # or npm install
  3. 如果你之前已经安装并启用了扩展,请先禁用

  4. 开始调试扩展

    打开 Visual Studio Code, 在侧边栏找到 Run 项后运行 Launch Client 任务

    然后等待 Visual Studio Code 调试器打开新窗口

  5. 试试在 Visual Studio Code 中更新扩展的代码,然后重新运行任务

  6. 最后, 把最新的代码推送到您的分支,然后发起一个 PR

致谢

这个项目最初是 justjavac/vscode-deno 的一个分支, 感谢他们的贡献。

开源许可

The MIT License

The MIT License (MIT) Copyright (c) 2020 axetroy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Visual Studio Code Deno extension 展开 收起
TypeScript 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/axetroy/vscode-deno.git
git@gitee.com:axetroy/vscode-deno.git
axetroy
vscode-deno
vscode-deno
master

搜索帮助