VS Code Extensions
WePY Action Navigator

WePY Action Navigator

by Jsmond2016

Go to Store/API definition and hover for dispatchAction and actions.{actionKey} in .wpy files

Downloads

2

Rating

(0)

Version

0.1.9

Last updated

May 25, 2026

VSCode 扩展:在 .wpy 文件中为 dispatchAction('actionName')this.$store.actions.{actionKey} 提供跳转与 Hover 提示。

功能

  • Go to Definition(Cmd/Ctrl + 点击):在 action 名字符串上 Cmd+点击,可跳转到 Store 层 action 定义及(若有)API 层接口实现(多定义列表)。
  • Hover:悬停在 action 名上时,弹框显示可点击链接 Go to StoreGo to Api(仅当该 action 有对应接口时显示),以及接口名(action type)。

使用

  1. 在项目根目录已包含 src/storesrc/services/api 或分包 setup/storesetup/http 时,扩展会自动扫描并建索引。
  2. 新增或修改 Store/API 后若 Hover/跳转未更新:先保存相关 .js,再在命令面板执行 WePY: Rebuild Action IndexwepyActionNav.rebuildIndex)手动刷新索引。
  3. 打开任意 .wpy 文件,在以下位置均可使用:
    • this.$store.dispatchAction('xxx')'xxx'
    • this.$store.actions.xxxxxx 上(如 this.$store.actions.getPromotionsByPositionId([...])
    • Cmd/Ctrl + 点击 → 跳转到 Store/API 定义。
    • 悬停 → 显示「Go to Store」「Go to Api」链接及接口名。

开发

cd wepy-action-nav
pnpm install
pnpm run compile

在 VSCode 中按 F5 从当前仓库启动扩展开发主机进行调试。

Related extensions