-
Notifications
You must be signed in to change notification settings - Fork 15
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
TemplateExtension.java
class generated in src/main/resources
#831
Comments
I've only tested this with a Maven project. I guess it would be incorrect in a different way for a Gradle project. |
@fbricon @angelozerr This isn't a regression, it's just very difficult to locate the folder that the project's code is in using the JDT APIs, since resource folders are hard to distinguish from Java source folders, and it's hard to tell if a Java source folder is for generated sources. What are your thoughts about disabling this quick fix until we have some sort of UI to specify the name and location of the class file when creating it? |
for now, I'd check if there's a src/main/java source folder in the project classpath. Then exclude all source folders where the test attribute (IClasspathManager.TEST_ATTRIBUTE) is set to "true" |
Hard code the folder that `TemplateExtensions.java` is generated in to `./src/main/java`, and throw an exception if that path isn't on the classpath to indicate that the quick fix failed. We will need to improve this in the future, since the location of the default package can be configured in Maven and Gradle. Fixes redhat-developer#831 Signed-off-by: David Thompson <davthomp@redhat.com>
When locating the folder to generate `TemplateExtension.java` into during the "generate missing member" Qute quick fix: - Filter out classpath entries that are in the output (`target`) folder - Filter out classpath entries that represent test code - Filter out classpath entries that represent resource folders (folders with no Java source files) Fixes redhat-developer#831 Signed-off-by: David Thompson <davthomp@redhat.com>
When locating the folder to generate `TemplateExtension.java` into during the "generate missing member" Qute quick fix: - Filter out classpath entries that are in the output (`target`) folder - Filter out classpath entries that represent test code - Filter out classpath entries that represent resource folders (folders with no Java source files) Fixes redhat-developer#831 Signed-off-by: David Thompson <davthomp@redhat.com>
When locating the folder to generate `TemplateExtension.java` into during the "generate missing member" Qute quick fix: - Filter out classpath entries that are in the output (`target`) folder - Filter out classpath entries that represent test code - Filter out classpath entries that represent resource folders (folders with no Java source files) Fixes #831 Signed-off-by: David Thompson <davthomp@redhat.com>
|
: "Create template extension sandwich() in new template extensions class"Expected: a new file
TemplateExtensions.java
is generated insrc/main/java
(the default package)Actual: the file is generated in
src/main/resources
The text was updated successfully, but these errors were encountered: