mirror of
https://shylinux.com/x/icebergs
synced 2025-06-26 18:37:29 +08:00
opt git.spide
This commit is contained in:
parent
60ddf0d12d
commit
fc30bb2b32
@ -91,8 +91,9 @@ func init() {
|
|||||||
m.Cmd(mdb.RENDER, mdb.CREATE, GODOC, GODOC, c.Cap(ice.CTX_FOLLOW))
|
m.Cmd(mdb.RENDER, mdb.CREATE, GODOC, GODOC, c.Cap(ice.CTX_FOLLOW))
|
||||||
|
|
||||||
m.Cmd(mdb.PLUGIN, mdb.CREATE, MOD, MOD, c.Cap(ice.CTX_FOLLOW))
|
m.Cmd(mdb.PLUGIN, mdb.CREATE, MOD, MOD, c.Cap(ice.CTX_FOLLOW))
|
||||||
m.Cmd(mdb.PLUGIN, mdb.CREATE, MOD, MOD, c.Cap(ice.CTX_FOLLOW))
|
m.Cmd(mdb.RENDER, mdb.CREATE, MOD, MOD, c.Cap(ice.CTX_FOLLOW))
|
||||||
m.Cmd(mdb.RENDER, mdb.CREATE, SUM, SUM, c.Cap(ice.CTX_FOLLOW))
|
|
||||||
|
m.Cmd(mdb.PLUGIN, mdb.CREATE, SUM, SUM, c.Cap(ice.CTX_FOLLOW))
|
||||||
m.Cmd(mdb.RENDER, mdb.CREATE, SUM, SUM, c.Cap(ice.CTX_FOLLOW))
|
m.Cmd(mdb.RENDER, mdb.CREATE, SUM, SUM, c.Cap(ice.CTX_FOLLOW))
|
||||||
|
|
||||||
}},
|
}},
|
||||||
|
@ -87,6 +87,7 @@ func init() {
|
|||||||
Configs: map[string]*ice.Config{
|
Configs: map[string]*ice.Config{
|
||||||
INNER: {Name: "inner", Help: "编辑器", Value: kit.Data(
|
INNER: {Name: "inner", Help: "编辑器", Value: kit.Data(
|
||||||
"source", kit.Dict(
|
"source", kit.Dict(
|
||||||
|
"license", "true",
|
||||||
"makefile", "true",
|
"makefile", "true",
|
||||||
"shy", "true", "py", "true",
|
"shy", "true", "py", "true",
|
||||||
|
|
||||||
|
2
exec.go
2
exec.go
@ -17,7 +17,7 @@ func (m *Message) TryCatch(msg *Message, safe bool, hand ...func(msg *Message))
|
|||||||
case io.EOF:
|
case io.EOF:
|
||||||
case nil:
|
case nil:
|
||||||
default:
|
default:
|
||||||
fileline := kit.FileLine(5, 2)
|
fileline := kit.FileLine(4, 2)
|
||||||
m.Log(LOG_WARN, "catch: %s %s", e, fileline)
|
m.Log(LOG_WARN, "catch: %s %s", e, fileline)
|
||||||
m.Log(LOG_INFO, "chain: %s", msg.Format("chain"))
|
m.Log(LOG_INFO, "chain: %s", msg.Format("chain"))
|
||||||
m.Log(LOG_WARN, "catch: %s %s", e, fileline)
|
m.Log(LOG_WARN, "catch: %s %s", e, fileline)
|
||||||
|
@ -291,16 +291,73 @@ var Index = &ice.Context{Name: "git", Help: "代码库",
|
|||||||
m.Cmdy("total", arg)
|
m.Cmdy("total", arg)
|
||||||
}},
|
}},
|
||||||
|
|
||||||
"spide": {Name: "spide name=auto auto", Help: "趋势图", Meta: kit.Dict(
|
"spide": {Name: "spide path=auto file=auto auto", Help: "结构图", Meta: kit.Dict(
|
||||||
"display", "/plugin/story/spide.js",
|
"display", "/plugin/story/spide.js",
|
||||||
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
if len(arg) > 0 && arg[0] == "inner" {
|
||||||
|
arg[1] = path.Join("usr", arg[1])
|
||||||
|
m.Cmdy("web.code.inner", arg[1:])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
m.Option("_display", "table")
|
m.Option("_display", "table")
|
||||||
m.Cmdy("total", arg)
|
m.Cmdy("total", arg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Option(nfs.DIR_DEEP, "true")
|
if len(arg) == 1 {
|
||||||
m.Cmdy(nfs.DIR, mdb.RENDER, nfs.DIR, "", path.Join("usr", arg[0]))
|
m.Option(nfs.DIR_DEEP, "true")
|
||||||
|
m.Cmdy(nfs.DIR, mdb.RENDER, nfs.DIR, "", path.Join("usr", arg[0]))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
tags := ""
|
||||||
|
m.Option(cli.CMD_DIR, path.Join("usr", arg[0]))
|
||||||
|
if strings.HasSuffix(arg[1], ".go") {
|
||||||
|
tags = m.Cmdx(cli.SYSTEM, "gotags", arg[1])
|
||||||
|
for _, line := range strings.Split(tags, "\n") {
|
||||||
|
m.Debug("line: %v", line)
|
||||||
|
if len(line) == 0 || strings.HasPrefix(line, "!_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
ls := kit.Split(line, "\t ", "\t ", "\t ")
|
||||||
|
name := ls[3] + ":" + ls[0]
|
||||||
|
switch ls[3] {
|
||||||
|
case "m":
|
||||||
|
if strings.HasPrefix(ls[5], "ctype") {
|
||||||
|
name = strings.TrimPrefix(ls[5], "ctype:") + ":" + ls[0]
|
||||||
|
} else if strings.HasPrefix(ls[6], "ntype") {
|
||||||
|
name = "-" + ls[0]
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
case "w":
|
||||||
|
t := ls[len(ls)-1]
|
||||||
|
name = "-" + ls[0] + ":" + strings.TrimPrefix(t, "type:")
|
||||||
|
}
|
||||||
|
|
||||||
|
m.Push("name", name)
|
||||||
|
m.Push("file", ls[1])
|
||||||
|
m.Push("line", strings.TrimSuffix(ls[2], ";\""))
|
||||||
|
m.Push("type", ls[3])
|
||||||
|
m.Push("extra", strings.Join(ls[4:], " "))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tags = m.Cmdx(cli.SYSTEM, "ctags", "-f", "-", arg[1])
|
||||||
|
for _, line := range strings.Split(tags, "\n") {
|
||||||
|
if len(line) == 0 || strings.HasPrefix(line, "!_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
ls := kit.Split(line, "\t ", "\t ", "\t ")
|
||||||
|
m.Push("name", ls[0])
|
||||||
|
m.Push("file", ls[1])
|
||||||
|
m.Push("line", "1")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m.Sort("line", "int")
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user