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

Generate one CodeAction per TemplateExtensions class #677

Closed
datho7561 opened this issue Jul 27, 2022 · 3 comments · Fixed by #696
Closed

Generate one CodeAction per TemplateExtensions class #677

datho7561 opened this issue Jul 27, 2022 · 3 comments · Fixed by #696
Assignees
Labels
Milestone

Comments

@datho7561
Copy link
Contributor

We have one code action which generates a new method in an existing TemplateExtensions, but we should generate one code action for each existing TemplateExtensions that isn't a binary file.

See #671 (comment)

@datho7561 datho7561 added enhancement New feature or request code action qute labels Jul 27, 2022
@datho7561
Copy link
Contributor Author

This could get fairly complex to support in combination with resolveCodeAction, since we would need to know all the possible TemplateExtensions classes before resolving the code action.

@angelozerr
Copy link
Contributor

Qute ls know the resolver extension. It means that you ould remove your code which retrieve templzte extension classes on jdt side and you could loop for thise revolvers to generate code action per resolver

@angelozerr
Copy link
Contributor

In this issue we will able to remove the search of existing of template extension

searchEngine.search(searchPattern, new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() },
because we will generate a code action per existing template extension class known by the Qute LS.

To collect all Java resolvers class, I suggest that you do like namespaces at

and my first idea was to have

public Set<String> getAllValueResolversClasses() {

but it is a bad idea because:

  • it will contains @TemplateExtension classes
  • but too other classes annotated with @TemplateEnum, etc.

So we need to improve ValueResolverInfo to store:

  • the kind (TemplateExtension, etc) which can be an enum.
  • the source (Boolean) to know if TemplateExtension is a source or binary.

After that you will able to do like namespace and you could filter with kind and source to have a method like:

Set<String> getTemplateExtensionSourceTypes();

like

@datho7561 datho7561 self-assigned this Aug 3, 2022
datho7561 added a commit to datho7561/quarkus-ls that referenced this issue Aug 4, 2022
For CodeActions for a missing member in a Qute template,
generate one "add template extension to existing class"
CodeAction for each class file that is annotated with @TemplateExtension.

Closes redhat-developer#677

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/quarkus-ls that referenced this issue Aug 4, 2022
For CodeActions for a missing member in a Qute template,
generate one "add template extension to existing class"
CodeAction for each class file that is annotated with @TemplateExtension.

Closes redhat-developer#677

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 added this to the 0.13.0 milestone Aug 4, 2022
datho7561 added a commit to datho7561/quarkus-ls that referenced this issue Aug 4, 2022
For CodeActions for a missing member in a Qute template,
generate one "add template extension to existing class"
CodeAction for each class file that is annotated with @TemplateExtension.

Closes redhat-developer#677

Signed-off-by: David Thompson <davthomp@redhat.com>
datho7561 added a commit to datho7561/quarkus-ls that referenced this issue Aug 5, 2022
For CodeActions for a missing member in a Qute template,
generate one "add template extension to existing class"
CodeAction for each class file that is annotated with @TemplateExtension.

Closes redhat-developer#677

Signed-off-by: David Thompson <davthomp@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants