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

feat: New Feature: outline extension BuildItems #1365

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

angelozerr
Copy link
Contributor

@angelozerr angelozerr commented Aug 8, 2024

feat: New Feature: outline extension BuildItems

Fixes #1094

Here a demo with the current PR:

BuildItemWorkspaceSymbols

Here how it works:

  • you need to open a Java file to start the MicroProfile Language Server (it doesn"t work if the language server is not started). To fix this issue, LSP4IJ must be improved with Provide LSP workspace symbols for non started language server lsp4ij#439
  • you need to select Project and libraries in the scope to retrieve BuildItem from the JARs
  • As symbols is used for a lot of things like Java class, I decided to fill the list with BuildItem which starts with &

@gastaldi what do you think about that and the demo? Is it enough? Do you need more things?

Copy link

sonarcloud bot commented Aug 8, 2024

@gastaldi
Copy link
Contributor

gastaldi commented Aug 8, 2024

@angelozerr that looks really cool, good job! Can we somehow also show the javadoc next to the class name (that explains what the build item is for)?

@angelozerr
Copy link
Contributor Author

@angelozerr that looks really cool, good job!

Thanks!

Can we somehow also show the javadoc next to the class name (that explains what the build item is for)?

I fear that it is not possible by using standard Symbols tab. To do that I think we should develop specific UI, but I don't know if it is easy to do that.

@fbricon
Copy link
Contributor

fbricon commented Aug 12, 2024

My fear is about the need to use a specific prefix for triggering the builditem search, in this cas &. It's seems arbitrary/unnatural and would need to be documented extensively. I don't see a way to make it easily discoverable.

@@ -0,0 +1,53 @@
package com.redhat.devtools.intellij.quarkus.psi.internal.builditems;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header

}

/**
* Returns a set of all classes in the given project that extend Renarde's
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong doc

@angelozerr
Copy link
Contributor Author

My fear is about the need to use a specific prefix for triggering the builditem search, in this cas &. It's seems arbitrary/unnatural and would need to be documented extensively. I don't see a way to make it easily discoverable.

The main problem is that I contribute to Symbol and it is difficult to retrieve BuildItem without special characters because Symbol return Java class. For JAX-REST we use special character@

@angelozerr
Copy link
Contributor Author

@gastaldi do you think we can merge this feature:

  • I decided to use & to search BuildItem, do you like that? Doyou prefer an another character?
  • because of limitation of LSP WorkspaceSymbol and IJ too, we cannot shows Javadoc, so do you think it is helpfull to have this feature?

@gastaldi
Copy link
Contributor

@angelozerr I agree with @fbricon's concerns here that using & seems arbitrary and unnatural. Although I understand the reason why it works that way, I think that having a separate window (listing the existing build items along with their description) would be more user-friendly.

@angelozerr
Copy link
Contributor Author

, I think that having a separate window (listing the existing build items along with their description) would be more user-friendly.

Ok it wil require more work because it will require to develop a custom UI to show Javadoc.

@ia3andy
Copy link

ia3andy commented Aug 14, 2024

@gastaldi could you elaborate on the need for this? using class search with BuildItem gives the same result and its easier to find

@ia3andy
Copy link

ia3andy commented Aug 14, 2024

@gastaldi at some point, I was thinking about using AI to generate a better all BuildItems doc:

  • with a generated doc when it's not documented
  • with examples of usage from the Quarkus codebase
  • showing what's internal and what's not

@gastaldi
Copy link
Contributor

As I reported in #1094, the idea is to have a search mechanism to find the intended build item while developing an extension. Although searching for BuildItem may display the build items on the classpath, it doesn't help much, since you lack examples and you need the sources to understand what it does.

We have a list of all build items with their respective javadocs in https://quarkus.io/guides/all-builditems, that's what I use when trying to find a match for a build item when developing an extension, but having it easily findable in the IDE would be easier

@ia3andy
Copy link

ia3andy commented Aug 14, 2024

@gastaldi what about introducing another plugin for Quarkus extension developers then (and not making the one for users heavier)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Feature: outline extension BuildItems
4 participants