Facepunch / sbox-issues

175 stars 12 forks source link

Support implicit usings #3392

Closed verdie-g closed 1 year ago

verdie-g commented 1 year ago

For?

S&Box

What can't you do?

Since we don't control the csproj we can't use implict usings which is handy to avoid repeating the same usings in all files.

How would you like it to work?

Add

<ImplicitUsings>enable</ImplicitUsings>

to the generated csproj.

It could make sense to also add

<Using Remove="Sanbox" />

What have you tried?

I've tried creating my own csproj but it seems like it's not something that will be supported: https://github.com/sboxgame/issues/issues/3363.

Additional context

No response

ItsRifter commented 1 year ago

You can just do this in the game class or in a separate one (or wherever). global using [namespace]

that'll use the namespaces in that project and only that.

verdie-g commented 1 year ago

That's indeed a good work-around. Though I would say the ImplicitUsing property still add some value.

DevulTj commented 1 year ago

I still don't see much use for supporting implicit usings. As @ItsRifter suggested, make a file, stick a bunch of global usings in there, and then never worry about it again.