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"

(Search and replace across files)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Navigating and searching =
+
= Searching =
  
 
== Searching for files ==
 
== 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 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.
+
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.
  
 
== Searching for text within files ==
 
== Searching for text within files ==
Line 10: Line 10:
  
 
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.
 
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]]
 
[[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.
+
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.
 
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/Coding_page#Searching|Searching section in the coding page]] for details.
+
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==
Line 33: Line 35:
  
 
== Example: refactor a function name ==
 
== 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:
 
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 searches on keyword <b>foo</b>. In the first result page, there are 3 files that user A wants to replace.
+
# 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> and types <b>bar</b> and presses Enter.
+
# 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 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 compares and confirms the differences between the original and replaced lines.
Line 46: Line 50:
 
# User A refreshes the page and replaces the <b>failed</b> file again.
 
# User A refreshes the page and replaces the <b>failed</b> file again.
 
# User A commits the replacement successfully.
 
# User A commits the replacement successfully.
# <b>Optional:</b> To undo the changes, user A [[Orion/Documentation/User_Guide/Reference/Git_Status_page#Reverting_a_group_of_unstaged_changes|checks out]] the changes in git status page.
+
# <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.
 +
 
 +
[[Category:Orion]]

Latest revision as of 11:33, 5 July 2017

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