Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>uni-highlightNew to Visual Studio Code? Get it now.
uni-highlight

uni-highlight

Uni Helper

|
165,181 installs
| (1) | Free
在 VS Code 中对条件编译的代码注释部分提供了语法高亮
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

@uni-helper/uni-highlight-vscode

logo

License GitHub Stars VSCode version VSCode downloads

Author

在 VS Code 中为 uni-app 条件编译的代码注释提供语法高亮、错误提示和折叠功能。

请考虑持续赞助以维持该项目的持续健康发展,非常感谢!🙏

想让 uni-app 开发变得更直观、高效?想要更好的 uni-app 开发体验?不妨看看 uni-helper 主页 和 uni-helper GitHub Organization!

插件特性

  • 条件编译注释语法高亮,多平台分色显示
  • 未知平台错误提示,并推测最接近的正确写法
  • 条件编译注释块折叠,支持一键折叠其他平台
  • 支持 Vue、JS、TS、CSS、HTML 等多种文件类型

基础使用

base

错误提示

error

错误推测

infer

注释块折叠

folding

多平台高亮

more

各平台多种颜色高亮

colorful

CSS 高亮

css

HTML 高亮

html

扩展设置

设置 类型 默认值 说明
uni-highlight.platform object {} 自定义平台高亮和名称,可覆盖内置平台的颜色、标签,或添加新平台

在 .vscode/settings.json 中配置,值可以直接写颜色:

{
  "uni-highlight.platform": {
    "MP-DINGTALK": "#41b883"
  }
}

也可以带上平台说明:

{
  "uni-highlight.platform": {
    "MP-DINGTALK": {
      "color": "#41b883",
      "label": "钉钉"
    }
  }
}

修改设置后需要重载窗口(Developer: Reload Window)才会生效。

命令

命令 标题 说明
uni.comment.reload Uni Helper: 重新加载条件编译高亮 重新扫描当前文件的条件编译注释,刷新高亮和折叠
uni.comment.fold-other-platform Uni Helper: 选择平台并折叠其他平台注释 选择一个平台,折叠其余平台的注释块;检测到条件编译注释时,编辑器标题栏会显示对应按钮

参与贡献

欢迎通过 Issue 或 Pull Request 参与改进本项目。开始前请阅读 CONTRIBUTING.md,了解项目结构、本地开发流程、测试方式与提交规范。

许可证

MIT © 2022-present uni-helper & Collaborators

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft