Having trouble excluding a folder from a scope
Answered
Hi, I'm trying to create a scope that shows the files under buildSrc and buildSrc/src while excluding buildSrc/build but I can't figure it out.
This shows the files under buildSrc but shows additional files I don't want to see.
file[*buildSrc*]:*/
These do exactly the same, including files found under buildSrc/build/generated-sources/
file[*buildSrc*]:*/&&!file:*/build//*
file[*buildSrc*]:*/&&!file[*buildSrc*]:*/build//*
I think I've tried every combination of * / [ ] and : but nothing helps.
If I select the folders I don't want and click on "exclude recursively" it adds the following
&&!file[orx.buildSrc.main]:*/
which hides a bunch of files I do want to see.
Any ideas? I wish this was just a plain regex...
Please sign in to leave a comment.
If you go to Settings (
⌘ + ,on macOS orCtrl + Alt + Son Win/Linux) > Appearance & Behavior > Scopes > select needed scope > select the Project view in the dropdown > then mark BuildSrc (project root) as Include Recursively and BuildSrc/build** folder as Exclude Recursively:Does that create a scope you need?
Thank you for writing! Actually it's not working for me.
In case you want to try, the repo is this: https://github.com/openrndr/orx
Can you try excluding following folders in the project window (right-click on folder > Mark Directory as > Excluded):
-
buildSrc/build/generated-sources/kotlin-dsl-accessors/kotlin-
buildSrc/build/generated-sources/kotlin-dsl-external-plugin-spec-builders/kotlin-
buildSrc/build/generated-sources/kotlin-dsl-plugins/kotlinAfter that you should be able to normally include/exclude buildSrc subfolders in scopes.
The issue with partially excluded folders seems to be similar to this one: https://youtrack.jetbrains.com/issue/IDEA-170796
I tried but couldn't get it to show the content of buildSrc and buildSrc/src/ while hiding buildSrc/build/.
What I'm doing is writing a Gradle Task to automatically create a scopes.xml file to make the project view less cluttered (for users of OPENRNDR). Here a video showing it in action:
https://user-images.githubusercontent.com/108264/221540406-7f0ab00b-6957-42d6-9ad9-c21c3c9ea585.mp4
Framework users are not affected by this (no buildSrc). Framework developers will have to remember not to click on Expand all: those folders contain hundreds of files.
Right clicking to exclude folders wouldn't be ideal (and unfortunately didn't work).
Thank you again :)
Yes, unfortunately the workaround to: exclude those build/ subfolders as content roots - would break the project build, so it is not really useful.
I managed to reproduce the issue and couldn't find any workaround to exclude the mentioned subfolders from the scope pattern. We have a bug already filed for this issue, however it is pretty old: https://youtrack.jetbrains.com/issue/IDEA-131199. I added your case to it. You can vote for it and follow its progress.
Issue voted and followed.
Thank you for taking a look into it :)