Godot C 项目在 VSCode 中的使用教程

Godot C# 项目在 VSCode 中的使用教程

godot-csharp-vscodeDebugger and utilities for working with Godot C# projects in VSCode项目地址:https://gitcode.com/gh_mirrors/go/godot-csharp-vscode

1. 项目的目录结构及介绍

godot-csharp-vscode/
├── images/
├── src/
├── thirdparty/
├── typings/
├── .gitignore
├── .gitmodules
├── .vscodeignore
├── CHANGELOG.md
├── LICENSE
├── Makefile
├── README.md
├── format.sh
├── icon.png
├── package.json
├── tsconfig.json
├── tslint.json
├── webpack.config.js
  • images/: 存放项目相关的图片资源。
  • src/: 项目的源代码文件夹。
  • thirdparty/: 第三方库文件夹。
  • typings/: TypeScript 类型定义文件夹。
  • .gitignore: Git 忽略文件配置。
  • .gitmodules: Git 子模块配置。
  • .vscodeignore: VSCode 忽略文件配置。
  • CHANGELOG.md: 项目更新日志。
  • LICENSE: 项目许可证。
  • Makefile: 项目构建文件。
  • README.md: 项目说明文档。
  • format.sh: 格式化脚本。
  • icon.png: 项目图标。
  • package.json: 项目依赖和脚本配置。
  • tsconfig.json: TypeScript 配置文件。
  • tslint.json: TSLint 配置文件。
  • webpack.config.js: Webpack 配置文件。

2. 项目的启动文件介绍

项目的启动文件主要是 package.json 中的 main 字段指定的入口文件。通常情况下,入口文件会定义项目的启动逻辑和依赖加载。

{
  "main": "src/extension.js",
  "scripts": {
    "vscode:prepublish": "npm run compile",
    "compile": "tsc -p ./",
    "watch": "tsc -watch -p ./",
    "postinstall": "node ./node_modules/vscode/bin/install",
    "test": "npm run compile && node ./node_modules/vscode/bin/test"
  }
}
  • main: 指定项目的入口文件为 src/extension.js
  • scripts: 定义了一系列的脚本命令,用于编译、监视、安装和测试项目。

3. 项目的配置文件介绍

tsconfig.json

TypeScript 配置文件,定义了 TypeScript 编译选项。

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "outDir": "out",
    "sourceMap": true,
    "strict": true,
    "esModuleInterop": true
  },
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "node_modules",
    ".vscode-test"
  ]
}
  • compilerOptions: 编译选项,包括模块类型、目标 ECMAScript 版本、输出目录、源映射等。
  • include: 包含的文件或目录。
  • exclude: 排除的文件或目录。

tslint.json

TSLint 配置文件,定义了代码风格和规则。

{
  "defaultSeverity": "error",
  "extends": [
    "tslint:recommended"
  ],
  "jsRules": {},
  "rules": {
    "no-console": false
  },
  "rulesDirectory": []
}
  • defaultSeverity: 默认的严重级别。
  • extends: 继承的规则集。
  • jsRules: JavaScript 规则。
  • rules: 自定义规则。
  • rulesDirectory: 规则目录。

webpack.config.js

Webpack 配置文件,定义了模块打包的规则和选项。

const path = require('path');

module.exports = {
  entry: './src/extension.js',
  output: {
    path: path.resolve(__dirname, 'out'),
    filename: 'extension.js',
    libraryTarget: 'commonjs2'
  },
  externals: {
    vscode: 'commonjs vscode'
  },
 

godot-csharp-vscodeDebugger and utilities for working with Godot C# projects in VSCode项目地址:https://gitcode.com/gh_mirrors/go/godot-csharp-vscode

  • 21
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

史姿若Muriel

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值