Repository navigation
Conversation
|
Thanks. Generally going in the right direction in my opinion. Initial comments after quick glance through -
|
5fb379f to
f545faf
Compare
|
changes:
i think that would be the first 4 points of #9737 (comment). Forgot about 5, next sync maybe. remember that only the commits marked with |
|
Thanks for taking on board the comments. This is looking exciting! Will take a deeper dive into the code and test some things as soon as I can.
I'm still trying to understand your concern here (following on from conversation elsewhere). My initial view looking at the updated code, in particular the action, is that is might actually handle one more thing - clearing the non-project cache when required. That feels like an implementation detail that a consumer of this method shouldn't need to consider. If it's actually needed?! |
| Project existing = findProject(projectDirectory); | ||
| if (existing != null) { | ||
| return existing; | ||
| } | ||
| for (DirectoryProjectProvider provider : Lookup.getDefault().lookupAll(DirectoryProjectProvider.class)) { | ||
| Project project = provider.createProject(projectDirectory); | ||
| if (project != null) { | ||
| return project; | ||
| } | ||
| } | ||
| return null; |
There was a problem hiding this comment.
assuming we keep this this way: we could probably move this whole section into a default method in impl which is a constant of type ProjectManagerImplementaiton (yes its an interface despite its name)
since there can be never enough abstraction layers between the client and the impl. This would be layer 3 I believe.
- the same file is used for both: marker and config storage - initial marker is an empty properties file (which is valid) - mode switch from marker to private moves properties on access - file name is brandable note: NB's auxiliary config storage has a 5s IO flush delay
- global file filters are enabled by default - optional per-project filter added - both configurable via project properties
f545faf to
0e1d853
Compare
|
rebased and restructured this PR so that all changes follow the API commit, updated description and added screenshots. |
Consulted when a directory is about to become a group in the projects view, before falling back to the stock group; an implementation may promote it to a project of its own type, per-user and non-intrusively.
Returns the project existing in a directory, or asks the registered DirectoryProjectProvider instances to create one; null if no provider claims the directory.
GenericProject.promoteToProject() promotes a directory per-user and non-intrusively (no marker file in the directory); the new group is shown as the subprojects group of the promoted project.
On load, a legacy directory group is turned into a subprojects group, resolving its directory to a project (promoting it if needed); DirectoryGroup and its edit panel are removed.
New "Open Directory as Project" checkbox in the project chooser, persisted like the sibling options and off by default. While it is checked, OK/Enter accepts a non-project directory and promotes it via ProjectManager.findOrCreateDirProject() (a per-user promotion that writes no marker file into the directory). The checkbox is disabled while the selection contains projects only, so Enter keeps its drill-in behaviour for arbitrary folders. Co-authored-by: Jaroslav Tulach <[email protected]>
0e1d853 to
5e3f29c
Compare
| } | ||
| Project p = null; | ||
| try { | ||
| p = ProjectManager.getDefault().findProject(child); |
There was a problem hiding this comment.
- update the logic to match Unify and speed opening of
DirectoryGroupup #9821
|
Generally looking good, thanks! Minor concern with the new checkbox and action in the platform. Can we automatically hide these if no directory project provider is registered? Or, as action can already be hidden, maybe we just need a way to brand which checkboxes can show in the Open Project dialog? |
This PR builds on top of #9736 and contains SPI and API for directory projects in the first two commits and several features/actions which were either migrated or added to use that new API
Only commits prefixed with [2] are meant for this PR
API:
DirectoryProjectProviderSPI added withGpDirectoryProjectProvideras reference implSingle method interface defines a single
createProject(FileObject dir)method and is located inide/projectuiapiProjectManagerhas now a new API methodfindOrCreateDirProject()e156ee6 Add DirectoryProjectProvider SPI
84bf4bd Add ProjectManager.findOrCreateDirProject
Refactors the directory-based project group action to use the new generic project type as base, combined with the pre-existing
SubprojectsGroup. (see #9738 for generated design doc)-> Relationship is now reversed. Functionality moved into the
Lookupinstead of hardcoded logic within a specialized Group impl. (could be potentially swapped out if needed)Migration path was added to restore groups (old user config) of kind
directoryas generic project basedSubprojectsGroup.Right click menu action integration + Open Project dialog integration
Assisted-by: qwen3.8-27b + granite4.2:8bscreenshots
Open as Generic Project (active on all folders which aren't projects yet)

Open Project dialog:
