redhat-developer / quarkus-ls

Language server for Quarkus tooling
Eclipse Public License 2.0
44 stars 15 forks source link

Locate spot to generate `TemplateExtensions.java` better #834

Closed datho7561 closed 1 year ago

datho7561 commented 1 year ago

When locating the folder to generate TemplateExtension.java into during the "generate missing member" Qute quick fix:

Fixes #831

Signed-off-by: David Thompson davthomp@redhat.com

datho7561 commented 1 year ago

Okay. It should work now: it should avoid generating into a "generated sources" folder, test folder, and resource folder, with both maven and gradle, and in cases where you change where the source folder is.

(However, Qute template support is buggy in the last case since some features hard code src/main/java)

angelozerr commented 1 year ago

The code looks very good since you don(t hard code src/main/java. Nice!

(However, Qute template support is buggy in the last case since some features hard code src/main/java)

Sorry I don't understand what you mean?

Test alrady exists and you update the order of classpath entries, very good idea.

datho7561 commented 1 year ago

Sorry I don't understand what you mean?

One case I ran into when testing is that if I use a gradle project, set the source folder to src/java and set the resources folder to src/resources, then open a template, it doesn't detect that the file is a Qute template until I open a Java file. That might be in vscode-quarkus now that I think about it though.

datho7561 commented 1 year ago

The code lens for type safe templates also points to the wrong folder when the resources folder is src/resources.

angelozerr commented 1 year ago

Oh I see, the folder is hard coded at https://github.com/redhat-developer/quarkus-ls/blob/e6114a12e3c4c169c91424c6b75eacabd611a0cf/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/utils/JDTQuteProjectUtils.java#L42

and https://github.com/redhat-developer/quarkus-ls/blob/820e5a9b71302e9f21ea5bc29e1610b51b4757d7/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/utils/JDTQuteProjectUtils.java#L89

We need to improve that

datho7561 commented 1 year ago

@angelozerr do you think this is okay to merge?

angelozerr commented 1 year ago

@angelozerr do you think this is okay to merge?

Yes but please create issue for codelens and other feature which doesn't work like you have noticed.