You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/repositories/working-with-files/using-files/navigating-code-on-github.md
+7-55Lines changed: 7 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,45 +19,13 @@ Code navigation helps you to read, navigate, and understand code by showing and
19
19
20
20

21
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.
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.
53
-
54
-
{% 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:
55
-
* Search-based - searches all definitions and references across a repository to find entities with a given name
56
-
* Precise - resolves definitions and references based on the set of classes, functions, and imported definitions at a given point in your code
57
-
58
-
To learn more about these approaches, see "[Precise and search-based navigation](#precise-and-search-based-navigation)."
59
-
60
-
Future releases will add _precise code navigation_ for more languages, which is a code navigation approach that can give more accurate results.
22
+
Code navigation uses the open source [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) library. The following languages support code navigation.
23
+
24
+
{% data reusables.search.code-nav-supported-languages %}
25
+
26
+
You do not need to configure anything in your repository to enable code navigation. We will automatically extract code navigation information for these supported languages in all repositories.
27
+
28
+
{% data variables.product.prodname_dotcom %} has developed a code navigation approach based on the open source [`tree-sitter`](https://github.com/tree-sitter/tree-sitter) library that searches all definitions and references across a repository to find entities with a given name.
61
29
62
30
{% ifversion code-view-ui %}You can use keyboard shortcuts to navigate within a code file. For more information, see "[AUTOTITLE](/get-started/accessibility/keyboard-shortcuts#navigating-within-code-files)."{% endif %}
63
31
@@ -95,22 +63,6 @@ You can find all references for a function or method within the same repository
95
63
96
64

97
65
98
-
## Precise and search-based navigation
99
-
100
-
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.
101
-
102
-
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.
103
-
104
-

105
-
106
-
If your precise results appear inaccurate, you can file a support request.
107
-
108
-
## Cross-repository precise code navigation
109
-
110
-
Cross-repo code navigation is available for languages that are supported by precise code navigation and the dependency graph. For more information, see "[AUTOTITLE](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph)." With cross-repo code navigation, you can jump to the definition of functions or variables defined in dependencies imported by your project if that dependency is a repository hosted by {% data variables.product.prodname_dotcom %}. Cross-repo code navigation does not support find-all-references requests at this time.
111
-
112
-

113
-
114
66
## Troubleshooting code navigation
115
67
116
68
If code navigation is enabled for you but you don't see links to the definitions of functions and methods:
Copy file name to clipboardExpand all lines: content/search-github/github-code-search/about-github-code-search.md
-4Lines changed: 0 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,6 @@ Code search is integrated with features in the search interface on {% data varia
22
22
23
23
{% data variables.product.prodname_dotcom %} code search provides code navigation for supported languages. This includes jumping to the definition of and finding references for programming language constructs like classes, structs, functions, and methods. See "[AUTOTITLE](/repositories/working-with-files/using-files/navigating-code-on-github)."
24
24
25
-
Supported languages for code navigation include:
26
-
27
-
{% data reusables.search.code-nav-supported-languages %}
28
-
29
25
## Limitations
30
26
31
27
We have indexed many public repositories for code search, and continue to index more. Additionally, the private repositories of {% data variables.product.prodname_dotcom %} users are indexed and searchable by those that already have access to those private repositories on {% data variables.product.prodname_dotcom %}. However, very large repositories may not be indexed at this time, and not all code is indexed.
0 commit comments