Skip to content
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

[Feature] - Improve navigation between command usage and handler implementation for CQRS projects #1

Open
dinbtechit opened this issue Sep 23, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dinbtechit
Copy link
Owner

dinbtechit commented Sep 23, 2023

@SylvainMarty Thank you for reporting this feature request in KartanHQ/intellij-nestjs/ repo . I'm launching a NestJS plugin. I'm planning to include this functionality into this plugin. Unfortunately, the maintainer of KartanHQ/intellij-nestjs/ repository does not have enough bandwidth to add more features or accept PRs at this time.


Is your feature request related to a problem? Please describe.

We use CQRS (@nestjs/cqrs) extensively in our NestJS monorepo project and many of our developers complains about navigation between CQRS files being not very efficient nor natural.

The main complaint was how slow it was to navigate from the usage of Command/Query to the dedicated Handler which does the work under the hood.

Here is an "example" of the problem:

// 1. The dev see this code somwhere:
const command = new MyCommand();
await this.commandBus.execute(command);

// 2. The dev wants to go to the handler which implement the command logic
// First, it needs to do "Go to implementation" (Ctrl + B) to see the command class definition
// Then it needs to "Go to Declaration and usage" (Ctrl + B) to see all the usages and select the one which relates to the handler
Since our code is mostly CQRS implementations, this mechanic needs to happen a lot of time and is not very efficient.

Aside that, we really like CQRS, we just want to be more efficient using it. :-)

Describe the solution you'd like

I'm not sure what the best solution would be but I was thinking that it would be easier to have a shortcut/option to go to the implementation of a command (aka its handler).
I think it may be possible to get this information since all commands are references by its handler in the @CommandHandler(MyCommand) annotation.

Describe alternatives you've considered

I searched online to see if there were any plugins or shortcut in Intellij based IDE to achieve this but so far, I only found a feature specific to Resharper: Resharper > Navigate To > Consuming APIs.
Sadly this feature is not present on our IDE (PHPStorm).

Additional context

I never developed plugins for Intellij but I have experience in Java/Kotlin and I'm interested in submitting a PR if you think it can be handled by this plugin. 😃

@dinbtechit dinbtechit added the enhancement New feature or request label Sep 23, 2023
@dinbtechit
Copy link
Owner Author

Scheduled for v0.0.3

@dinbtechit
Copy link
Owner Author

Scheduled for v0.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant