在LiteIDE中查看Golang包的源代码

huangapple go评论77阅读模式
英文:

View source for Golang packages in LiteIDE

问题

在LiteIDE中查看Golang包的源代码最简单的方法是什么?

例如,当有如下代码时:

import "github.com/revel/revel"

func init() {
    // Filters is the default set of global filters.
    revel.Filters = []revel.Filter{
        revel.PanicFilter,             // Recover from panics and display an error page instead.
        revel.RouterFilter,            // Use the routing table to select the right Action
        revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
        revel.ParamsFilter,            // Parse parameters into Controller.Params.
        revel.SessionFilter,           // Restore and write the session cookie.
        revel.FlashFilter,             // Restore and write the flash cookie.
        revel.ValidationFilter,        // Restore kept validation errors and save new ones from cookie.
        revel.I18nFilter,              // Resolve the requested language
        HeaderFilter,                  // Add some security based headers
        revel.InterceptorFilter,       // Run interceptors around the action.
        revel.CompressFilter,          // Compress the result.
        revel.ActionInvoker,           // Invoke the action.
    }
}

如果我想知道revel.PanicFilter到底是做什么的,我会访问http://github.com/revel/revel并查看源代码。

在使用C++(QtCreator)时,我只需要按下Ctrl+单击,就可以访问声明/实现。

我的“跳转到声明”菜单在LiteIDE中不起作用,也许是因为包被压缩在.a存档中?

file pkg/linux_amd64/github.com/revel/revel.a 
pkg/linux_amd64/github.com/revel/revel.a: current ar archive

是否有一种更简单的方法,像在QtCreator中一样,跳转到声明以查看源代码?

英文:

What's the easiest way to view source code of golang packages in LiteIDE?

for example, when there are code like this:

import "github.com/revel/revel"

func init() {
	// Filters is the default set of global filters.
	revel.Filters = []revel.Filter{
		revel.PanicFilter,             // Recover from panics and display an error page instead.
		revel.RouterFilter,            // Use the routing table to select the right Action
		revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
		revel.ParamsFilter,            // Parse parameters into Controller.Params.
		revel.SessionFilter,           // Restore and write the session cookie.
		revel.FlashFilter,             // Restore and write the flash cookie.
		revel.ValidationFilter,        // Restore kept validation errors and save new ones from cookie.
		revel.I18nFilter,              // Resolve the requested language
		HeaderFilter,                  // Add some security based headers
		revel.InterceptorFilter,       // Run interceptors around the action.
		revel.CompressFilter,          // Compress the result.
		revel.ActionInvoker,           // Invoke the action.
	}
}

If I want to know what's the revel.PanicFilter really do, I would visit the http://github.com/revel/revel and seek the source code..

When using C++ (QtCreator), i would only need to ctrl+click then it would visit the declaration/implementation.

My Jump to declaration menu doesn't work in LiteIDE, maybe because the packages are compressed in .a archive?

file pkg/linux_amd64/github.com/revel/revel.a 
pkg/linux_amd64/github.com/revel/revel.a: current ar archive

Is there an easier way to go to declaration to view the source just like in QtCreator?

答案1

得分: 5

F2键在Lite IDE v24.3中跳转到库函数的声明。

英文:

F2 key jumps to the declaration of library function in Lite IDE v24.3

答案2

得分: 1

Ctrl+Shift+J在我的LiteIDE 26上有效。F2不起作用!

英文:

Ctrl+Shift+J works for me on LiteIDE 26. F2 doesnt work!

huangapple
  • 本文由 发表于 2014年6月12日 17:42:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/24181198.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定