Difference between revisions of "ThreadSearch plugin"

From Code::Blocks
(Undo revision 7354 by OBFusCATed (talk))
 
(16 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
   name = Thread search |
 
   name = Thread search |
 
   logo = [[Image:ThreadSearch.png]] |
 
   logo = [[Image:ThreadSearch.png]] |
   developer = [[User:dje|Jérôme ANTOINE]] |
+
   developer = Jérôme ANTOINE |
 
   maintainer = Jérôme ANTOINE |
 
   maintainer = Jérôme ANTOINE |
   version = 0.7
+
   version = 1.1
 
}}
 
}}
  
== ThreadSearch ==
 
  
=== Features ===
+
== Features ==
 
'''ThreadSearch''' plugin offers the following features:
 
'''ThreadSearch''' plugin offers the following features:
<ul>
 
<li>multi-threaded "Search in files"</li>
 
<li>internal read-only editor to preview the results</li>
 
<li>file open in editors notebook</li>
 
<li>highly configurable</li>
 
<li>contextual menu "Find occurrences" to start a search in files with the word under cursor</li>
 
</ul>
 
  
 +
* multi-threaded "Search in files"
 +
* internal read-only editor to preview the results
 +
* file open in editors notebook
 +
* highly configurable
 +
* contextual menu "Find occurrences" to start a search in files with the word under cursor
  
=== Why ? ===
 
<ul>
 
<li>The default ''Search in files'' displays a blocking dialog. Being blocked for 6 minutes is unpleasant.
 
Workaround was to run 2 Code::Blocks instances.</li>
 
<li>The default ''Search in files'' automatically move to first occurrence. Current edition situation is lost, either a new editor is open or cursor is moved.</li>
 
<li>The line containing search expression may be senseless without its context, forcing user to open the file to browse the result.</li>
 
<li>Impossibility to search in files both in workspace and other directory.</li>
 
<li>I love Code::Blocks and I wanted to bring my contribution.</li>
 
</ul>
 
  
 +
== Why ? ==
 +
* The default ''Search in files'' displays a blocking dialog. Being blocked for 6 minutes is unpleasant. Workaround was to run 2 Code::Blocks instances.
 +
* The default ''Search in files'' automatically move to first occurrence. Current edition situation is lost, either a new editor is open or cursor is moved.
 +
* The line containing search expression may be senseless without its context, forcing user to open the file to browse the result.
 +
* Impossibility to search in files both in workspace and other directory.
 +
* I love Code::Blocks and I wanted to bring my contribution.
  
=== Configuration ===
+
 
 +
== Screenshots ==
 +
ThreadSearch panel<br>
 +
[[Image:ThreadSearchPanel.png]]
 +
 
 +
 
 +
Configuration panel<br>
 +
[[Image:ThreadSearchOptions.png]]
 +
 
 +
 
 +
== Usage ==
 +
* Configure your search preferences (see configuration part).
 +
* Once the plugin is installed, there are 4 ways to run a search :
 +
 
 +
# Type/Select a word in the search combo box and press enter or click on ''Search'' on the ''Thread search'' panel of the Messages notebook
 +
# Type/Select a word in the toolbar search combo box and press enter or click on ''Search'' button
 +
# Right click on any 'word' in active editor and click on ''Find occurrences of 'word' ''
 +
# Click on ''Search/Thread search'' to search for current word in active editor<br>Note :<br>items 1, 2 and 3 may not be available according to current configuration.
 +
* Click again on the search button to cancel current search.
 +
* A single click on a result item displays it on the preview editor at right location.
 +
* A double click on a result item opens or set an editor in editors notebook at right location.
 +
 
 +
 
 +
== Configuration ==
 
To access '''ThreadSearch''' plugin configuration panel click on:
 
To access '''ThreadSearch''' plugin configuration panel click on:
<ol>
+
# ''Options'' button on Messages notebook ''Thread search'' panel.
<li>''Options'' button on Messages notebook ''Thread search'' panel.</li>
+
# ''Options'' button on ''Thread search'' toolbar.
<li>''Options'' button on ''Thread search'' toolbar.</li>
+
# ''Settings/Environment'' menu item and then on the ''Thread search'' item on the left columns
<li>''Settings/Environment'' menu item and then on the ''Thread search'' item on the left columns</li>
 
</ol>
 
 
Note :
 
Note :
 
items 1 and 2 may not be available according to current configuration.
 
items 1 and 2 may not be available according to current configuration.
  
That is what appears:
 
[[Image:MainAndOptions.png]]
 
  
 
+
Let's browse configuration panel... Most of the items are available on the ''Thread search'' panel.
=== Usage ===
+
<p>
Once the plugin is installed, there are 4 ways to run a search :
+
'''Search in''' part defines the set of files that will be analysed.
<ol>
+
* Project and Workspace checkboxes are mutually exclusive.
<li>Type/Select a word in the search combo box and press enter or click on ''Search'' on the ''Thread search'' panel of the Messages notebook</li>
+
* Directory path can be edited or set with ''Select'' button.
<li>Type/Select a word in the toolbar search combo box and press enter or click on ''Search'' button</li>
+
* Mask is the set a file specifications separated by ';'. For example: ''*.cpp;*.c;*.h''.
<li>Right click on any 'word' in active editor and click on ''Find occurrences of 'word' ''</li>
+
Is it necessary to describe other items ??
<li>Click on Search/Thread search in the toolbar to search for current word in active editor</li>
+
</p>
</ol>
+
<p>
Note :
+
'''Options'''
items 1, 2 and 3 may not be available according to current configuration.
+
* 'Whole word': if checked, line matches search expression if search expression is found with no alpha-numeric + '_' before and after.
 +
* 'Start word': if checked, line matches search expression if search expression is found at the beginning of a word, ie no alpha-numeric + '_' before search expression.
 +
* 'Match case': if checked, the search is case sensitive.
 +
* 'Regular expression': the search expression is a regular expression. wxRE_ADVANCED format is used.
 +
</p>
 +
<p>
 +
'''Thread search options'''
 +
* 'Enable 'Find occurrences contextual menu item' ': if checked, the ''Find occurrences of 'Focused word' ''entry is added to the editor contextual menu.
 +
* 'Use default options when running 'Find occurrences' ': if checked, a set of default options is applied to the searches launched with the 'Find occurrences' contextual menu item. Default values are :
 +
** 'Whole word' = true
 +
** 'Start word' = false
 +
** 'Match case' = true
 +
** 'Regular expression' = false
 +
</p>
 +
<p>
 +
'''Layout'''
 +
* Show/Hide
 +
** 'Show ThreadSearch toolbar': clear enough, isn't it ??
 +
** 'Show search widgets in ThreadSearch Messages panel.': if checked, only the results list control and the preview editor are displayed. All other search widgets are hidden (spares space).
 +
** 'Show code preview editor': Code preview can be hidden either with this check box or with a double click on the splitter window middle border. This is where it can be shown again.
 +
* List control options
 +
** 'Display header in log window': if checked, the header are displayed in the results list control. Be careful ! if unchecked, the columns are no longer resizeable but space is spared.
 +
** 'Draw lines between columns': clear enough, isn't it ??
 +
* 'ThreadSearch panel management by': the ThreadSearch panel can be managed either by the layout (docking support) or the Messages notebook (ThreadSearch panel is one of the pages)
 +
* 'Logger type': results can be displayed in a list control (each line is a result with directory, file, line number and matching text) or a tree (each node is a file path, each sub node is a matching text + line number).
 +
</p>

Latest revision as of 11:38, 21 September 2012

Thread search
ThreadSearch.png
Developer(s): Jérôme ANTOINE
Maintainer(s): Jérôme ANTOINE
Version: 1.1


Features

ThreadSearch plugin offers the following features:

  • multi-threaded "Search in files"
  • internal read-only editor to preview the results
  • file open in editors notebook
  • highly configurable
  • contextual menu "Find occurrences" to start a search in files with the word under cursor


Why ?

  • The default Search in files displays a blocking dialog. Being blocked for 6 minutes is unpleasant. Workaround was to run 2 Code::Blocks instances.
  • The default Search in files automatically move to first occurrence. Current edition situation is lost, either a new editor is open or cursor is moved.
  • The line containing search expression may be senseless without its context, forcing user to open the file to browse the result.
  • Impossibility to search in files both in workspace and other directory.
  • I love Code::Blocks and I wanted to bring my contribution.


Screenshots

ThreadSearch panel
ThreadSearchPanel.png


Configuration panel
ThreadSearchOptions.png


Usage

  • Configure your search preferences (see configuration part).
  • Once the plugin is installed, there are 4 ways to run a search :
  1. Type/Select a word in the search combo box and press enter or click on Search on the Thread search panel of the Messages notebook
  2. Type/Select a word in the toolbar search combo box and press enter or click on Search button
  3. Right click on any 'word' in active editor and click on Find occurrences of 'word'
  4. Click on Search/Thread search to search for current word in active editor
    Note :
    items 1, 2 and 3 may not be available according to current configuration.
  • Click again on the search button to cancel current search.
  • A single click on a result item displays it on the preview editor at right location.
  • A double click on a result item opens or set an editor in editors notebook at right location.


Configuration

To access ThreadSearch plugin configuration panel click on:

  1. Options button on Messages notebook Thread search panel.
  2. Options button on Thread search toolbar.
  3. Settings/Environment menu item and then on the Thread search item on the left columns

Note : items 1 and 2 may not be available according to current configuration.


Let's browse configuration panel... Most of the items are available on the Thread search panel.

Search in part defines the set of files that will be analysed.

  • Project and Workspace checkboxes are mutually exclusive.
  • Directory path can be edited or set with Select button.
  • Mask is the set a file specifications separated by ';'. For example: *.cpp;*.c;*.h.

Is it necessary to describe other items ??

Options

  • 'Whole word': if checked, line matches search expression if search expression is found with no alpha-numeric + '_' before and after.
  • 'Start word': if checked, line matches search expression if search expression is found at the beginning of a word, ie no alpha-numeric + '_' before search expression.
  • 'Match case': if checked, the search is case sensitive.
  • 'Regular expression': the search expression is a regular expression. wxRE_ADVANCED format is used.

Thread search options

  • 'Enable 'Find occurrences contextual menu item' ': if checked, the Find occurrences of 'Focused word' entry is added to the editor contextual menu.
  • 'Use default options when running 'Find occurrences' ': if checked, a set of default options is applied to the searches launched with the 'Find occurrences' contextual menu item. Default values are :
    • 'Whole word' = true
    • 'Start word' = false
    • 'Match case' = true
    • 'Regular expression' = false

Layout

  • Show/Hide
    • 'Show ThreadSearch toolbar': clear enough, isn't it ??
    • 'Show search widgets in ThreadSearch Messages panel.': if checked, only the results list control and the preview editor are displayed. All other search widgets are hidden (spares space).
    • 'Show code preview editor': Code preview can be hidden either with this check box or with a double click on the splitter window middle border. This is where it can be shown again.
  • List control options
    • 'Display header in log window': if checked, the header are displayed in the results list control. Be careful ! if unchecked, the columns are no longer resizeable but space is spared.
    • 'Draw lines between columns': clear enough, isn't it ??
  • 'ThreadSearch panel management by': the ThreadSearch panel can be managed either by the layout (docking support) or the Messages notebook (ThreadSearch panel is one of the pages)
  • 'Logger type': results can be displayed in a list control (each line is a result with directory, file, line number and matching text) or a tree (each node is a file path, each sub node is a matching text + line number).