Skip to content
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

Add option to declare types outside of class #153

Open
shayded-exe opened this issue Oct 11, 2023 · 1 comment
Open

Add option to declare types outside of class #153

shayded-exe opened this issue Oct 11, 2023 · 1 comment

Comments

@shayded-exe
Copy link

I would like to be able to have structs declared directly in the containing namespace, instead of wrapped in the interop class.

@lithiumtoast
Copy link
Member

Hey @shayded-exe,

The syntax nodes get "added" to the container syntax node here: https://github.com/bottlenoselabs/c2cs/blob/main/src/cs/production/C2CS.Tool/Features/WriteCodeCSharp/Domain/CodeGenerator/CSharpCodeGenerator.cs#L260.

Changing it so it uses the namespace syntax node directly would be easy enough; I would suggest having it as an option from the config to use namespace syntax node or class syntax node.

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

No branches or pull requests

2 participants