goplantuml icon indicating copy to clipboard operation
goplantuml copied to clipboard

Support generic struct types

Open aaronjwood opened this issue 3 years ago • 5 comments

This is the first phase for supporting generics. Attaching the generated SVG from the testingsupport code here for reference:

design

aaronjwood avatar Oct 18 '22 23:10 aaronjwood

I've included a fix for breakages on codebases which use generic method receivers. For example, this used to incorrectly parse to "":

type Foo[T string] struct {
}

func (h *Foo[T]) SomeMethod() {}

aaronjwood avatar Oct 19 '22 18:10 aaronjwood

oops, I started doing the same thing :( But I stuck the patch in issue #148 -- mine doesn't support interfaces yet. I hate duplicating effort!

daniel-santos avatar Feb 01 '23 02:02 daniel-santos

Hello @aaronjwood , Please never include reformatting or refactoring in a patch that makes functional changes, as this makes it very difficult to review. Separate out reformatting and whitespace changes into a separate patch, refactoring into another and the actual functional changes into a third.

I'm comparing your approach to mine, so I needed to separate these out, so here's an example: https://github.com/daniel-santos/goplantuml/tree/awood-cleaned-up (that I won't promise is correctly separated out).

daniel-santos avatar Feb 01 '23 19:02 daniel-santos

Hello @aaronjwood !

I just wanted to let you know that I'm working on a patch set, but it's a fairly dramatic departure, so it might end up a fork :frowning_face: Anyway, I'm using some of your code, mostly the test cases. I'm not actually sure that I know what I'm doing, but I guess we'll see where it ends up!

I was originally testing using an old version of plantuml without realizing it and things weren't coming out right. The big thing to me is the ability of plantuml to be able to export to xmi now. What would help me the most for my project would be to have my model imported into a UML editor and be able to render multiple class and sequence diagrams and then be able to update those diagrams as my code changes (by just updating the model part of the .xmi file).

Thanks for your work on this!

daniel-santos avatar Feb 12 '23 16:02 daniel-santos

@jfeliu007 any news on whether this will be merged?

glacials avatar May 18 '23 20:05 glacials