diff --git a/plab/classdiag.go b/plab/classdiag.go index c1f600341c5b91a653ad35d5d4c19d4b840d6c1a..67de95c93a6067e1fdccbd822715bf01107803c0 100644 --- a/plab/classdiag.go +++ b/plab/classdiag.go @@ -54,6 +54,8 @@ func genPlantUMLStr(classes map[string]*Class) { output.WriteString(fmt.Sprintln("skinparam classAttributeIconSize 0")) output.WriteString(fmt.Sprintln("set namespaceSeparator none")) + skipDep := make(map[string][]string) + for _, c := range classes { after := "" if c.Superclass.realClass != nil { @@ -117,10 +119,18 @@ func genPlantUMLStr(classes map[string]*Class) { for _, a := range c.Annotations { if a.TypeName == "Docs" { for _, e := range a.Elements { + e.Value = unescape(e.Value) switch e.QualifiedName { case "projlab.Docs.uml": - e.Value = unescape(e.Value) output.WriteString(fmt.Sprintln(e.Value)) + case "projlab.Docs.skipdep": + prevDep := skipDep[c.Name] + parts := strings.Split(e.Value, ",") + for _, p := range parts { + p = strings.TrimSpace(p) + prevDep = append(prevDep, p) + } + skipDep[c.Name] = prevDep } } } @@ -144,6 +154,9 @@ func genPlantUMLStr(classes map[string]*Class) { for _, c := range classes { deps := make([]string, 0) + for _, d := range skipDep[c.Name] { + skip[d] = append(skip[d], c.Name) + } hasdep := func(dep string) bool { for _, d := range deps { if d == dep {