How to get Outline in GoClipse

GoClipse cannot show the Outline of a Go source file with just a default installation of Go. You will find that the Outline view is empty and pressing Ctrl + O to get an Outline throws up an error. For Go, the Outline is generated using a tool called Oracle.

  • Install Oracle:
$ go get golang.org/x/tools/cmd/oracle

This installs an oracle binary file in $GOPATH/bin directory

  • Open Windows -> Preferences -> Go -> Tools and set the path of Oracle.

  • Restart GoClipse. Outline view should show the details for your currently open source file now.

Tried with: GoClipse 0.14.1, Eclipse 4.5.2, Go 1.6.2 and Ubuntu 14.04

No outline for C++ source file in Nsight Eclipse

Add the mapping for C++ source file in Nsight
Add the mapping for C++ source file in Nsight

Problem

The Outline view shows the variables, functions and classes in the file currently open in the Editor in Nsight Eclipse. The Outline is filled for .cu and .h files. However, I found that it is empty for .cpp source files.

Solution

The Outline is not displayed for C++ source files because Nsight Eclipse has not mapped .cpp file to the C++ language. This filetype-to-language mapping is necessary for the Outline to the displayed.

Go to Window -> Preferences -> C/C++ -> Language mappings. You will find that only C and C++ header files have been mapped here. Add a mapping from C++ Source File to the GNU C++ language. The Outline is immediately shown for C++ source files after this is applied.

Tried with: Nsight Eclipse 6.5 and Ubuntu 14.04

Link with Editor feature of Eclipse

20150301_link

The Project Explorer and Outline views in Eclipse have a Link with Editor feature that can be very useful. This can be enabled in either view, by clicking the down arrow button in the view and choosing Link with Editor (see screenshot above).

  • If Link with Editor is enabled in Project Explorer: The current file open in the Editor will be highlighted in Project Explorer.

  • If Link with Editor is enabled in Outline: The class or method at the location of the cursor will be highlighted in Outline.

Tried with: Eclipse 4.4.1 Luna and Ubuntu 14.04