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

Add Common Nx Commands panel to Intellij #2171

Open
Den-dp opened this issue Jun 15, 2024 · 2 comments
Open

Add Common Nx Commands panel to Intellij #2171

Den-dp opened this issue Jun 15, 2024 · 2 comments
Labels
type: feature New feature or request

Comments

@Den-dp
Copy link

Den-dp commented Jun 15, 2024

Description

Add Common Nx Commands panel to Intellij (especially run-many and Add Dev Dependency).

Motivation

  • To achieve better feature parity with VS Code
  • and bring back an easy way to use run-many and Add Dev Dependency actions (cause sometimes it is easier to click than type commands)

Suggested Implementation

image

Alternate Implementations

@Den-dp Den-dp added the type: feature New feature or request label Jun 15, 2024
@MaxKless
Copy link
Collaborator

Hey! I think it's a good idea and a valid reqest.
Right now this is not a priority so I won't be working on it anytime soon.
If you're interested in contributing this, I'd love to help out!

@MaxKless
Copy link
Collaborator

MaxKless commented Aug 8, 2024

I love that you're willing to contribute @santoshyadavdev !
Here's a rough guide to adding a Common Nx Commands Panel to JetBrains:

Take the VSCode implementation as a guideline, you'll find it here: libs/vscode/nx-commands-view/src/lib/nx-commands-provider.ts. You can see that there are different sources of commands: Some are hardcoded, some are the available targets and some are user-provided from the settings. The setting-based one is optional for now and targets are already available in the sidebar in JetBrains. So you can focus on just a list of common nx commands for now.

You'll have to modify the nx toolwindow in intellij, you'll find it here: apps/intellij/src/main/kotlin/dev/nx/console/nx_toolwindow/NxToolWindowPanel.kt. Create another tree (like in the tree package in that folder) called CommonNxCommandsTree or something. You need to create child nodes like the project tree does, though it will be way simpler because it's just one level deep. Then hook it into the rendering flow in NxToolWindowPanel.kt.

For the Generate tree item, you can just call the generate action we already have. For others, you might need to create a new action. Feel free to ping me with any questions you have, I can talk about it in more detail depending on where you need help.

Check out the docs here: https://plugins.jetbrains.com/docs/intellij/welcome.html

In order to run the plugin, you can just run nx run intellij:runIde. Make sure you have a local version of java configured.

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

No branches or pull requests

2 participants