Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Unused using directive when exculding interfaces #48

Open
Portikus opened this issue Jul 30, 2018 · 3 comments
Open

Unused using directive when exculding interfaces #48

Portikus opened this issue Jul 30, 2018 · 3 comments

Comments

@Portikus
Copy link
Contributor

I referenced a project with a nuget package. The referenced project contains one interface with at least one method that returns types from the nuget package.
I excluded this interface and the interface is successfully ignored by SimpleStubs.
However, the using directive to the nuget package is still there and I cannot build the UnitTest project.
I have to reference the nuget package to make it build.

@nehmebilal
Copy link
Collaborator

Does the file containing the excluded interface contain any other interfaces? SimpleStubs will copy the using directives from a given file if there is at least one interface in that file that is not ignored.

@Portikus
Copy link
Contributor Author

Portikus commented Aug 1, 2018

No that's not the case. The ignored interface is the only one with a using of a type of that nuget package.

@nehmebilal
Copy link
Collaborator

Ok thanks. I suspect that this is copying the usings from the whole namespace, not just from the files containing non-ignored interfaces.

If the ignored interface was in a different namespace, I believe the using would not be copied. We should probably just copy the usings from the files containing used interfaces instead of resolving all usings in the namespace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants