docs: multi-line import example for page directive #464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Documentation didn't cover the case of multiple page imports, which requires semicolons
;
. Newbies could try separating them by spaces, which would cause an errorUnexpected input: 'com'
.Additionally, I'd like to take this opportunity to ask you to introduce a guideline for optimal code quality. For projects with large number of imports, e.g. when you pass many objects to GSP to work with them, it's beneficial to avoid import being an insanely long line. For version control, you also want to reduce conflicts and individually see git blame for each import. However, to separate lines, you must add an undocumented workaround of a trailing backslash
\
, otherwise you get an errorUnexpected input: '\n'
.Additional questions also arise when you're about to establish a baseline for a new project, which is why I ask you to define a convention here that you expect projects to follow by default, as a de-facto standard. For example:
;
after the last import to reduce diff.; \
and put" %>
at the next line, there is an errorUnexpected input: '\r\n'
.;
, only with\
, then it's possible to put" %>
as the last line. In this case we can't avoid frequent changes when new imports are added.\
...🗒️ The errors are reported under
org.codehaus.groovy.control.MultipleCompilationErrorsException
:org.grails.gsp.GroovyPagesException
:Could not parse script
:startup failed
.