AutoHotkey Plus 项目使用教程

AutoHotkey Plus 项目使用教程

autohotkey-plusAutoHotkey language support for Visual Studio Code项目地址:https://gitcode.com/gh_mirrors/au/autohotkey-plus

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

AutoHotkey Plus 项目的目录结构如下:

autohotkey-plus/
├── .github/
│   └── workflows/
├── src/
│   ├── commands/
│   ├── debug/
│   ├── language/
│   ├── test/
│   └── utils/
├── .gitignore
├── .vscodeignore
├── CHANGELOG.md
├── LICENSE
├── package.json
├── README.md
├── tsconfig.json
└── webpack.config.js

目录结构介绍

  • .github/workflows: 存放 GitHub Actions 的工作流配置文件。
  • src/: 项目的源代码目录,包含命令、调试、语言支持、测试和工具类等模块。
  • .gitignore: Git 忽略文件列表。
  • .vscodeignore: VS Code 扩展打包时忽略的文件列表。
  • CHANGELOG.md: 项目更新日志。
  • LICENSE: 项目许可证。
  • package.json: 项目的 npm 配置文件,包含依赖、脚本和扩展信息。
  • README.md: 项目说明文档。
  • tsconfig.json: TypeScript 配置文件。
  • webpack.config.js: Webpack 打包配置文件。

2. 项目的启动文件介绍

项目的启动文件主要是 src/extension.ts,它是 VS Code 扩展的入口文件。该文件负责初始化扩展并注册各种命令和功能。

import * as vscode from 'vscode';
import { registerCommands } from './commands';
import { registerDebug } from './debug';
import { registerLanguageFeatures } from './language';

export function activate(context: vscode.ExtensionContext) {
    registerCommands(context);
    registerDebug(context);
    registerLanguageFeatures(context);
}

export function deactivate() {}

启动文件介绍

  • activate: 扩展激活时调用的函数,注册命令、调试和语言特性。
  • deactivate: 扩展停用时调用的函数,目前为空。

3. 项目的配置文件介绍

项目的配置文件主要是 package.json,它包含了扩展的所有配置信息,包括名称、版本、描述、依赖、命令等。

{
    "name": "vscode-autohotkey-plus",
    "displayName": "AutoHotkey Plus",
    "version": "2.0.0",
    "description": "AutoHotkey language support for Visual Studio Code",
    "publisher": "cweijan",
    "engines": {
        "vscode": "^1.40.0"
    },
    "categories": [
        "Programming Languages"
    ],
    "activationEvents": [
        "onLanguage:autohotkey"
    ],
    "main": "./out/extension.js",
    "contributes": {
        "languages": [{
            "id": "autohotkey",
            "aliases": ["AutoHotkey", "ahk"],
            "extensions": [".ahk"],
            "configuration": "./language-configuration.json"
        }],
        "grammars": [{
            "language": "autohotkey",
            "scopeName": "source.ahk",
            "path": "./syntaxes/autohotkey.tmLanguage.json"
        }]
    },
    "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"
    },
    "devDependencies": {
        "typescript": "^3.3.1",
        "vscode": "^1.1.28",
        "tslint": "^5.12.1",
        "@types/node": "^10.12.21",
        "@types/mocha": "^2.2.42"
    }
}

配置文件介绍

  • name: 扩展的名称。
  • displayName: 扩展的显示名称。
  • version: 扩展的版本号。

autohotkey-plusAutoHotkey language support for Visual Studio Code项目地址:https://gitcode.com/gh_mirrors/au/autohotkey-plus

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

穆灏璞Renata

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

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

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

打赏作者

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

抵扣说明:

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

余额充值