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

Template files have wrong file extension #63

Open
xpusostomos opened this issue Nov 29, 2021 · 4 comments
Open

Template files have wrong file extension #63

xpusostomos opened this issue Nov 29, 2021 · 4 comments

Comments

@xpusostomos
Copy link

It's pretty annoying that groovy scaffolding template files in src/main/templates have the file extension .groovy because IDEs assume they are groovy files and annoy you forever that their syntax is invalid. In point of fact, they are not groovy files, they are a mish mash of groovy and some other stuff. Just like Microsoft Excel templates have different file extension (.xlsx) compared to regular Excel files (.xls), these non-groovy half-groovy templates deserve their own file extension, such as .groovyt or something. I could say the same thing about .gsp template files, should be .gspt.

Who knows... if you differentiate them thus, Jetbrains might even write a syntax checker for them.

@jeffscottbrown
Copy link
Member

@puneetbehl Do you think this should be under github.com/grails3-plugins/scaffolding/issues?

@jeffscottbrown jeffscottbrown transferred this issue from grails/grails-core Feb 8, 2022
@jeffscottbrown
Copy link
Member

I could say the same thing about .gsp template files, should be .gspt.

Personally I do not favor renaming .gsp template files and don't agree that they should have a .gspt extension. When we invented GSP we included a mechanism for naming templates to distinguish them and that is by prefixing the file name with an undrscore. The contents of those files is valid Groovy Server Page code and I believe .gsp is the most sensible extension for those in my estimation.

@xpusostomos
Copy link
Author

@jeffbrown I don't think we're talking about the same thing. The underscore files are indeed valid gsp code. The files in src/main/templates/scaffolding are not. Try putting one of them in your views/ folder... they do not compute.

@jeffscottbrown
Copy link
Member

"I don't think we're talking about the same thing." - Agreed. When you said ".gsp template files" I assumed you were referring to technology we created for which we use the term "GSP Template" (https://gsp.grails.org/5.2.1/guide/index.html#viewsAndTemplates). The files in src/main/templates/scaffolding are a different thing. I understand your comment better now that you have added clarification. Thank you.

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

No branches or pull requests

2 participants