Skip to content

Conversation

@Xcodo
Copy link
Contributor

@Xcodo Xcodo commented Mar 13, 2025

Finishes the proposal in #40.

The algorithm is very simple

  1. Match all files in the include patterns
  2. Match all files in the exclude patterns
  3. Remove any files which match an exclude pattern from the include files.

Potentially it would be better to have a layered approach (exact matches first, then wildcard patterns etc.) but I think this is fine for most use cases. It certainly works for the VUnit files.

This is the most rust I've written, so please feel free to alter anything that's not idiomatic.

I've updated the example project TOML, but didn't add wildcards and excludes for PoC as it was going to end up with as many lines as the explicit inclusion!

Copy link
Contributor

@Schottkyc137 Schottkyc137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for contributing this feature! I think the implementation is really solid, but could be improved in one or two points regarding code duplication. Other than that, I really like the simplifications that this change brings to the example project and others like it. It's not often that a pull request has more deleted lines than lines that were added (which is a good thing!)

@Xcodo
Copy link
Contributor Author

Xcodo commented Mar 14, 2025

Thanks for the feedback. All your points make sense, I'll try to have a look again in the next few days and simplify it.

@Schottkyc137 Schottkyc137 merged commit 1b864e6 into VHDL-LS:master Mar 20, 2025
10 checks passed
@Xcodo Xcodo deleted the exclude_files branch March 20, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants