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


##########
plugin/src/main/java/org/apache/grails/intellij/plugin/projectView/nodes/OtherGrailsAppSourcesNode.java:
##########
@@ -96,7 +97,12 @@ public OtherGrailsAppSourcesNode(@NotNull PsiDirectory 
directory, @NotNull ViewS
     for (VirtualFile dir : otherDirs) {
       PsiDirectory directory = manager.findDirectory(dir);
       if (directory != null) {
-        result.add(new PsiDirectoryNode(project, directory, getSettings()));
+        if (GrailsViewItems.ASSETS_DIR.equals(dir.getName())) {
+          result.add(new PsiDirectoryNode(project, directory, getSettings(),
+                                          item -> 
!GrailsViewItems.isAssetSubfolder(item.getName())));

Review Comment:
   Fixed in `e1ad4a0`. You were right and I reproduced it first: the filter 
matched by name only, while `contains()` walked only the direct children of 
`assets`, so the two disagreed at different depths.
   
   Both now consult one predicate, 
`GrailsViewItems.isHiddenFromOtherSources(appRoot, candidate)`, which looks the 
directory up **by its path relative to `grails-app`** in the existing 
registries. Since those are keyed by relative path, `assets/images` is hidden 
and `assets/vendor/jquery-ui/images` is not, at any depth, with no 
special-casing. `contains()` walks the file's ancestors up to `grails-app` and 
refuses on the first hidden one, so the depth limit is gone rather than raised. 
`isAssetSubfolder` is deleted, so the two cannot drift apart again. Regression 
test `testNestedVendorAssetFoldersStayVisible` builds your `vendor/jquery-ui` 
layout and asserts all four directions.
   
   One scope decision worth stating since it's visible in the diff: 
**artefact-handler directories are not hidden**. `controllers`, `domain`, 
`services` and `taglib` stay visible under Other sources with a 
`shouldShowItem` filter, exactly as Domain Classes, Services and Controllers 
already are — so `contains()` keeps claiming files under them and the filter 
decides per file. "Hidden" now means exactly two things: a registered special 
folder, or a registered asset subfolder. That's pinned by tests rather than 
left incidental.



-- 
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