码迷,mamicode.com
首页 > 其他好文 > 详细

CodeAtlas For Sublime Text

时间:2016-04-15 02:07:49      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:

CodeAtlas is a plugin of SublimeText, which allows one to explore the call graph conveniently. The plugin uses the code analysis tool Understand (https://scitools.com) to perform symbol/reference query task.

Following (but not limited) languagues are supported: Python,C/C++,Java. 

Interface

技术分享

Features

1.Find callers/callees of a function.
All key shortcuts below can be used in both Sublime Text and the visualization window.
Press Alt+G to show the function/variable/class under the cursor in CodeAtlas.
Press Alt+V to show callees of current function.
Press Alt+C to show callers of current function.
技术分享

Each function is represented as a green disc in the atlas. Size of the disc indicates lines of the function. The fan shape on the left of the disc indicates number of callers, and the one on the right indicates number of callees. In the figure below, there are much more callers of the function "isinstance" then that of "selectOneItem". The fan shape can warn you not to show too much callers/callees, which will totally change the figure.
The numbers on the gray lines indicate call order.
技术分享

2. Find Members of a class.
Press Alt+M the find members of a class.
技术分享
Each member variable is represented as a pink disc in the atlas.
技术分享
Each class is represented as a blue disc. Also, Size of the disc indicates lines of the class.
技术分享

3. Find references of a variable/function. 
Press Alt+U the find all references.
技术分享

4. Explore call graph.
Press Alt + ↑/↓/←/→ to explore through the graph.
You can select a nearby node(function/class/variable) or edge(function call/variable definition/function definitio) by pressing Alt + ↑/↓/←/→. The most likely node/edge will be selected and Sublime Editor will jump to corresponding code.

技术分享
5. Delete an unused function/class/variable
Press Alt+Delete to delete current selected function/class/variable.
技术分享

6. Find all call paths between two nodes.
In the visualization window, using mouse middle button to drag function A to B, then all call paths from function A to B will be shown.
技术分享
7. Use mouse to select/drag/zoom in the visualization window directly.
技术分享


Setup

1. Install Understand (home page https://scitools.com)
2. Install Sublime Text (home page http://www.sublimetext.com/)
3. In Sublime Text, press Preferences->Browse Packages go to package folder.
技术分享
4. Unzip and place the plugin in the package folder.
技术分享
5. Replace Packages/CodeAtlas/CodeViewPy/understand.pyd with the one in the Understand folder(usually in SciTools/bin/pc-win32/python/understand.pyd)
技术分享

6. Open Understand and create a database for your project.
技术分享
技术分享

7. After finish the new project wizard, a database file will be generated.
技术分享

8. Close Understand and restart Sublime Text, then press "Start Atlas" in the context menu. Then the visualization window will be shown.
技术分享

9. Press Open DB in the visualization window, then find the *.udb file generated before.
技术分享

10. Now you can use the key shortcuts above to explore the code!





CodeAtlas For Sublime Text

标签:

原文地址:http://www.cnblogs.com/dydx/p/5393802.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!