Skip to content

Commit 178b5c1

Browse files
authored
Merge pull request github#14282 from github/saritai/update-language-display-names
Update language display names
2 parents 81e4cdd + f29063b commit 178b5c1

22 files changed

+87
-75
lines changed

docs/codeql/codeql-language-guides/abstract-syntax-tree-classes-for-working-with-java-programs.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. _abstract-syntax-tree-classes-for-working-with-java-programs:
22

3-
Abstract syntax tree classes for working with Java programs
4-
===========================================================
3+
Abstract syntax tree classes for working with Java and Kotlin programs
4+
======================================================================
55

6-
CodeQL has a large selection of classes for representing the abstract syntax tree of Java programs.
6+
CodeQL has a large selection of classes for representing the abstract syntax tree of Java and Kotlin programs.
77

88
.. include:: ../reusables/abstract-syntax-tree.rst
99

docs/codeql/codeql-language-guides/analyzing-data-flow-in-java.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. _analyzing-data-flow-in-java:
22

3-
Analyzing data flow in Java
4-
===========================
3+
Analyzing data flow in Java and Kotlin
4+
======================================
55

6-
You can use CodeQL to track the flow of data through a Java program to its use.
6+
You can use CodeQL to track the flow of data through a Java/Kotlin program to its use.
77

88
.. include:: ../reusables/kotlin-beta-note.rst
99

@@ -12,7 +12,7 @@ You can use CodeQL to track the flow of data through a Java program to its use.
1212
About this article
1313
------------------
1414

15-
This article describes how data flow analysis is implemented in the CodeQL libraries for Java and includes examples to help you write your own data flow queries.
15+
This article describes how data flow analysis is implemented in the CodeQL libraries for Java/Kotlin and includes examples to help you write your own data flow queries.
1616
The following sections describe how to use the libraries for local data flow, global data flow, and taint tracking.
1717

1818
For a more general introduction to modeling data flow, see ":ref:`About data flow analysis <about-data-flow-analysis>`."

docs/codeql/codeql-language-guides/annotations-in-java.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.. _annotations-in-java:
22

3-
Annotations in Java
4-
===================
3+
Annotations in Java and Kotlin
4+
==============================
55

6-
CodeQL databases of Java projects contain information about all annotations attached to program elements.
6+
CodeQL databases of Java/Kotlin projects contain information about all annotations attached to program elements.
7+
8+
.. include:: ../reusables/kotlin-beta-note.rst
79

810
About working with annotations
911
------------------------------
@@ -15,7 +17,7 @@ Annotations are represented by these CodeQL classes:
1517
- The class ``AnnotationElement`` represents an annotation element, that is, a member of an annotation type.
1618
- The class ``Annotation`` represents an annotation such as ``@Override``; annotation values can be accessed through member predicate ``getValue``.
1719

18-
For example, the Java standard library defines an annotation ``SuppressWarnings`` that instructs the compiler not to emit certain kinds of warnings:
20+
For example, the Java/Kotlin standard library defines an annotation ``SuppressWarnings`` that instructs the compiler not to emit certain kinds of warnings:
1921

2022
.. code-block:: java
2123
@@ -101,7 +103,7 @@ As a first step, let's write a query that finds all ``@Override`` annotations. A
101103
where ann.getType().hasQualifiedName("java.lang", "Override")
102104
select ann
103105
104-
As always, it is a good idea to try this query on a CodeQL database for a Java project to make sure it actually produces some results. On the earlier example, it should find the annotation on ``Sub1.m``. Next, we encapsulate the concept of an ``@Override`` annotation as a CodeQL class:
106+
As always, it is a good idea to try this query on a CodeQL database for a Java/Kotlin project to make sure it actually produces some results. On the earlier example, it should find the annotation on ``Sub1.m``. Next, we encapsulate the concept of an ``@Override`` annotation as a CodeQL class:
105107

106108
::
107109

@@ -185,7 +187,7 @@ For more information about the class ``Call``, see ":doc:`Navigating the call gr
185187
Improvements
186188
~~~~~~~~~~~~
187189

188-
The Java standard library provides another annotation type ``java.lang.SupressWarnings`` that can be used to suppress certain categories of warnings. In particular, it can be used to turn off warnings about calls to deprecated methods. Therefore, it makes sense to improve our query to ignore calls to deprecated methods from inside methods that are marked with ``@SuppressWarnings("deprecation")``.
190+
The Java/Kotlin standard library provides another annotation type ``java.lang.SupressWarnings`` that can be used to suppress certain categories of warnings. In particular, it can be used to turn off warnings about calls to deprecated methods. Therefore, it makes sense to improve our query to ignore calls to deprecated methods from inside methods that are marked with ``@SuppressWarnings("deprecation")``.
189191

190192
For instance, consider this slightly updated example:
191193

docs/codeql/codeql-language-guides/basic-query-for-java-code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Further reading
133133

134134
.. Article-specific substitutions for the reusables used in docs/codeql/reusables/vs-code-basic-instructions
135135
136-
.. |language-text| replace:: Java
136+
.. |language-text| replace:: Java/Kotlin
137137

138138
.. |language-code| replace:: ``java``
139139

docs/codeql/codeql-language-guides/basic-query-for-javascript-code.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _basic-query-for-javascript-code:
22

3-
Basic query for JavaScript code
4-
===============================
3+
Basic query for JavaScript and TypeScript code
4+
===============================================
55

66
Learn to write and run a simple CodeQL query using Visual Studio Code with the CodeQL extension.
77

@@ -10,7 +10,7 @@ Learn to write and run a simple CodeQL query using Visual Studio Code with the C
1010
About the query
1111
---------------
1212

13-
In JavaScript, any expression can be turned into an expression statement. While this is sometimes convenient, it can be dangerous. For example, imagine a programmer wants to assign a new value to a variable ``x`` by means of an assignment ``x = 42``. However, they accidentally type two equals signs, producing the comparison statement ``x == 42``. This is valid JavaScript, so no error is generated. The statement simply compares ``x`` to ``42``, and then discards the result of the comparison.
13+
In JavaScript and TypeScript, any expression can be turned into an expression statement. While this is sometimes convenient, it can be dangerous. For example, imagine a programmer wants to assign a new value to a variable ``x`` by means of an assignment ``x = 42``. However, they accidentally type two equals signs, producing the comparison statement ``x == 42``. This is valid JavaScript, so no error is generated. The statement simply compares ``x`` to ``42``, and then discards the result of the comparison.
1414

1515
The query you will run finds instances of this problem. The query searches for expressions ``e`` that are pure—that is, their evaluation does not lead to any side effects—but appear as an expression statement.
1616

@@ -50,7 +50,7 @@ After the initial ``import`` statement, this simple query comprises three parts
5050
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
5151
| Query part | Purpose | Details |
5252
+===============================================================+===================================================================================================================+========================================================================================================================+
53-
| ``import javascript`` | Imports the standard CodeQL libraries for JavaScript. | Every query begins with one or more ``import`` statements. |
53+
| ``import javascript`` | Imports the standard CodeQL libraries for JavaScript and TypeScript. | Every query begins with one or more ``import`` statements. |
5454
+---------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
5555
| ``from Expr e`` | Defines the variables for the query. | ``e`` is declared as a variable that ranges over expressions. |
5656
| | Declarations are of the form: | |

docs/codeql/codeql-language-guides/codeql-for-java.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
1010

1111
.. pull-quote:: Enabling Kotlin support
1212

13-
CodeQL treats Java and Kotlin as parts of the same language, so to enable Kotlin support you should enable ``java`` as a language.
13+
CodeQL treats Java and Kotlin as parts of the same language, so to enable Kotlin support you should enable ``java-kotlin`` as a language.
1414

1515
.. toctree::
1616
:hidden:
@@ -26,22 +26,22 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
2626
working-with-source-locations
2727
abstract-syntax-tree-classes-for-working-with-java-programs
2828

29-
- :doc:`Basic query for Java code <basic-query-for-java-code>`: Learn to write and run a simple CodeQL query.
29+
- :doc:`Basic query for Java and Kotlin code <basic-query-for-java-code>`: Learn to write and run a simple CodeQL query.
3030

31-
- :doc:`CodeQL library for Java <codeql-library-for-java>`: When analyzing Java code, you can use the large collection of classes in the CodeQL library for Java.
31+
- :doc:`CodeQL library for Java and Kotlin <codeql-library-for-java>`: When analyzing Java/Kotlin code, you can use the large collection of classes in the CodeQL library for Java/Kotlin.
3232

33-
- :doc:`Analyzing data flow in Java <analyzing-data-flow-in-java>`: You can use CodeQL to track the flow of data through a Java program to its use.
33+
- :doc:`Analyzing data flow in Java and Kotlin <analyzing-data-flow-in-java>`: You can use CodeQL to track the flow of data through a Java/Kotlin program to its use.
3434

35-
- :doc:`Java types <types-in-java>`: You can use CodeQL to find out information about data types used in Java code. This allows you to write queries to identify specific type-related issues.
35+
- :doc:`Java and Kotlin types <types-in-java>`: You can use CodeQL to find out information about data types used in Java/Kotlin code. This allows you to write queries to identify specific type-related issues.
3636

37-
- :doc:`Overflow-prone comparisons in Java <overflow-prone-comparisons-in-java>`: You can use CodeQL to check for comparisons in Java code where one side of the comparison is prone to overflow.
37+
- :doc:`Overflow-prone comparisons in Java and Kotlin <overflow-prone-comparisons-in-java>`: You can use CodeQL to check for comparisons in Java/Kotlin code where one side of the comparison is prone to overflow.
3838

3939
- :doc:`Navigating the call graph <navigating-the-call-graph>`: CodeQL has classes for identifying code that calls other code, and code that can be called from elsewhere. This allows you to find, for example, methods that are never used.
4040

41-
- :doc:`Annotations in Java <annotations-in-java>`: CodeQL databases of Java projects contain information about all annotations attached to program elements.
41+
- :doc:`Annotations in Java and Kotlin <annotations-in-java>`: CodeQL databases of Java/Kotlin projects contain information about all annotations attached to program elements.
4242

4343
- :doc:`Javadoc <javadoc>`: You can use CodeQL to find errors in Javadoc comments in Java code.
4444

45-
- :doc:`Working with source locations <working-with-source-locations>`: You can use the location of entities within Java code to look for potential errors. Locations allow you to deduce the presence, or absence, of white space which, in some cases, may indicate a problem.
45+
- :doc:`Working with source locations <working-with-source-locations>`: You can use the location of entities within Java/Kotlin code to look for potential errors. Locations allow you to deduce the presence, or absence, of white space which, in some cases, may indicate a problem.
4646

47-
- :doc:`Abstract syntax tree classes for working with Java programs <abstract-syntax-tree-classes-for-working-with-java-programs>`: CodeQL has a large selection of classes for representing the abstract syntax tree of Java programs.
47+
- :doc:`Abstract syntax tree classes for working with Java and Kotlin programs <abstract-syntax-tree-classes-for-working-with-java-programs>`: CodeQL has a large selection of classes for representing the abstract syntax tree of Java/Kotlin programs.

docs/codeql/codeql-language-guides/codeql-for-javascript.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. _codeql-for-javascript:
22

3-
CodeQL for JavaScript
4-
=====================
3+
CodeQL for JavaScript and TypeScript
4+
====================================
55

6-
Experiment and learn how to write effective and efficient queries for CodeQL databases generated from JavaScript codebases.
6+
Experiment and learn how to write effective and efficient queries for CodeQL databases generated from JavaScript and TypeScript codebases.
77

88
.. toctree::
99
:hidden:
@@ -18,7 +18,7 @@ Experiment and learn how to write effective and efficient queries for CodeQL dat
1818
abstract-syntax-tree-classes-for-working-with-javascript-and-typescript-programs
1919
data-flow-cheat-sheet-for-javascript
2020

21-
- :doc:`Basic query for JavaScript code <basic-query-for-javascript-code>`: Learn to write and run a simple CodeQL query.
21+
- :doc:`Basic query for JavaScript and TypeScript code <basic-query-for-javascript-code>`: Learn to write and run a simple CodeQL query.
2222

2323
- :doc:`CodeQL library for JavaScript <codeql-library-for-javascript>`: When you're analyzing a JavaScript program, you can make use of the large collection of classes in the CodeQL library for JavaScript.
2424

0 commit comments

Comments
 (0)