Code Monkey home page Code Monkey logo

egret-coder's Introduction

Egret Extension for Visual Studio Code

img

使用 Visual Studio Code 开发白鹭项目


修改(LMZ)

  • 日期: 2023/12/30 5:15:55

    编译完成后,自动删除多出的 @egret 文件夹。 否则以后使用 EgretWing 打开时,编辑不了皮肤文件。(使用白鹭引擎 5.4.1 编译后,会有这种问题。—— 很可能 EgretWing 都过时,都不支持 5.4.1 了。)(因为使用独立的 eui 软件编辑皮肤时,总是卡死。 —— 所以还是使用 EgretWing 编辑皮肤比较稳定。 )

  • 日期: 2023/12/30 5:15:55

    “直接调试,跳过编译” 时,自动使用已有的启动配置(忽略 preLaunchTask)

  • 日期: 2023/12/30 4:05:33

    修复启动调试时,总是端口随机的问题。(并支持使用配置的 url 的指定端口)

  • 日期: 2023/12/30 3:30:28

    新增了 “直接调试,跳过编译” 的按钮和功能

主要功能

  • exml 文件代码编辑功能

    • 语法高亮

    • 自动完成

      img

    • 错误提示功能

      img

    • 常用的代码片段

      img

    • 代码格式化功能

  • Egret UI Editor 的配合

    调用 Egret UI Editor 打开白鹭项目

  • 调用白鹭引擎命令

    调用白鹭引擎的编译 / 清理 / 创建项目等功能

  • 调试功能

    运行并调试白鹭项目


使用方法

  • 激活插件

    此插件只有在以下情况才会激活:

    • Visual Studio Code 当前窗口打开了文件夹
    • 文件夹中包含白鹭�项目的 egretProperties.json 文件

    激活完成后窗口右下角状态栏会出现四个按钮 (依次代表 "启动调试服务器", "编译", "清理", "创建新项目" 功能)

    img

  • 调用 Egret UI Editor 打开项目目录

    在 主菜单 > 查看 > 命令面板 > 选择下图的命令

    img

  • 调用白鹭引擎命令

    在 主菜单 > 查看 > 命令面板 > 选择下图的命令

    img

    或者点击状态栏的对应按钮

  • 调试功能

    • 在 Visual Studio Code 中打开你的白鹭项目文件夹。
    • 项目中会包含有.vscode/Launch.json.vscode/tasks.json两个文件(已有的情况下增量修改,没有的情况下自动创建)。里面分别有Egret WebpackDevServer Debuggeregret: build的配置。
    • 确保./scripts/config.tsbuild命令的配置符合如下内容。其中端口号默认为3000,应当与.vscode/Launch.jsonEgret WebpackDevServer Debuggerurl地址末尾的端口号一致
    const outputDir = '.';
              return {
                  outputDir,
                  commands: [
                      new ExmlPlugin('debug'), // 非 EUI 项目关闭此设置
                      new WebpackDevServerPlugin({ //新的 Webpack 编译器
                          libraryType: "debug",
                          defines: { DEBUG: true, RELEASE: false },
                          typescript: { mode: 'legacy' },
                          // open: true,
                          port: 3000
                      }),
                  ]
              }
    • 在运行面板的列表中选择 Egret WebpackDevServer Debugger

    img

    • 点击开始调试按钮

    • 如果调试启动成功, 会弹出谷歌浏览器环境下白鹭�项目的运行页面, 并开始调试过程

    • 可以在Vscode中进行断点调试。同时浏览器控制台的输出信息会同步显示在调试控制台中

      img

  • exml 文件编辑中打开 emmet 支持

    进入到 Vscode 的设置界面, 查找 Emmet: includeLanguages 这个设置项, 点击它对应的 在 setting.json 中编辑的连接

    img

    在打开的右侧编辑区添加以下设置内容: (表示以 xml 的方式使用 Emmet)

    "emmet.includeLanguages": {
      "exml": "xml"
    }

egret-coder's People

Contributors

zhang-jiayi-0322 avatar etaerc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.