Open refi64 opened 2 years ago
@refi64 Thanks a bunch for this PR!
Sorry for the delay, I'll review and test in the following days.
I think this is rather restricted. Even in a same project you will still have multiple targets for multi services. Better just provide a glob pattern for each opening file to map it to a particular entry point, instead of limiting it to some sub projects.
For example:
- glob: [my_project_1/src/**/*.cr]
main: my_project_1/src/my_project_1.cr
cwd: my_project_1
- glob: [src/**/*.cr]
main: src/main_project.cr
for the current working file, just find the first matching glob pattern.
This is more verbose than the original proposal, but I think it offers more flexibility.
If it helps at all, how I ended up adding multi-root projects to the vscode extension is by running the dependencies tool on each of the targets in the shards.yml and selecting the first one that had my current file in the output.
This adds the ability to create a
.crystalline.yml
file in the workspace root containing a list of project folders. Entry points andrequire
s will then all be resolved relative to the individual projects, rather than the root of the workspace.I would appreciate some more testing! It seems to all work as expected, but I'm also an individual with a limited "project pool" to test on.