# vscode-plugin-demo1 **Repository Path**: consolelog/vscode-plugin-demo1 ## Basic Information - **Project Name**: vscode-plugin-demo1 - **Description**: vscode-plugin-demo1 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-18 - **Last Updated**: 2025-04-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 自用ngxs插件 用于从Action的调用处跳转到Action的实现处。 例如当光标在 `welcome.component.ts` 文件的 `ChangeTestState` 这里时按下快捷键后, 就会跳转到 `system.state.ts` 的这一行 `@Action(SystemAction.ChangeTestState)` 。 macOS下快捷键为 `option+cmd+J`,windows下快捷键为 `ctrl+alt+;`。 welcome.component.ts: ``` test() { this.store.dispatch(new SystemAction.ChangeTestState()); } ``` system.state.ts: ``` export interface SystemStateModel { testState: number; } @State({ name: 'system', defaults: { testState: 0, }, }) @Injectable({ providedIn: 'root', }) export class SystemState { @Action(SystemAction.ChangeTestState) ChangeTestState(ctx: StateContext) { let state = ctx.getState(); ctx.patchState({testState: state.testState + 1}); } } ```