The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
qcsjy

go 开发工具自动补全问题

  •  1
     
  •   qcsjy · Jun 14, 2014 · 2548 views
    This topic created in 4375 days ago, the information mentioned may be changed or developed.
    现在有如下的目录结构(beego项目):

    .
    ├── conf
    │ └── app.conf
    ├── controllers
    │ └── default.go
    ├── main.go
    ├── models
    │ └── models.go
    ├── routers
    │ └── router.go
    └── views
    └── index.tpl
    开发工具: LiteIDE, Eclipse, IntelliJ

    我在models.go里定义了一些struct和method, 然后在controller里使用, 发现无法自动补全这些符号.

    但是引用$GOPATH下的其它库都能自动补全

    请问, 这是gocode的问题么? 还是我哪里弄错了?
    Supplement 1  ·  Jun 15, 2014
    .
    ├── main.go
    └── modules
    └── modules.go

    为了简化,现在的目录结构如上所示.
    我在modules.go里定义了一个struct, 然后在main.go里引用.
    我发现只有liteIDE能够auto complete, 其它工具都不行.
    难道只有liteIDE对此做了优化而不仅仅依靠gocode?
    5 replies    2015-01-05 01:23:22 +08:00
    missdeer
        1
    missdeer  
       Jun 14, 2014 via iPhone   ❤️ 1
    都加到GOPATH里不就行了
    Comdex
        2
    Comdex  
       Jun 14, 2014   ❤️ 1
    首先项目要放在GOPATH里,还有要先编译才有自动补全提示
    qcsjy
        3
    qcsjy  
    OP
       Jun 14, 2014
    @Comdex 原来是没build的缘故,我还以为能静态分析呢. thx
    nybux
        4
    nybux  
       Jun 14, 2014
    先要go install modules
    otmb
        5
    otmb  
       Jan 5, 2015
    用的啥编辑器?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2874 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 13:09 · PVG 21:09 · LAX 06:09 · JFK 09:09
    ♥ Do have faith in what you're doing.