OpenLiberty / liberty-tools-intellij

IntelliJ IDEA extension for Liberty
https://plugins.jetbrains.com/plugin/14856-open-liberty-tools
Eclipse Public License 2.0
12 stars 24 forks source link

Consider how JetBrains Marketplace entry might be used to make Liberty Tools IntelliJ more discoverable through the IDE. #498

Open aparnamichael opened 1 year ago

aparnamichael commented 1 year ago

IntelliJ IDEA can suggest installing and enabling plugins based on libraries and facets used in the project. Need to check more on how we can make use of this and improve visibilty of Liberty plugin. https://www.jetbrains.com/help/idea/managing-plugins.html#suggested-plugins

aparnamichael commented 8 months ago

Intellij itself does this functionality by using a tool called Feature Extractor.

I verified this functionality by opening a maven/gradle open liberty project without installing LT for intellij and I was able to see intellij suggesting LT for intellij plugin.

image

on clicking on "configure plugins" button, it will open the intellij plugins window and it show an option to install LT for intellij.

image

document link

TrevCraw commented 7 months ago

Feedback originally shared in Slack:

Now that we understand how the recommendation works, we should look into what we can do to facilitate the Feature Extractor recommending our plugin. We need to consider if we have configured the right File Types, Run Config Types, Facet Types, Module Types, and Artifact Types for Liberty Tools.

The example in the screen shot looks like it is responding to a Run Config Type. Does IntelliJ give recommendations for Liberty Tools based on other Types? For instance, try opening a Maven/Gradle project without any Liberty config. Or try opening a bootstrap.properties or server.env file. What behaviour do we see there?

vaisakhkannan commented 7 months ago

I am able to set up a local IntelliJ repository. Now, when I search for the plugin using the repository URL, I am able to find the plugin in the list. repository:http://localhost:8080/updatePlugins.xml Liberty-tools

Screenshot 2024-02-13 at 5 58 17 PM

@TrevCraw , Now, I am attempting to receive suggestions when opening .env files, specifically the server.env file. When we open the server.env file, we should be able to see suggestions for other plugins that support .env files. Similarly, I am striving to achieve this with our plugin.

Screenshot 2024-02-13 at 5 59 13 PM
vaisakhkannan commented 7 months ago

@TrevCraw , I found that we have code to suggest installing the liberty-tools plugin when opening the server.envfile. I observed our plugin suggestion when I opened the server.env file, as shown in the image below. However, the issue is that I am not consistently receiving the suggestion. Instead, I saw that suggestion only once. After cleaning the plugin cache and attempting to reproduce the suggestion, I only see suggestions from other .env supported plugins, not from ours.


src/main/java/io/openliberty/tools/intellij/liberty/lsp/ServerEnvFileType.java


Screenshot 2024-02-14 at 10 46 07 AM

Originally, we had code to provide suggestions for Bootstrap.properties file types, but I can see that the code has been removed with this PR https://github.com/OpenLiberty/liberty-tools-intellij/pull/244 , Do you know why we removed that?

src/main/java/io/openliberty/tools/intellij/liberty/lsp/BootstrapPropertiesFileType.java

vaisakhkannan commented 7 months ago

@TrevCraw , @aparnamichael , Plugin recommendations for Run Configuration Type, Facet Type, Module Type, and Artifact Type will suggest users to install the plugin only when they open a project that was previously opened with the Liberty plugin installed in it. This is because we are aware that we can only create the Liberty run configuration when the plugin is installed, similar to Facet Type, Module Type, and Artifact Type.

vaisakhkannan commented 5 months ago

https://jetbrains-platform.slack.com/archives/C5U8BM1MK/p1708667345156719 The link above is for the Slack discussion with the JetBrains team.

I asked for suggestions on when the LMP or LGP is defined in the pom.xml or build.gradle, respectively. They are saying there is no support for Maven plugins in this regard.

They also said that they have the right to not suggest any of plugins for popular files if the suggestion is noisy or if we don’t see the plugin as essential for the library or file (server.env, microprofile-config.properties).

For dependency support tags they rarely approve any 3rd party suggestions, our plugin must be essential for the library (Eg: <artifactId>jakarta.jakartaee-api</artifactId> and <artifactId>microprofile</artifactId>).