Skip to content

Add code analysis for attributed model #10

@FiniteReality

Description

@FiniteReality

Right now the AttributedModelSourceGenerator doesn't do extra checks (e.g. return type checks) which means that it'll cause compilation errors if used incorrectly.

For example:

[Group("test")]
public class TestModule : Module
{
    [Command("test")]
    public void DoThing()
    { }
}

Will likely produce a class something like this:

internal class CommandFactory__TestModule__DoThing : ICommand
{
    public async ValueTask<ICommandResult> ExecuteAsync(...)
    {
        var commandClass = new TestModule(...);
        ...
        return await commandClass.DoThing();
        ...
    }
}

Which, as you can imagine, won't work.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions