/plugins/CodeBrowser/tags/release-1-4-3/users-guide.xml

# · XML · 417 lines · 341 code · 74 blank · 2 comment · 0 complexity · 124265fe534c8f7d6b0653f4f6633013 MD5 · raw file

  1. <?xml version="1.0"?>
  2. <!-- CodeBrowser plugin user's guide -->
  3. <!-- (c) 2002, 2003, 2004 Gerd Knops -->
  4. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  5. "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
  6. <book>
  7. <bookinfo>
  8. <title>Code Browser plugin</title>
  9. <authorgroup>
  10. <author>
  11. <firstname>Gerd</firstname>
  12. <surname>Knops</surname>
  13. </author>
  14. </authorgroup>
  15. </bookinfo>
  16. <chapter id="Description">
  17. <title>Description</title>
  18. <para>
  19. The Code Browser plugin contains a buffer switcher and a code browser within
  20. a split pane. The buffer switcher can be hidden by moving the divider all
  21. the way up, or by clicking the small up-handle. The code browser simplifies
  22. navigating source code of any programming language supported by the
  23. Exuberant C Tags program.
  24. </para>
  25. </chapter>
  26. <chapter id="BufferSwitcher">
  27. <title>The Buffer Switcher</title>
  28. <para>
  29. The buffer switcher displays the file name of each buffer, and as much of the
  30. <emphasis>end</emphasis> of each path as can be fit. The selcted buffer is
  31. shown in bold. The file name colors are taken from the File System Browser
  32. (See <guimenu>Global Options</guimenu>&gt;<guisubmenu>File System
  33. Browser</guisubmenu>&gt;<guisubmenu>Colors</guisubmenu>). The path of
  34. 'dirty' buffers
  35. is displayed in in dark red, others in dark gray. Operation of the buffer switcher
  36. is straight forward: A mouse click selects a buffer, and a control-click
  37. closes a buffer. While the mouse is ofer a buffer switcher entry a tooltip
  38. shows the entire path for this entry.
  39. </para>
  40. </chapter>
  41. <chapter id="CodeBrowser">
  42. <title>The Code Browser</title>
  43. <para>
  44. The code browser requires Exuberant C Tags version 5.5 or later. You can find
  45. it at <ulink url="http://ctags.sourceforge.net">http://ctags.sourceforge.net</ulink>.
  46. NOTE: The standard ctags program found on many systems is NOT sufficient!!!
  47. </para>
  48. <para>
  49. The path of the <command>ctags</command> program needs to be
  50. set in the Plugin Options for the Code Browser plugin. A typical choice on
  51. Unix-like systems is <filename>/usr/local/bin/ctags</filename>, and on windows
  52. systems <filename>c:\Apps\ctags51\ctags.exe</filename>.
  53. </para>
  54. <para>
  55. Once the <command>ctags</command> path is set, the code browser plugin will parse a file whenever
  56. a buffer displaying the file is selected, or when the current buffer is saved.
  57. Please note that only the file on disk is parsed, not the in-memory contents
  58. of the buffer.
  59. </para>
  60. <para>
  61. Simply click on any function, variable declaration etc. displayed in the
  62. code browser, and the buffer will be positioned accordingly. As regular
  63. expressions are used, code browser will be able to find definitions even
  64. in modified files as long as the line on which the definition occured was
  65. not changed. Tooltips show the contents of the line, which depending on
  66. language and style may include more information.
  67. </para>
  68. <para>
  69. Right-clicking on any function, variable declaration etc. will bring up a context menu with these choices:
  70. <itemizedlist>
  71. <listitem>
  72. <para> <guimenu>Insert at Caret</guimenu>: Inserts the selected term in the current text view. </para></listitem>
  73. <listitem><para> <guimenu>Hypersearch</guimenu>: Perform a hypersearch with this term. </para></listitem>
  74. <listitem><para><guimenu>Copy to pasteboard</guimenu>: Copies the selected term to the paste board. </para></listitem>
  75. <listitem><para><guimenu>Append to pasteboard</guimenu>: Appends the selected term to the pasteboard. </para></listitem>
  76. </itemizedlist>
  77. </para>
  78. <para>
  79. The <guimenu>Options</guimenu> menu button above the Code Browser section
  80. lets you select a few options:
  81. <itemizedlist>
  82. <listitem><para>
  83. <guimenu>Auto-parse</guimenu>: When checked, buffers are parsed automatically when saved or when you switch to another buffer. When un-checked, buffers will only be parsed when you click on the <guimenu>Parse</guimenu> button. That can be helpful when you work with extremely large files, where parsing requires some time. </para>
  84. </listitem>
  85. <listitem><para> <guimenu>Sort</guimenu>: When checked, all listed tags will be sorted. </para></listitem>
  86. <listitem><para>
  87. <guimenu>Auto-unfold</guimenu>: When checked, any section in the code you jump to will be unfolded automatically. </para></listitem>
  88. <listitem><para> <guimenu>Auto-close dock</guimenu>: After selecting a tag the dock is automatically closed </para>
  89. </listitem>
  90. </itemizedlist>
  91. </para>
  92. </chapter>
  93. <chapter id="OtherLanguages">
  94. <title>Code Browser and Languages/File types not supported by ctags</title>
  95. <para>
  96. The <command>ctags</command> program supports many languages, but chances are you might
  97. work with a language or file type not supported by <command>ctags</command>. While support
  98. built into <command>ctags</command> is the most elegant solution, you can also create some
  99. simple regular expression based support for languages not directly
  100. supported by <command>ctags</command>.
  101. </para>
  102. <para>
  103. The following chapter gives some examples. The lines shown need to be added
  104. to one of the files <command>ctags</command> reads during startup. On unix-like systems that
  105. could be <filename>~/.ctags</filename>, and on windows systems that could be a
  106. file <filename>ctags.cnf</filename> in the jEdit directory. Please read the
  107. ctags documentation for more info.
  108. </para>
  109. </chapter>
  110. <chapter id="XmlAndHtml">
  111. <title>Simple support for XML and HTML</title>
  112. <para>
  113. Here is an example for contents of the <command>ctags</command> configuration file mentioned
  114. in the previous chapter. The example add simple support for XML files and
  115. HTML files (note that HTML is now supported natively in ctags):
  116. </para>
  117. <para>
  118. <programlisting>
  119. --langdef=xml
  120. --langmap=xml:.xml
  121. --regex-xml=/&lt;([^ \t]+)[ \t]*(id|name)[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1 \3/Named Tags/i
  122. --langdef=html
  123. --langmap=html:.htm.html
  124. --regex-html=/&lt;a[ \t]+href[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1/HRefs/i
  125. --regex-html=/&lt;img[ \t]+src[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1/Images/i
  126. --regex-html=/&lt;h([1-6])[^&gt;]*&gt;([^&lt;]*)/\2 (\1)/Headers/i
  127. </programlisting>
  128. </para>
  129. <para>
  130. The <command>--langdef</command> lines define the name of the language, the
  131. <command>--langmap</command> lines define the extensions of files for this
  132. language, and the <command>--regex-html</command> lines define the regular
  133. expressions describing the items of a language you want to see in Code
  134. Browser. For more info please see the <command>ctags</command> documentation.
  135. </para>
  136. </chapter>
  137. <chapter id="Ant">
  138. <title>Simple support for Ant build.xml files</title>
  139. <para>
  140. <filename>build.xml</filename> files would normally be governed by the
  141. xml entries listed in the previous chapter. <command>ctags</command> does
  142. not allow one entry for <filename>*.xml</filename> and another for
  143. <filename>build.xml</filename>. Code Browser helps out here; Code Browser
  144. forces the language used by ctags to <command>ant</command> when
  145. the file to be parsed is named <filename>build.xml</filename>.
  146. </para>
  147. <para>
  148. <programlisting>
  149. --langdef=ant
  150. --regex-ant=/&lt;property[ \t]*name[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1/Properties/i
  151. --regex-ant=/&lt;target[ \t]*name[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1/Targets/i
  152. --regex-ant=/&lt;path[ \t]*id[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1/Paths/i
  153. --regex-ant=/&lt;taskdef[ \t]*id[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1/Taskdefs/i
  154. --regex-ant=/&lt;typedef[ \t]*id[ \t]*=[ \t]*\&quot;([^\&quot;]+)/\1/Typedefs/i
  155. </programlisting>
  156. </para>
  157. </chapter>
  158. <chapter id="faq">
  159. <title>Frequently Asked Questions</title>
  160. <para>
  161. Q: I am working on a (shell|perl|python|whatever) script, but CodeBrowser
  162. isn't showing anything.
  163. </para>
  164. <para>
  165. A: Ctags parses files without extensions (like many scripts) only if the
  166. executable flag is set AND the magic #!/path/to/interpreter first line
  167. can be found. So make sure both those conitions are met, or add a known
  168. extension to the script.
  169. </para>
  170. <para>
  171. Q: Is there support for ActionScript?
  172. </para>
  173. <para>
  174. A: Check <ulink url="www.ubergeek.tv/jack/hack.php">www.ubergeek.tv/jack/hack.php</ulink>
  175. </para>
  176. </chapter>
  177. <chapter id="license">
  178. <title>License</title>
  179. <para>
  180. Feel free to do with the files of this project whatever you want. If they
  181. make you filthy rich you should send some bucks my way though.
  182. </para>
  183. </chapter>
  184. <chapter id="disclaimer">
  185. <title>Disclaimer</title>
  186. <para>
  187. BITart and Gerd Knops make no warranties, representations or commitments
  188. with regard to the contents of this software. BITart and Gerd Knops
  189. specifically disclaim any and all warranties, wether express, implied or
  190. statutory, including, but not limited to, any warranty of merchantability
  191. or fitness for a particular purpose, and non-infringement. Under no
  192. circumstances will BITart or Gerd Knops be liable for loss of data,
  193. special, incidental or consequential damages out of the use of this
  194. software, even if those damages were forseeable, or BITart or Gerd Knops
  195. was informed of their potential.
  196. </para>
  197. </chapter>
  198. <chapter id="feedback">
  199. <title>Feedback</title>
  200. <para>You can write to:</para>
  201. <itemizedlist>
  202. <listitem> <para>
  203. Gerd Knops <email>gerti-codebrowser@bitart.com</email> </para>
  204. </listitem>
  205. <listitem> <para>
  206. The jEdit-users mailing-list
  207. <email>jedit-users@lists.sourceforge.net</email> </para>
  208. </listitem>
  209. <listitem><para>
  210. The jEdit-devel mailing-list
  211. <email>jedit-devel@lists.sourceforge.net</email> </para>
  212. </listitem>
  213. </itemizedlist>
  214. </chapter>
  215. <appendix id="changelog">
  216. <title>Change log</title>
  217. <formalpara>
  218. <title>Version 1.4.3</title>
  219. <para>Requires JDK 1.4, jEdit 4.3pre5, ExuberantCtags 5.5.
  220. <itemizedlist>
  221. <listitem>
  222. <para> Fixes for change in regexp/search API </para>
  223. </listitem>
  224. <listitem> <para> Sends new CaretChanging editbus message for the benefit of Navigator. </para> </listitem>
  225. </itemizedlist>
  226. </para>
  227. </formalpara>
  228. <formalpara>
  229. <title>Version 1.4.2</title>
  230. <para>Requires JDK 1.3, jEdit 4.3, ExuberantCtags 5.5.
  231. <itemizedlist>
  232. <listitem>
  233. <para>
  234. Works with jedit 4.3 API and plugin dynamic loading.
  235. </para>
  236. </listitem>
  237. </itemizedlist> </para>
  238. </formalpara>
  239. <formalpara>
  240. <title>Version 1.4.0</title>
  241. <para>Requires JDK 1.3, jEdit 4.1, ExuberantCtags 5.5.
  242. <itemizedlist>
  243. <listitem><para>Behavior improved when multiple tags with identical names
  244. are found: if you select the n-th one, then CodeBrowser will jump to the n-th occurance in the code.</para></listitem>
  245. <listitem><para> New <guimenu>Options</guimenu> Menu. </para></listitem>
  246. <listitem><para> Moved <guimenu>Sort</guimenu> and <guimenu>Auto</guimenu>
  247. buttons into new <guimenu>Options</guimenu> Menu. </para></listitem>
  248. <listitem><para>New option <guimenu>Auto-unfold</guimenu>: When checked
  249. and you jump to a folded section of the code that section will be
  250. unfolded automatically</para></listitem>
  251. <listitem><para>New option <guimenu>Auto-close Dock</guimenu>: When
  252. checked the dock will automatically close after a tag was
  253. selected</para></listitem>
  254. <listitem><para>Cleaned up UI</para></listitem>
  255. <listitem><para>Cleaned up code</para></listitem>
  256. </itemizedlist>
  257. </para>
  258. </formalpara>
  259. <formalpara>
  260. <title>Version 1.3.1</title>
  261. <para>Requires JDK 1.3, jEdit 4.1, ExuberantCtags 5.5.
  262. <itemizedlist>
  263. <listitem><para>Updated for jEdit 4.2</para></listitem>
  264. </itemizedlist>
  265. </para>
  266. </formalpara>
  267. <formalpara>
  268. <title>Version 1.3.0</title>
  269. <para>Requires JDK 1.3, jEdit 4.1, ExuberantCtags 5.5.
  270. <itemizedlist>
  271. <listitem><para>Compatible with all languages supported now or in future by ExuberantCtags</para></listitem>
  272. <listitem><para>No longer requires internal tables to determine programming language</para></listitem>
  273. <listitem><para>No longer requires internal tables to translate single letter 'kind' to description</para></listitem>
  274. <listitem><para>Methods, functions etc. now listed with signature</para></listitem>
  275. </itemizedlist>
  276. </para>
  277. </formalpara>
  278. <formalpara>
  279. <title>Version 1.2.1</title>
  280. <para>Requires JDK 1.3, jEdit 4.
  281. <itemizedlist>
  282. <listitem><para>Context menu for items in CodeBrowser (Rudi Widmann)</para></listitem>
  283. </itemizedlist>
  284. </para>
  285. </formalpara>
  286. <formalpara>
  287. <title>Version 1.2.0</title>
  288. <para>Requires JDK 1.3, jEdit 4. Code contributed by Rudi Widmann:
  289. <itemizedlist>
  290. <listitem><para>Manual parsing mode</para></listitem>
  291. <listitem><para>Cache parse results</para></listitem>
  292. <listitem><para>Do not parse when docked but not visible</para></listitem>
  293. <listitem><para>Focus textarea after selecting element in parse tree</para></listitem>
  294. </itemizedlist>
  295. </para></formalpara>
  296. <formalpara>
  297. <title>Version 1.1.1</title>
  298. <para>Requires JDK 1.3, jEdit 4. </para>
  299. </formalpara>
  300. <itemizedlist>
  301. <listitem><para>Should now work with all kinds of remote files</para></listitem>
  302. </itemizedlist>
  303. <formalpara>
  304. <title>Version 1.1.0</title>
  305. <para>Requires JDK 1.3, jEdit 4.
  306. <itemizedlist>
  307. <listitem><para>Added support for FTP plugin</para>
  308. </listitem>
  309. </itemizedlist></para>
  310. </formalpara>
  311. <formalpara>
  312. <title>Version 1.0.0</title>
  313. <para>Requires JDK 1.3, jEdit 4.
  314. <itemizedlist>
  315. <listitem><para>Minor bugfixes</para></listitem>
  316. <listitem><para>First release to plugin central</para></listitem>
  317. </itemizedlist> </para>
  318. </formalpara>
  319. <formalpara>
  320. <title>Version 0.9.2</title>
  321. <para>Requires JDK 1.3, jEdit 4.
  322. <itemizedlist>
  323. <listitem><para>Improved documentation</para></listitem>
  324. <listitem><para>Now handles multiple/split views better</para></listitem>
  325. <listitem><para>BufferSwitcher now uses colors from File System Browser</para></listitem>
  326. </itemizedlist></para>
  327. </formalpara>
  328. <formalpara>
  329. <title>Version 0.9.1</title>
  330. <para>Requires JDK 1.3, jEdit 4.
  331. <itemizedlist>
  332. <listitem><para>Regex bugfix</para></listitem>
  333. </itemizedlist> </para>
  334. </formalpara>
  335. <formalpara>
  336. <title>Version 0.9.0</title>
  337. <para>Requires JDK 1.3, jEdit 4.
  338. <itemizedlist>
  339. <listitem><para>First beta test version</para></listitem>
  340. </itemizedlist> </para>
  341. </formalpara>
  342. </appendix>
  343. </book>