Navigating and searching by code in SourceCraft
SourceCraft features advanced navigation through project code, including read-only repositories. You can search for:
- File by name or part of name.
- Declaration by code element, such as a variable, function, or library.
- Places where a particular element is used in the code.
Navigation can be used both in edit mode and code view mode.
Other features:
- Viewing the author of the last update and commit for a particular file or line of code.
- Getting the file structure.
Searching for a file by name or part of name
-
Open the repository file structure:
- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Browse. - Select the branch to search in from the drop-down list
. - To display the repository file structure, click
next to the drop-down list .
-
In the Go to file field, enter the name or part of the name of the file you are looking for.
-
Open the pull request file structure:
- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Pull requests. - Select a pull request to search in.
- Navigate to the
Files changed tab. - To display the file structure, click
next to the drop-down lists for branch and iteration comparison. - Click Full tree.
-
In the Search field, enter the name or part of the name of the file you are looking for.
Search for a declaration by code element
Note
Currently, search for declarations and element locations is supported for Go, Java, JavaScript, TypeScript, C++, and Python.
-
Open the file structure:
RepositoryPull request- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Browse. - Select the branch to search in from the drop-down list
. - To display the repository file structure, click
next to the drop-down list .
- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Pull requests. - Select a pull request to search in.
- Navigate to the
Files changed tab. - To display the file structure, click
next to the drop-down lists for branch and iteration comparison. - Click Full tree.
-
Select the file you want to view.
-
Hover over the element whose declaration you want to find.
A pop-up window will display the path to the file and the line of code the element was declared in. If there are several such places, they will be presented as a list. Use
and to view the list items one by one. -
To go to the file and line with the item declaration, click Go to declaration.
Searching for places where a particular element is used in the code
Note
Currently, search for declarations and element locations is supported for Go, Java, JavaScript, TypeScript, C++, and Python.
-
Open the file structure:
RepositoryPull request- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Browse. - Select the branch to search in from the drop-down list
. - To display the repository file structure, click
next to the drop-down list .
- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Pull requests. - Select a pull request to search in.
- Navigate to the
Files changed tab. - To display the file structure, click
next to the drop-down lists for branch and iteration comparison. - Click Full tree.
-
Select the file you want to view.
-
Hover over the item whose locations you want to find.
-
In the pop-up window, click Find usages.
-
In the panel that opens, double-click the desired line to go to the file and line where the element is used.
Finding out the author of the last update and commit
-
Open the repository file structure:
- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Browse. - Select the branch to search in from the drop-down list
. - To display the repository file structure, click
next to the drop-down list .
-
Select the file you want to view.
The information about the last update author and the commit ID will be displayed above the file contents.
-
To view the file's revision history, click History
. -
To view the author of the last update and the commit for a particular line of code, enable Blame in the top-right corner.
Viewing the file structure
-
Open the repository file structure:
- Open the SourceCraft home page.
- On the
Home tab, navigate to Repositories. - Select a repository.
- Under
Code on the repository page, go to Browse. - Select the branch to search in from the drop-down list
. - To display the repository file structure, click
next to the drop-down list .
-
Select the file you want to view.
-
In the top-right corner, click File Structure
.