-
Notifications
You must be signed in to change notification settings - Fork 266
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
projectorganizer: ignored directory patterns are not applied to project root paths #1283
Comments
I'm not sure if I understand the problem correctly. "root" for the plugin is
Since So how is your project organized - the mounted directories are mounted somewhere inside the project directory itself? Couldn't the problem rather be in the "Index all project files" settings under Project->Properties->Project Organizer which, when enabled, parses all files (and possibly loads their full contents over network)? |
To be clear, the ignore patterns are only applied within the project directory tree, not to the path to the root, so as @techee said, unless the mount points are inside the tree they will not be filtered. Any filter applied to the path to root could only ignore the root and therefore the whole project, which does not make sense, the plugin would not do anything. The point of the plugin is to scan the filesystem and optionally scan all files for symbols, so if the filesystem where the project is stored is slow the plugin will be slow. Possibly you can improve the SSHFS/NFS caching, but startup would probably still be slow as everything in the cache is validated. |
You both seem to ignore the fact that one can have projects where the plugin makes sense and others where it doesn't (work). @techee In the instance I am describing here, the whole project directory is remote. The problem is not the indexing itself but the directory traversal which happens no matter what the index setting is AFAICT - and that it is done synchronously (apparently even in the UI thread). I don't use the plugin's sidebar BTW - I haven't even noticed that there is one till now. I am using the File Browser plugin for my file navigation needs - well that, search in files, and code navigation's and recently projectorganizer's lookup system but I'll take a look in the future. @elextr Since there is no way to disable the plugin per project, ignoring the whole project tree is exactly what I am trying to achieve in the respective cases! Also, since neither documentation nor GUI indicates otherwise, I would argue that it is not at all obvious that the filter does not apply to the project's root directory. One could even argue that the filter should be applied to all the path components leading to the project's root IMHO. This would make effectively disabling the plugin based on the project's location even more generic (but since there is no customization for the plugin's default settings applying it to the rest of the path doesn't make too much sense in this regard). I'd also be fine with an option to disable to plugin/directory traversal on a per project basis (although I actually think projectorganizer does lookups on just the open tabs even without the index from what I've seen in the code!). I am currently using the workaround of having the mountpoint as a subdirectory successfully and that's good enough for now. |
Plugins can be disabled in the plugin manager.
What evidence do you have for that? Directory reading is likely to be much cheaper than reading all the files in that directory. And AFAICT traversal does not enter a directory which matches the directory ignore patterns. So you can likely stop the tree traversal by setting the directory and file ignore patterns to
Correct, Geany is non re-entrant single threaded code because the UI framework, GTK, is single threaded and most of Geany is interacting with the UI.
Documentation contributions welcome.
So thats a UI and storing and restoring the option and making functionality dependent on it and "somebody"s gotta do it. Each of the plugins in this collection are mostly the contributed work of one individual (with (un?)helpful comments from the rest of us ;-). Most plugins are therefore focused on that individuals use-case, in this case large projects on fast machines with local fast storage.
Great. |
Just curious - what are you using the plugin for then?
I can do that - IMO that makes more sense than ignoring the whole project based on the ignored directory patterns. To be clear, this option would disable the whole plugin completely for certain projects because when ProjectOrganizer cannot see files in the project directory, it cannot do anything useful.
I'm not aware of that, could you point me to the code? In any case, the documents in open tabs are opened and parsed by Geany already so the files have to be transferred over network anyway. |
But using patterns allows the plugin to autoselect which projects to disable since it can distinguish between Also it is available now and in release 2.0.
I think thats the idea, for plugins where the project directory is on a slow mount disable the whole PO functionality but have it work for projects that are local. As the OP said "You both seem to ignore the fact that one can have projects where the plugin makes sense and others where it doesn't" |
But I think the problem (if I understand it correctly) is, that when you have a project |
Which is why I showed it as |
I often work with big projects mounted via sshfs or nfs. If the projectogranizer plugin is loaded then geany reads in all directories of the project recursively which (potentially and practically) takes a long time via a network - so much time actually that I cannot use the plugin.
To mitigate the problem I tried using the "Ignored directory patterns" (
ignored_dirs_patterns
) feature by adding*sshfs
to the list as I strictly name the mount points like that. Unfortunately this does not help at all.After looking at the code I am pretty sure this is because
get_file_list
(which is called recursively) does apply all filters to the children of the givenutf8_path
only but notutf8_path
itself. This makes somewhat sense due to the recursive nature of the function. However,prjorg_project_rescan_root
does not apply the filters to the root dir either and thus the filters do not work for my use case. I can of course work around this by nesting the mount point within the project directory but that's not exactly ideal. Sinceprjorg_project_rescan_root
sets up theignored_dirs_list
anyway it would be quite easy to add a check for that before initially callingget_file_list
AFAICT. What do you think?The text was updated successfully, but these errors were encountered: