func main() { var err error proj, err = project.OpenProject("testprj/test.gop") if err != nil { log.Println(err) return } codecomplete.Init(proj) g := gocui.NewGui() if err := g.Init(); err != nil { log.Panicln(err) } defer g.Close() g.SetLayout(layout) if err := keybindings(g); err != nil { log.Panicln(err) } g.SelBgColor = gocui.ColorGreen g.SelFgColor = gocui.ColorBlack g.ShowCursor = true err = g.MainLoop() if err != nil && err != gocui.Quit { log.Panicln(err) } }
func main1() { p, err := project.OpenProject("testprj/test.gop") if err != nil { log.Println(err) return } codecomplete.Init(p) file := p.GetFile("test.go") if file != nil { x := 4 y := 33 off := file.GetOffset(x, y) log.Println(x, y, off) log.Println(codecomplete.Complete(p, file, off)) } /*err = build.GetDepends(p, false) if err != nil { log.Println(err) } err = build.Build(p) if err != nil { log.Println(err) }*/ }