amondel2 commented on code in PR #439:
URL: 
https://github.com/apache/grails-intellij-plugin/pull/439#discussion_r4240269655


##########
AGENTS.md:
##########
@@ -162,13 +162,18 @@ both ordinary directories and module content roots, which 
the platform presents
 
 **Module content-root labels use coloured fragments; ordinary directories use 
`presentableText`.**
 In platform 262.10315.125, `PsiDirectoryNode.updateImpl` adds coloured 
fragments only when
-`ProjectRootsUtil.isModuleContentRoot` is true. For other directories it calls 
`setPresentableText`
-with the name from `ProjectViewDirectoryHelper.getNodeName`, which can be 
qualified (`grails-app.i18n`).
+`ProjectRootsUtil.isModuleContentRoot` is true *and* the file resolves to at 
least one module; a content
+root that resolves to none falls through to the `presentableText` path too. 
For those directories it calls
+`setPresentableText` with the name from 
`ProjectViewDirectoryHelper.getNodeName`, which can be qualified
+(`grails-app.i18n`).
 Gradle's per-source-set modules make `src/test` a module content root, so its 
label can be
 `test [app.test]` in fragments. The renderer prefers a non-empty fragment list 
over `presentableText`;
 setting only the latter to `Tests:unit` leaves the content-root label visible.
-`GrailsPsiDirectoryNode.postprocess` replaces any fragments and sets 
`presentableText` on both
-the updated presentation and the template, keeping custom titles consistent 
for both kinds of directory.
+`GrailsPsiDirectoryNode.postprocess` replaces any fragments and sets 
`presentableText`, keeping custom
+titles consistent for both kinds of directory. `postprocess` itself is a 
choice rather than a requirement:
+the platform has written the label by the time either hook's body runs, 
because `super.updateImpl` is the
+first statement of the override, so clearing the fragments in `updateImpl` 
would work equally well. Do not
+treat `updateImpl` as too early: `super.updateImpl` writes the label before 
the rest of the override runs.

Review Comment:
   Fixed. The "choice rather than a requirement" wording, the "would work 
equally well" conclusion, and ``the "do not treat `updateImpl` as too early" 
sentence are gone from *Project view gotchas*. It now says `postprocess` is 
required, names the decorators that run between the two hooks as the reason, 
and describes both ways a title written in `updateImpl` fails — restyled, or 
suffixed with `[module]` by `GradleModuleDirectoryDecorator`. The regression 
test in `GrailsPsiDirectoryNodeTest` pins the behaviour the paragraph describes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to