Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Orion/Documentation/User Guide/Tasks/Navigating and searching"

(37 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Navigating and searching =
+
= Searching =
  
 
== Searching for files ==
 
== Searching for files ==
  
There are a couple of different ways to search using the <b>Navigator</b> page:
+
Type Ctrl+Shift+F to search for a file with a given name. Clicking a match will open a page for the file as if you had clicked it in the Editor folder list. In many cases, this opens the [[Orion/Documentation/User_Guide/Reference/Editing_page|Editing page]] on that file. If there is only a single match, simply press 'Enter' to open that file.
* Type Ctrl+Shift+F to search for a file with a given name. Clicking a match will open a page for the file as if you had clicked it in the Navigator folder list. (In many cases, this opens the [[Orion/Documentation/User_Guide/Reference/Coding_page|Coding page]] on that file.) If there is only a single match, simply press 'Enter' to open that file.
+
* Typing search terms in the search box in the upper right corner of the title area will search for the terms across all files in the folder you are viewing. Matches will be displayed in the [[Orion/Documentation/User_Guide/Reference/Search_Results_page|Search Results page]].
+
  
 
== Searching for text within files ==
 
== Searching for text within files ==
 +
 +
Once you launch the [[Orion/Documentation/User_Guide/Reference/Search_Results_page|Search page]] you can type search terms in the search box on the left hand side to search for terms across all files in the current scope. Matches will be displayed on the right hand side of the page.
 +
 +
Both literal and wild card search are supported. For example, "fo*ar" will hit all the files containing "foobar" while "fo??ar" will hit the same files.
 +
 +
If there are more than 1 file systems, you can also switch to the file system as your search target.
 +
 +
[[Image:navAndSearch-search.png|Search pane]]
 +
 +
When you type, the drop-down completion box allows you to browse recent or saved searches. The options under the search and replace boxes allows you to narrow down your search.
 +
 +
Read the [[Orion/Documentation/User_Guide/Reference/Search_Results_page|Search page]] documentation for more details on how to browse, filter, and process search results.
 +
 +
In addition to the search page, there is also a convenient in-editor search, which is triggered by CTRL+H. Refer to [[Orion/Documentation/User_Guide/Reference/Editing_page#Searching|Searching section in the editing page]] for details.
  
 
== Search and replace across files==
 
== Search and replace across files==
  
A global search and replace can be performed by first running a search from the search box, and then supplying a replace term in the [[Orion/Documentation/User_Guide/Reference/Search_Results_page|Search Results page]].
+
# Enter the search term to be replaced in the search field.
 +
# Enter the replace term that will replace the search term in the replace field.
 +
# Click on the <b>Replace</b> button. This will bring up the replace preview on right hand side.
 +
# Browse the changes, and use the check boxes to select the files and matches you want to replace. Note that if there are multiple matches in a single line, it will be <b>split</b> to multiple lines where each line represents one match. There are 3 levels of check box.<br> [[Image:navAndSearch-replace.png|Filtering matches]]
 +
#* Overall: this allows you to toggle all the files and matches on the current page.
 +
#* File level: this allows you to toggle all the matches in a file.
 +
#* Match level: this allows you to toggle each match.
 +
# Once you have selected all the matches that you want to replace, click on Commit on the tool bar. This will write all the replacement on the server.
 +
# After the changes are committed, the replace page displays a list of files indicating the success or failure of the replacement. It also reports on how many matches were replaced on each file. You can click on any file to see the new content in a new tab. If some body else has changed the same file while you are replacing, a failure is generated and you have to refresh the page to redo it. [[Image:navAndSearch-report.png|Search replace report]]
 +
# If there is more than one page of search results, click on <b>Next Page</b> or <b>Previous Page</b> to repeat the process on the next set of results.
 +
 
 +
== Example: refactor a function name ==
 +
This example explains a work flow where a user tries to refactor something while another user already changed the same file at the same time. It covers all the features from search, replace to the replace report.
 +
 
 +
Lets say there is a function called <b>foo</b> that is used in 60 files. User <b>A</b> creates a new function called <b>bar</b> and wants to replace the function name in 5 files. Meanwhile, user <b>B</b> modified and saved one of the files. The steps below describes the complete workflow:
 +
# User A types the keyword <b>foo</b> in the search field and  <b>bar</b> in the replace field.
 +
# User A clicks on <b>Replace</b> button. There are 3 files hit.
 +
# User A selects the 3 files and relative matches that will be replaced.
 +
# User A compares and confirms the differences between the original and replaced lines.
 +
# User A commits the new contents of the 3 files to the server.
 +
# All the 3 files are written successfully indicated by the report.
 +
# User A replaces the next page by selecting the remaining 2 files and relative matches.
 +
# User B modifies one of the 2 files and saves it.
 +
# User A commits the replacement.
 +
# One of the 2 files is reported written failure because it was modified during the replacing.
 +
# User A refreshes the page and replaces the <b>failed</b> file again.
 +
# User A commits the replacement successfully.
 +
# <b>Optional:</b> To undo the changes, user A [[Orion/Documentation/User_Guide/Reference/Git_Status_page#Reverting_an_unstaged_change|checks out]] the changes in git status page.

Revision as of 14:51, 21 November 2013

Searching

Searching for files

Type Ctrl+Shift+F to search for a file with a given name. Clicking a match will open a page for the file as if you had clicked it in the Editor folder list. In many cases, this opens the Editing page on that file. If there is only a single match, simply press 'Enter' to open that file.

Searching for text within files

Once you launch the Search page you can type search terms in the search box on the left hand side to search for terms across all files in the current scope. Matches will be displayed on the right hand side of the page.

Both literal and wild card search are supported. For example, "fo*ar" will hit all the files containing "foobar" while "fo??ar" will hit the same files.

If there are more than 1 file systems, you can also switch to the file system as your search target.

Search pane

When you type, the drop-down completion box allows you to browse recent or saved searches. The options under the search and replace boxes allows you to narrow down your search.

Read the Search page documentation for more details on how to browse, filter, and process search results.

In addition to the search page, there is also a convenient in-editor search, which is triggered by CTRL+H. Refer to Searching section in the editing page for details.

Search and replace across files

  1. Enter the search term to be replaced in the search field.
  2. Enter the replace term that will replace the search term in the replace field.
  3. Click on the Replace button. This will bring up the replace preview on right hand side.
  4. Browse the changes, and use the check boxes to select the files and matches you want to replace. Note that if there are multiple matches in a single line, it will be split to multiple lines where each line represents one match. There are 3 levels of check box.
    Filtering matches
    • Overall: this allows you to toggle all the files and matches on the current page.
    • File level: this allows you to toggle all the matches in a file.
    • Match level: this allows you to toggle each match.
  5. Once you have selected all the matches that you want to replace, click on Commit on the tool bar. This will write all the replacement on the server.
  6. After the changes are committed, the replace page displays a list of files indicating the success or failure of the replacement. It also reports on how many matches were replaced on each file. You can click on any file to see the new content in a new tab. If some body else has changed the same file while you are replacing, a failure is generated and you have to refresh the page to redo it. Search replace report
  7. If there is more than one page of search results, click on Next Page or Previous Page to repeat the process on the next set of results.

Example: refactor a function name

This example explains a work flow where a user tries to refactor something while another user already changed the same file at the same time. It covers all the features from search, replace to the replace report.

Lets say there is a function called foo that is used in 60 files. User A creates a new function called bar and wants to replace the function name in 5 files. Meanwhile, user B modified and saved one of the files. The steps below describes the complete workflow:

  1. User A types the keyword foo in the search field and bar in the replace field.
  2. User A clicks on Replace button. There are 3 files hit.
  3. User A selects the 3 files and relative matches that will be replaced.
  4. User A compares and confirms the differences between the original and replaced lines.
  5. User A commits the new contents of the 3 files to the server.
  6. All the 3 files are written successfully indicated by the report.
  7. User A replaces the next page by selecting the remaining 2 files and relative matches.
  8. User B modifies one of the 2 files and saves it.
  9. User A commits the replacement.
  10. One of the 2 files is reported written failure because it was modified during the replacing.
  11. User A refreshes the page and replaces the failed file again.
  12. User A commits the replacement successfully.
  13. Optional: To undo the changes, user A checks out the changes in git status page.

Back to the top