-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[C#] minor improvement to reduce unused using statements #1070
base: main
Are you sure you want to change the base?
Conversation
nice! This has been on the list under #713 "fix imports so they are only included if needed" |
There's more 2 do here, but its a start. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seem the tests are passing. Is there more to do?
@@ -133,6 +121,8 @@ pub enum FunctionLevel { | |||
pub struct CSharp { | |||
opts: Opts, | |||
name: String, | |||
//TODO remove unused |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the todo here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because its not perfect, the Intefaces in particular still have unused usings
, e.g. BindingsWorld.wit.imports.foo.bar.IMyImport.cs
has
// Generated by `wit-bindgen` 0.34.0. DO NOT EDIT!
// <auto-generated />
#nullable enable
using System.Text;
using System.Runtime.InteropServices;
namespace BindingsWorld.wit.imports.foo.bar;
public interface IMyImport {
public class Address {
public readonly uint field;
public readonly bool attribute;
public Address(uint field, bool attribute) {
this.field = field;
this.attribute = attribute;
}
}
}
Where neither using
is required. The generation of the using
statements is shared between files which makes it slightly tricky to get this last bit perfect.
No description provided.