We don't have any use-cases for those fields. At least I'm not aware of any.
And apparently neither Rust nor Typescript seem to truly require such configs.
Cargo doesn't actually use its includes/excludes field for anything important. That field is purely for publishing.
https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields
And I also noticed that Rust Analyzer only has inclusions and exclusions as a very advanced config. One that is rarely ever used, and is implementation specific. https://rust-analyzer.github.io/book/configuration#vfs.extraIncludes
It ignores the cargo includes/excludes fields.
Typescript is also happy to ignore the "includes" and "excludes" fields. Their exact behaviour seems underspecified to me, but from what I can tell, they're only so that the language server/other tools know which set of files to start with. If I import another file from outside the "includes", then Typescript will be happy to do that. And will start suggesting autoimports from that file everywhere in my project.
dummy-ts.zip
Use case: Excluding tests that are a part of the repository
Bundler specific configuration.
The language server should still analyze those test files. And the code formatter should still format the code in them.
e.g. wesl-rs, will follow the Cargo.toml configuration, and thus end up excluding files that are marked as exclude. Implementation detail: This happens because wesl-rs projects will ship .wesl files, and run the build script on the library user's machine.
Use case: Excluding "snapshot" tests
Just don't put those in your src folder. Then neither the language server, nor the bundler will try to use them.
We don't have any use-cases for those fields. At least I'm not aware of any.
And apparently neither Rust nor Typescript seem to truly require such configs.
Cargo doesn't actually use its includes/excludes field for anything important. That field is purely for publishing.
https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields
And I also noticed that Rust Analyzer only has inclusions and exclusions as a very advanced config. One that is rarely ever used, and is implementation specific. https://rust-analyzer.github.io/book/configuration#vfs.extraIncludes
It ignores the cargo includes/excludes fields.
Typescript is also happy to ignore the "includes" and "excludes" fields. Their exact behaviour seems underspecified to me, but from what I can tell, they're only so that the language server/other tools know which set of files to start with. If I import another file from outside the "includes", then Typescript will be happy to do that. And will start suggesting autoimports from that file everywhere in my project.
dummy-ts.zip
Use case: Excluding tests that are a part of the repository
Bundler specific configuration.
The language server should still analyze those test files. And the code formatter should still format the code in them.
e.g. wesl-rs, will follow the Cargo.toml configuration, and thus end up excluding files that are marked as
exclude. Implementation detail: This happens becausewesl-rsprojects will ship.weslfiles, and run the build script on the library user's machine.Use case: Excluding "snapshot" tests
Just don't put those in your src folder. Then neither the language server, nor the bundler will try to use them.