The ZigDependencyLibraryRootProvider takes every project found and registers its directory as a SyntheticLibrary source root. There is no check whether the directory is local user code or a package fetched into the zig cache.
I'm writing a custom C++ Game Engine and use Zig as the Build System, so this Plugin is amazing. Unfortunately, it breaks the indexing of all engine-related C++ files in Rider for my Solution (I have not tested other IDEs).
By having this dependency everything in the engine is now considered an external library even though my solution contains this directory
.dependencies = .{
.Engine = .{
.path = "../Engine",
.lazy = false,
}
},
I fixed it in my fork by only considering cached dependencies as external, so every dependency declared with .path is ignored. You can check it out here.
I'm not opening a pull request, as this is probably not what you want, with the cache-only filter, .path deps pointing outside the open project also stop showing under External Libraries and lose index features.
I tried fixing it by checking if the path is inside the solution, but both attempts failed, using ProjectFileIndex.isInContent() causes an infinite recursion inside getAdditionalProjectLibraries and ProjectRootManager.getInstance(project).contentRoots is empty, probably caused by Riders frontend / backend architecture.
Maybe you have some idea how to fix this, or maybe you can add my fix as an option to your plugin.
Cheers
The `ZigDependencyLibraryRootProvider` takes every project found and registers its directory as a SyntheticLibrary source root. There is no check whether the directory is local user code or a package fetched into the zig cache.
I'm writing a custom C++ Game Engine and use Zig as the Build System, so this Plugin is amazing. Unfortunately, it breaks the indexing of all engine-related C++ files in Rider for my Solution (I have not tested other IDEs).
By having this dependency everything in the engine is now considered an external library even though my solution contains this directory
```
.dependencies = .{
.Engine = .{
.path = "../Engine",
.lazy = false,
}
},
```
I fixed it in my fork by only considering cached dependencies as external, so every dependency declared with `.path` is ignored. You can check it out [here](https://codeberg.org/Qygon/zigbrains/commit/7ffb6cc6d436fcd74c5ac19bfddd70413f6884dd).
I'm not opening a pull request, as this is probably not what you want, with the cache-only filter, `.path` deps pointing outside the open project also stop showing under External Libraries and lose index features.
I tried fixing it by checking if the path is inside the solution, but both attempts failed, using `ProjectFileIndex.isInContent()` causes an infinite recursion inside `getAdditionalProjectLibraries` and `ProjectRootManager.getInstance(project).contentRoots` is empty, probably caused by Riders frontend / backend architecture.
Maybe you have some idea how to fix this, or maybe you can add my fix as an option to your plugin.
Cheers