1

There is any link creator for sublime text 2?

for example to manually set: fn1 is called by fn2 because of X-reason

I would like to know who calls this method and why, internally (and maybe externally) in my project.

Totty.js
  • 15,563
  • 31
  • 103
  • 175
  • It is very difficult to understand what's being asked here. It does not include a programming language. – Mikko Ohtamaa Feb 27 '13 at 13:14
  • it doesn't need. It only have to link to a bunch of characters, like a method name definition – Totty.js Feb 27 '13 at 14:10
  • Would Find in all files, with a certain regular expression depending on how method name is defined in your programming language, on the whole project do the magic? – Mikko Ohtamaa Feb 27 '13 at 15:27
  • it could do, but I would like something more specialized like a plugin if possible.. – Totty.js Feb 27 '13 at 15:29

1 Answers1

0

It depends on the programming language. Unfortunately, knowing callees requires full compilation of and analysis of source code and even then it is not always possible. This is not limited to Sublime and the problem is discussed elsewhere.

Statically compiled languages, like C, were static analysis is possible this can be done with existing plugins like CTags https://github.com/SublimeText/CTags

Dynamic languages like PHP, Python and Ruby cannot get such a feature due to nature of the language, as you can resolve the content of the object (this) only in run-time.

You may be able manually extracting type and calling information. In this blog post (of mine) one project does it to create .sublime-complete file:

http://opensourcehacker.com/2013/03/04/javascript-autocompletions-and-having-one-for-sublime-text-2/

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
  • For Javascript the refactoring use case is not different from PHP or Python and you simply cannot do it reliably, because this information is available only on run-time due to the nature of language. Just use the advanced search to find all callees. – Mikko Ohtamaa Feb 28 '13 at 00:03
  • Here is more about the subject: http://stackoverflow.com/questions/534601/are-there-any-javascript-static-analysis-tools – Mikko Ohtamaa Feb 28 '13 at 00:04
  • I've already said that I would manually link the things, no need for parsers nor nothing special about.. – Totty.js Feb 28 '13 at 09:18
  • Hi Totty. I included a link to a blog post which described about the manual approach - maybe something you are looking for? – Mikko Ohtamaa Mar 04 '13 at 14:47