Skip to content

Commit ced3f5f

Browse files
authored
Merge pull request #12794 from github/repo-sync
repo sync
2 parents b13b424 + b4a49fe commit ced3f5f

24 files changed

Lines changed: 797 additions & 162 deletions

.github/workflows/build-docker-image.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.
78.7 KB
Loading
68.4 KB
Loading

content/repositories/working-with-files/using-files/navigating-code-on-github.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,34 @@ topics:
1515

1616
## About navigating code on {% data variables.product.prodname_dotcom %}
1717

18-
Code navigation uses the open source library [`tree-sitter`](https://github.com/tree-sitter/tree-sitter). The following languages are supported:
19-
- C#
20-
- CodeQL
21-
- Go
22-
- Java
23-
- JavaScript
24-
- PHP
25-
- Python
26-
- Ruby
27-
- TypeScript
18+
Code navigation helps you to read, navigate, and understand code by showing and linking definitions of a named entity corresponding to a reference to that entity, as well as references corresponding to an entity's definition.
19+
20+
![Code navigation display](/assets/images/help/repository/code-navigation-popover.png)
21+
22+
Code navigation uses the open source [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) library. The following languages and navigation strategies are supported:
23+
24+
| Language | search-based code navigation | precise code navigation |
25+
|:----------:|:----------------------------:|:-----------------------:|
26+
| C# || |
27+
| CodeQL || |
28+
| Go || |
29+
| Java || |
30+
| JavaScript || |
31+
| PHP || |
32+
| Python |||
33+
| Ruby || |
34+
| TypeScript || |
35+
36+
37+
You do not need to configure anything in your repository to enable code navigation. We will automatically extract search-based and precise code navigation information for these supported languages in all repositories and you can switch between the two supported code navigation approaches if your programming language is supported by both.
38+
39+
{% data variables.product.prodname_dotcom %} has developed two code navigation approaches based on the open source [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) and [`stack-graphs`](https://github.com/github/stack-graphs) library:
40+
- search-based - searches all definitions and references across a repository to find entities with a given name
41+
- precise - resolves definitions and references based on the set of classes, functions, and imported definitions at a given point in your code
42+
43+
To learn more about these approaches, see "[Precise and search-based navigation](#precise-and-search-based-navigation)."
44+
45+
Future releases will add *precise code navigation* for more languages, which is a code navigation approach that can give more accurate results.
2846

2947
## Jumping to the definition of a function or method
3048

@@ -38,11 +56,21 @@ You can find all references for a function or method within the same repository
3856

3957
![Find all references tab](/assets/images/help/repository/find-all-references-tab.png)
4058

59+
## Precise and search-based navigation
60+
61+
Certain languages supported by {% data variables.product.prodname_dotcom %} have access to *precise code navigation*, which uses an algorithm (based on the open source [`stack-graphs`](https://github.com/github/stack-graphs) library) that resolves definitions and references based on the set of classes, functions, and imported definitions that are visible at any given point in your code. Other languages use *search-based code navigation*, which searches all definitions and references across a repository to find entities with a given name. Both strategies are effective at finding results and both make sure to avoid inappropriate results such as comments, but precise code navigation can give more accurate results, especially when a repository contains multiple methods or functions with the same name.
62+
63+
If you don't see the results you expect from a precise code navigation query, you can click on the "search-based" link in the displayed popover to perform search-based navigation.
64+
65+
![Search-based code navigation link](/assets/images/help/repository/search-based-code-navigation-link.png)
66+
67+
If your precise results appear inaccurate, you can file a support request.
68+
4169
## Troubleshooting code navigation
4270

4371
If code navigation is enabled for you but you don't see links to the definitions of functions and methods:
4472
- Code navigation only works for active branches. Push to the branch and try again.
45-
- Code navigation only works for repositories with less than 100,000 files.
73+
- Code navigation only works for repositories with fewer than 100,000 files.
4674

4775
## Further reading
4876
- "[Searching code](/github/searching-for-information-on-github/searching-code)"

data/graphql/ghae/schema.docs-ghae.graphql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31053,6 +31053,11 @@ type Repository implements Node & ProjectOwner & RepositoryInfo & Starrable & Su
3105331053
"""
3105431054
before: String
3105531055

31056+
"""
31057+
Filter by categories that are assignable by the viewer.
31058+
"""
31059+
filterByAssignable: Boolean = false
31060+
3105631061
"""
3105731062
Returns the first _n_ elements from the list.
3105831063
"""
@@ -33406,6 +33411,8 @@ Specifies the attributes for a new or updated required status check.
3340633411
input RequiredStatusCheckInput {
3340733412
"""
3340833413
The ID of the App that must set the status in order for it to be accepted.
33414+
Omit this value to use whichever app has recently been setting this status, or
33415+
use "any" to allow any app to set the status.
3340933416
"""
3341033417
appId: ID
3341133418

data/graphql/ghec/schema.docs.graphql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34499,6 +34499,11 @@ type Repository implements Node & PackageOwner & ProjectOwner & RepositoryInfo &
3449934499
"""
3450034500
before: String
3450134501

34502+
"""
34503+
Filter by categories that are assignable by the viewer.
34504+
"""
34505+
filterByAssignable: Boolean = false
34506+
3450234507
"""
3450334508
Returns the first _n_ elements from the list.
3450434509
"""
@@ -36992,6 +36997,8 @@ Specifies the attributes for a new or updated required status check.
3699236997
input RequiredStatusCheckInput {
3699336998
"""
3699436999
The ID of the App that must set the status in order for it to be accepted.
37000+
Omit this value to use whichever app has recently been setting this status, or
37001+
use "any" to allow any app to set the status.
3699537002
"""
3699637003
appId: ID
3699737004

data/graphql/schema.docs.graphql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34499,6 +34499,11 @@ type Repository implements Node & PackageOwner & ProjectOwner & RepositoryInfo &
3449934499
"""
3450034500
before: String
3450134501

34502+
"""
34503+
Filter by categories that are assignable by the viewer.
34504+
"""
34505+
filterByAssignable: Boolean = false
34506+
3450234507
"""
3450334508
Returns the first _n_ elements from the list.
3450434509
"""
@@ -36992,6 +36997,8 @@ Specifies the attributes for a new or updated required status check.
3699236997
input RequiredStatusCheckInput {
3699336998
"""
3699436999
The ID of the App that must set the status in order for it to be accepted.
37000+
Omit this value to use whichever app has recently been setting this status, or
37001+
use "any" to allow any app to set the status.
3699537002
"""
3699637003
appId: ID
3699737004

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| Python {% ifversion fpt or ghec %}| {% octicon "check" aria-label="The check icon" %} | {% octicon "check" aria-label="The check icon" %} | {% octicon "check" aria-label="The check icon" %}<br>pip | {% octicon "check" aria-label="The check icon" %}<br>pip | {% octicon "check" aria-label="The check icon" %} | {% octicon "x" aria-label="The X icon" %} |{% elsif ghes %}| {% octicon "check" aria-label="The check icon" %} | {% octicon "check" aria-label="The check icon" %}<br>pip {% ifversion ghes > 3.2 %}| {% octicon "check" aria-label="The check icon" %}<br>pip{% endif %} | {% octicon "check" aria-label="The check icon" %} | {% octicon "x" aria-label="The X icon" %} |{% elsif ghae %}| {% octicon "check" aria-label="The check icon" %} | {% octicon "check" aria-label="The check icon" %} | {% octicon "x" aria-label="The X icon" %} |{% endif %}
1+
| Python {% ifversion fpt or ghec %}| {% octicon "check" aria-label="The check icon" %} <br>precise| {% octicon "check" aria-label="The check icon" %} | {% octicon "check" aria-label="The check icon" %}<br>pip | {% octicon "check" aria-label="The check icon" %}<br>pip | {% octicon "check" aria-label="The check icon" %} | {% octicon "x" aria-label="The X icon" %} |{% elsif ghes %}| {% octicon "check" aria-label="The check icon" %} | {% octicon "check" aria-label="The check icon" %}<br>pip {% ifversion ghes > 3.2 %}| {% octicon "check" aria-label="The check icon" %}<br>pip{% endif %} | {% octicon "check" aria-label="The check icon" %} | {% octicon "x" aria-label="The X icon" %} |{% elsif ghae %}| {% octicon "check" aria-label="The check icon" %} | {% octicon "check" aria-label="The check icon" %} | {% octicon "x" aria-label="The X icon" %} |{% endif %}

lib/graphql/static/changelog.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
[
2+
{
3+
"schemaChanges": [
4+
{
5+
"title": "The GraphQL schema includes these changes:",
6+
"changes": [
7+
"Argument `filterByAssignable: Boolean` added to field `Repository.discussionCategories`"
8+
]
9+
}
10+
],
11+
"previewChanges": [],
12+
"upcomingChanges": [],
13+
"date": "2021-12-09"
14+
},
215
{
316
"schemaChanges": [
417
{

lib/graphql/static/prerendered-input-objects.json

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)