-
Notifications
You must be signed in to change notification settings - Fork 19
添加代码 #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
添加代码 #513
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
edd7fd0
Update config.ini
2209040022ll 781c341
Update launch.py
2209040022ll 091b0cb
Update config.ini
2209040022ll 1865593
Create hutbthesis_main.tex
2209040022ll 18df0c7
Create chapter01.tex
2209040022ll b3ee313
Create abstract.tex
2209040022ll bf3447b
Create acknowledgements.tex
2209040022ll 49cef00
Delete vsc/content/content directory
2209040022ll f9f37ec
Create acknowledgements.tex
2209040022ll eda7f94
Delete vsc/content/content directory
2209040022ll be23f32
Create acknowledgements.tex
2209040022ll 57383b6
Create latexmkrc
2209040022ll 65c28bd
Create gitignore
2209040022ll e4e7ccf
Merge branch 'OpenHUTB:master' into master
2209040022ll 19e4765
Merge branch 'OpenHUTB:master' into master
2209040022ll a3f3b33
Merge branch 'OpenHUTB:master' into master
2209040022ll 53677f9
Add files via upload
2209040022ll 85a628d
Add files via upload
2209040022ll 9ec1522
Add files via upload
2209040022ll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,43 @@ | ||
| [carla] # [mysql] 为section部分 | ||
| # Carla可执行文件的主目录,即CarlaUE4.exe所在目录 | ||
| home = data/CARLA_0.9.15 | ||
| @echo off | ||
| chcp 65001 | ||
| echo ============================================== | ||
| echo 🚀 人车模拟器VSCode插件系统 - 一键打包脚本(机器人工程毕设) | ||
| echo 打包内容:VSCode+插件+Python+HUTB+MCP+模拟器依赖 | ||
| echo ============================================== | ||
|
|
||
| :: 1. 定义打包路径与文件名 | ||
| set ROOT_DIR=%cd%/../ | ||
| set PACK_DIR=%ROOT_DIR%/pack_output/ | ||
| set ZIP_NAME=人车模拟器开发插件_一键启动版_%date:~0,4%%date:~5,2%%date:~8,2%.zip | ||
| set VSCODE_PATH=D:/Software/VSCode-win32-x64-1.80.0 :: 替换为你的VSCode安装路径 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 避免使用绝对路径 |
||
| set PYTHON_PATH=D:/Python39 :: 替换为你的Python路径(已预装HUTB/MCP) | ||
| set PLUGIN_PATH=%ROOT_DIR%/out :: 插件编译后的运行文件 | ||
|
|
||
| :: 2. 创建输出目录 | ||
| if not exist %PACK_DIR% md %PACK_DIR% | ||
| echo ✅ 已创建打包输出目录:%PACK_DIR% | ||
|
|
||
| :: 3. 复制核心文件到打包目录 | ||
| echo ✅ 正在复制VSCode本体... | ||
| xcopy /s /e /y %VSCODE_PATH% %PACK_DIR%/VSCode/ | ||
| echo ✅ 正在复制插件运行文件... | ||
| xcopy /s /e /y %PLUGIN_PATH% %PACK_DIR%/VSCode/extensions/human-vehicle-sim-plugin/ | ||
| echo ✅ 正在复制Python+HUTB+MCP依赖... | ||
| xcopy /s /e /y %PYTHON_PATH% %PACK_DIR%/Python/ | ||
| echo ✅ 正在复制人车模拟器SDK与自测脚本... | ||
| xcopy /s /e /y %ROOT_DIR%/simulator_deps %PACK_DIR%/simulator_deps/ | ||
| xcopy /s /e /y %ROOT_DIR%/test %PACK_DIR%/test/ | ||
|
|
||
| :: 4. 复制一键启动脚本到打包根目录 | ||
| copy %ROOT_DIR%/pack_script/start_vscode.bat %PACK_DIR%/一键启动_VSCode人车模拟器开发环境.bat /y | ||
|
|
||
| :: 5. 打包为ZIP压缩包(使用7z,轻量化压缩,解压即用) | ||
| 7z a -tzip %PACK_DIR%%ZIP_NAME% %PACK_DIR%/* | ||
| echo ============================================== | ||
| echo 🎉 打包完成!ZIP包路径:%PACK_DIR%%ZIP_NAME% | ||
| echo ✨ 解压后双击【一键启动_VSCode人车模拟器开发环境.bat】即可使用,无需任何配置! | ||
| echo ============================================== | ||
| pause | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 该模块的内容都应该放到vsc目录下 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| out/ | ||
| node_modules/ | ||
| .vscode-test/ | ||
| *.vsix | ||
| dist/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| node_modules/ | ||
| .vscode-test/ | ||
| src/ | ||
| .gitignore | ||
| tsconfig.json | ||
| .eslintrc.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # 更新日志 | ||
|
|
||
| ## [0.1.0] - 2026-04-07 | ||
|
|
||
| ### 新增 | ||
| - **代码智能补全**:支持 HUTB 和 MCP API 的智能补全,输入 `hutb.` 或 `mcp.` 自动弹出函数列表 | ||
| - **语法高亮**:HUTB/MCP 模块名、函数名、常量等语法着色 | ||
| - **错误检查**:实时检测未知函数名、参数数量不匹配、已弃用 API 使用 | ||
| - **一键打包**:将 VSCode、插件、Python 环境整合为 ZIP 压缩包 | ||
| - **联动调试**:一键启动 Python 调试器,自动配置 launch.json | ||
| - **调试模板**:内置多种调试场景模板(单脚本、多机通信、远程附加等) | ||
| - **自动化测试**:基于 @vscode/test-electron 的完整测试体系 | ||
| - **状态栏集成**:显示 HUTB 开发环境状态信息 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,154 @@ | ||
| # 面向人车模拟器的快速开发验证插件系统 | ||
|
|
||
| 1. 完成辅助开发的基本vscode插件功能; | ||
| 2. 将vscode和相关依赖自动打包(python、hutb、mcp等)成zip包,实现一键启动; | ||
| 3. 能够自测试、发布到商城; | ||
| # HUTB 人车模拟器开发助手 | ||
|
|
||
| 面向人车模拟器的快速开发验证 VSCode 插件系统,为 HUTB 仿真框架和 MCP 通信协议提供一站式开发工具。 | ||
|
|
||
| ## 功能特性 | ||
|
|
||
| ### 1. 代码智能补全 | ||
| - 输入 `hutb.` 或 `mcp.` 自动弹出 API 函数补全列表 | ||
| - 显示函数签名、参数说明、返回值类型和使用示例 | ||
| - 自动插入必填参数占位符 | ||
| - 已弃用 API 添加删除线标记并提示替代方案 | ||
|
|
||
| ### 2. 语法高亮 | ||
| - HUTB/MCP 模块导入语句高亮 | ||
| - 核心函数名称语法着色 | ||
| - 已弃用函数特殊颜色标记 | ||
| - 特定常量和枚举值高亮 | ||
|
|
||
| ### 3. 错误检查 | ||
| - **未知函数检测**:拼写错误自动提示相似函数名 | ||
| - **参数数量检查**:必填参数缺失或参数过多时给出提示 | ||
| - **已弃用 API 警告**:使用弃用函数时显示警告并建议替代 | ||
|
|
||
| ### 4. 一键打包开发环境 | ||
| - 将 VSCode 便携版 + 插件 + Python 环境 + 依赖库打包为 ZIP | ||
| - 解压后双击 `start.bat` 即可启动完整开发环境,零配置 | ||
| - 自动生成启动脚本和 VSCode 配置 | ||
|
|
||
| ### 5. 联动调试 | ||
| - 一键启动 Python 调试器,自动配置调试环境 | ||
| - 内置多种调试模板:单脚本调试、多机通信调试、远程附加调试 | ||
| - 自动生成/更新 `launch.json` 配置 | ||
|
|
||
| ### 6. 自测试与发布 | ||
| - 基于 `@vscode/test-electron` 的自动化测试 | ||
| - 支持一键打包 `.vsix` 安装文件 | ||
| - 支持一键发布到 VSCode 插件商城 | ||
|
|
||
| ## 快速开始 | ||
|
|
||
| ### 安装 | ||
| 1. 从 VSCode 插件商城搜索 "HUTB 人车模拟器" 安装 | ||
| 2. 或下载 `.vsix` 文件手动安装:`code --install-extension hutb-simulator-dev-0.1.0.vsix` | ||
|
|
||
| ### 使用 | ||
| 1. 打开包含 Python 文件的工作区 | ||
| 2. 在 Python 文件中输入 `hutb.` 或 `mcp.` 即可获得智能补全 | ||
| 3. 按 `Ctrl+Shift+P` 打开命令面板,输入 "HUTB" 查看所有可用命令 | ||
|
|
||
| ### 可用命令 | ||
| | 命令 | 说明 | | ||
| |------|------| | ||
| | `HUTB: 一键打包开发环境` | 将完整开发环境打包为 ZIP | | ||
| | `HUTB: 启动调试` | 自动配置并启动 Python 调试器 | | ||
| | `HUTB: 选择调试模板` | 选择预设的调试配置模板 | | ||
| | `HUTB: 运行测试` | 执行插件自动化测试 | | ||
| | `HUTB: 打包插件` | 打包为 .vsix 安装文件 | | ||
| | `HUTB: 发布插件` | 发布到 VSCode 插件商城 | | ||
|
|
||
| ## 配置项 | ||
|
|
||
| 在 VSCode 设置中搜索 "hutb" 可配置以下选项: | ||
|
|
||
| | 配置项 | 说明 | 默认值 | | ||
| |--------|------|--------| | ||
| | `hutb.pythonPath` | Python 解释器路径 | 自动检测 | | ||
| | `hutb.sdkVersion` | HUTB SDK 版本号 | 空 | | ||
| | `hutb.packConfig.vscodePath` | VSCode 便携版路径 | 空 | | ||
| | `hutb.packConfig.pythonEnvPath` | Python 环境路径 | 空 | | ||
| | `hutb.packConfig.outputDir` | 打包输出目录 | 空 | | ||
|
|
||
| ## 项目结构 | ||
|
|
||
| ``` | ||
| ├── data/ # 数据文件 | ||
| │ ├── api-definitions.json # HUTB/MCP API 定义 | ||
| │ ├── debug-templates.json # 调试配置模板 | ||
| │ └── pack-config.json # 打包配置 | ||
| ├── samples/ # 示例代码 | ||
| │ ├── example_simulation.py # 基础仿真示例 | ||
| │ └── mcp_communication.py # MCP 通信示例 | ||
| ├── src/ # 源代码 | ||
| │ ├── extension.ts # 插件入口 | ||
| │ ├── modules/ # 功能模块 | ||
| │ │ ├── completion.ts # 代码补全 | ||
| │ │ ├── diagnostics.ts # 错误检查 | ||
| │ │ ├── packager.ts # 环境打包 | ||
| │ │ ├── debugger.ts # 联动调试 | ||
| │ │ └── statusBar.ts # 状态栏 | ||
| │ ├── utils/ # 工具类 | ||
| │ │ └── apiLoader.ts # API 定义加载器 | ||
| │ └── test/ # 测试文件 | ||
| │ ├── runTest.ts # 测试入口 | ||
| │ └── suite/ # 测试套件 | ||
| │ ├── index.ts | ||
| │ ├── completion.test.ts | ||
| │ ├── diagnostics.test.ts | ||
| │ ├── debugConfig.test.ts | ||
| │ └── packaging.test.ts | ||
| ├── syntaxes/ # 语法定义 | ||
| │ └── hutb.tmLanguage.json # TextMate 语法高亮规则 | ||
| ├── package.json # 插件清单 | ||
| ├── tsconfig.json # TypeScript 配置 | ||
| └── CHANGELOG.md # 更新日志 | ||
| ``` | ||
|
|
||
| ## 开发 | ||
|
|
||
| ### 环境要求 | ||
| - Node.js 18.x 或 20.x | ||
| - VSCode 1.80.0+ | ||
| - Python 3.9+ | ||
|
|
||
| ### 构建与调试 | ||
| ```bash | ||
| # 安装依赖 | ||
| npm install | ||
|
|
||
| # 编译 | ||
| npm run compile | ||
|
|
||
| # 监听模式 | ||
| npm run watch | ||
|
|
||
| # 运行测试 | ||
| npm test | ||
|
|
||
| # 打包 .vsix | ||
| npm run package | ||
|
|
||
| # 发布 | ||
| npm run publish | ||
| ``` | ||
|
|
||
| ### 调试插件 | ||
| 1. 在 VSCode 中打开项目 | ||
| 2. 按 `F5` 启动扩展开发宿主 | ||
| 3. 在新窗口中打开 Python 文件测试插件功能 | ||
|
|
||
| ## 技术栈 | ||
| - **VSCode Extension API** - 插件开发框架 | ||
| - **TypeScript 5.x** - 核心开发语言 | ||
| - **Node.js** - 运行环境与工具链 | ||
| - **TextMate Grammar** - 语法高亮规则 | ||
| - **@vscode/test-electron** - 自动化测试框架 | ||
| - **archiver** - ZIP 压缩 | ||
|
|
||
| ## 许可证 | ||
|
|
||
| MIT | ||
|
|
||
| ## 仓库地址 | ||
|
|
||
| [https://github.com/OpenHUTB/vscode-ext](https://github.com/OpenHUTB/vscode-ext) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| % content/abstract.tex - 中英文摘要 | ||
| \chapter*{摘要} % 摘要无章节号 | ||
| \addcontentsline{toc}{chapter}{摘要} % 加入目录 | ||
|
|
||
| 随着智能网联汽车与无人车技术的发展,人车模拟器成为智能车辆研发的核心工具,但当前开发存在环境配置繁、工具不匹配、流程割裂的痛点。本文选题为「面向人车模拟器的快速开发验证VSCode插件系统」,通过文献研究、模块化开发等方法,设计并实现一款专属VSCode插件,整合代码补全、环境打包、联动调试功能,解决人车模拟器开发效率低的问题。本研究填补了人车模拟器专属开发工具的空白,兼具理论创新与教学、研发场景的实践价值。 | ||
|
|
||
| 关键词:人车模拟器;VSCode插件;开发工具;智能车辆 | ||
|
|
||
|
|
||
| \chapter*{Abstract} | ||
| \addcontentsline{toc}{chapter}{Abstract} | ||
|
|
||
| With the development of intelligent connected vehicles and unmanned vehicle technology, the human-vehicle simulator has become a core tool for intelligent vehicle research and development. However, current development faces pain points such as cumbersome environment configuration, mismatched tools, and fragmented processes. This paper selects the topic "VSCode Plugin System for Rapid Development and Verification of Human-Vehicle Simulator". Through methods such as literature research and modular development, a dedicated VSCode plugin is designed and implemented, integrating code completion, environment packaging, and linkage debugging functions to solve the problem of low development efficiency of human-vehicle simulators. This research fills the gap in dedicated development tools for human-vehicle simulators and has both theoretical innovation and practical value in teaching and R&D scenarios. | ||
|
|
||
| Key words: Human-Vehicle Simulator; VSCode Plugin; Development Tool; Intelligent Vehicle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| % content/acknowledgements.tex - 致谢 | ||
| \chapter*{致谢} | ||
| \addcontentsline{toc}{chapter}{致谢} | ||
|
|
||
| 本开题报告的完成,首先感谢我的指导教师王海东老师,在选题方向与研究思路上给予了我清晰的指导,帮助我明确了课题的核心价值与研究路径。同时感谢实验室的学长学姐,为我提供了人车模拟器的技术文档与开发经验支持。后续的毕业设计工作中,我会继续保持严谨的态度,认真完成研究与开发任务。 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
该模块的内容都应该放到vsc目录下