Sublime Forum

Code Refactoring/Indexing of Source Folder

#1

Can Sublime index thru all of a current folder’s source/header files so that any word (function/variable) can be right-clicked and the declaration/definiton/references be instantly fetched?

I know Eclipse and Visual Studio Code/Community can do this, but a c/c++ project has to be created every time. I’d much prefer a lightweight editor, no compiler bloat, where you can study a project quickly without resorting to “Find In Files” or other 4 button/click combination, in order to see where a function is actually defined!

Is this possible, or would a commercial editor (Ultraedit, slickedit, QtCreator etc) be the only way? BTW, I’ve read Netbeans IDE does exactly this, but the memory/cpu usage to run it is not exactly light-weight!
Thanks!

0 Likes

#2

You can CTRL+Click on a method name.

0 Likes

#3

Hmm, nothing seems to happen when I cntrl-click and/or cntrl-doubleclick on a function (or variable).

I just downloaded and installed the latest from the website (Sublime Text 2 V2.0.2 Build 2221). I’m using Win7x64, perhaps not supported on this machine? Do I first have to command it to scan all the files so that it can build a function / variable tree map?

Also how would you select between finding the Declaration, Definition, or All References? For example, on Eclipse once a word is highlighted and right-clicked, a context menu to select appears.

0 Likes

#4
  1. You need ST3.
  2. Ctrl-click is new to me, by default that starts a new selection. There is no default mouse map for goto definition, but it is available in the context menu when right-clicking a word and a symbol is available. If the symbol is defined multiple times in a project, a dropdown (quick panel) appears with the locations.
0 Likes

#5

[quote=“FichteFoll”]1. You need ST3.
2. Ctrl-click is new to me, by default that starts a new selection. There is no default mouse map for goto definition, but it is available in the context menu when right-clicking a word and a symbol is available. If the symbol is defined multiple times in a project, a dropdown (quick panel) appears with the locations.[/quote]

Ah it may be a key binding I setup ages ago, feels native.

0 Likes