From 3782d1b6e4fd52d9db187d98bd6b512c2bab5f79 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 27 Nov 2019 12:28:57 +0000 Subject: [PATCH 1/3] docs: update links on opening slide --- docs/language/ql-training/cpp/bad-overflow-guard.rst | 2 +- docs/language/ql-training/cpp/control-flow-cpp.rst | 2 +- docs/language/ql-training/cpp/data-flow-cpp.rst | 2 +- docs/language/ql-training/cpp/global-data-flow-cpp.rst | 2 +- docs/language/ql-training/cpp/intro-ql-cpp.rst | 2 +- docs/language/ql-training/cpp/snprintf.rst | 2 +- docs/language/ql-training/java/apache-struts-java.rst | 2 +- docs/language/ql-training/java/data-flow-java.rst | 2 +- docs/language/ql-training/java/global-data-flow-java.rst | 2 +- docs/language/ql-training/java/intro-ql-java.rst | 2 +- docs/language/ql-training/java/query-injection-java.rst | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/language/ql-training/cpp/bad-overflow-guard.rst b/docs/language/ql-training/cpp/bad-overflow-guard.rst index dceeec3320f1..1ae193b10f00 100644 --- a/docs/language/ql-training/cpp/bad-overflow-guard.rst +++ b/docs/language/ql-training/cpp/bad-overflow-guard.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `ChakraCore database `__ .. note:: diff --git a/docs/language/ql-training/cpp/control-flow-cpp.rst b/docs/language/ql-training/cpp/control-flow-cpp.rst index f72633b714f2..64c34b463288 100644 --- a/docs/language/ql-training/cpp/control-flow-cpp.rst +++ b/docs/language/ql-training/cpp/control-flow-cpp.rst @@ -13,7 +13,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `ChakraCore database `__ .. note:: diff --git a/docs/language/ql-training/cpp/data-flow-cpp.rst b/docs/language/ql-training/cpp/data-flow-cpp.rst index 32a3dfa233b6..9d2f29863c96 100644 --- a/docs/language/ql-training/cpp/data-flow-cpp.rst +++ b/docs/language/ql-training/cpp/data-flow-cpp.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `dotnet/coreclr database `__ .. note:: diff --git a/docs/language/ql-training/cpp/global-data-flow-cpp.rst b/docs/language/ql-training/cpp/global-data-flow-cpp.rst index aaa567e7a8e6..8fb3f64b534f 100644 --- a/docs/language/ql-training/cpp/global-data-flow-cpp.rst +++ b/docs/language/ql-training/cpp/global-data-flow-cpp.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `dotnet/coreclr database `__ .. note:: diff --git a/docs/language/ql-training/cpp/intro-ql-cpp.rst b/docs/language/ql-training/cpp/intro-ql-cpp.rst index 4e2cd4ca0b44..72fa57308f4c 100644 --- a/docs/language/ql-training/cpp/intro-ql-cpp.rst +++ b/docs/language/ql-training/cpp/intro-ql-cpp.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `exiv2 database `__ .. note:: diff --git a/docs/language/ql-training/cpp/snprintf.rst b/docs/language/ql-training/cpp/snprintf.rst index 3b76f1a4ce20..1591531460e0 100644 --- a/docs/language/ql-training/cpp/snprintf.rst +++ b/docs/language/ql-training/cpp/snprintf.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `rsyslog database `__ .. note:: diff --git a/docs/language/ql-training/java/apache-struts-java.rst b/docs/language/ql-training/java/apache-struts-java.rst index c21ad4608ca0..678646996732 100644 --- a/docs/language/ql-training/java/apache-struts-java.rst +++ b/docs/language/ql-training/java/apache-struts-java.rst @@ -15,7 +15,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `Apache Struts database `__ .. note:: diff --git a/docs/language/ql-training/java/data-flow-java.rst b/docs/language/ql-training/java/data-flow-java.rst index 93ccc87b7d1f..85ff86887581 100644 --- a/docs/language/ql-training/java/data-flow-java.rst +++ b/docs/language/ql-training/java/data-flow-java.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `VIVO Vitro database `__ .. note:: diff --git a/docs/language/ql-training/java/global-data-flow-java.rst b/docs/language/ql-training/java/global-data-flow-java.rst index d65fd6133c5e..80d13fbadaca 100644 --- a/docs/language/ql-training/java/global-data-flow-java.rst +++ b/docs/language/ql-training/java/global-data-flow-java.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `Apache Struts database `__ .. note:: diff --git a/docs/language/ql-training/java/intro-ql-java.rst b/docs/language/ql-training/java/intro-ql-java.rst index 1666d9caca8c..2d5a98fc9446 100644 --- a/docs/language/ql-training/java/intro-ql-java.rst +++ b/docs/language/ql-training/java/intro-ql-java.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `Apache Struts database `__ .. note:: diff --git a/docs/language/ql-training/java/query-injection-java.rst b/docs/language/ql-training/java/query-injection-java.rst index 799c99e52095..f9911de137be 100644 --- a/docs/language/ql-training/java/query-injection-java.rst +++ b/docs/language/ql-training/java/query-injection-java.rst @@ -11,7 +11,7 @@ Setup For this example you should download: -- `QL for Eclipse `__ +- `CodeQL for Visual Studio Code `__ - `VIVO Vitro database `__ .. note:: From 24857e5616d1cb2ba5557bff11af9e304102efc0 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 27 Nov 2019 15:05:08 +0000 Subject: [PATCH 2/3] docs: update or remove other uses of QL4E --- docs/language/ql-training/java/intro-ql-java.rst | 4 ++-- docs/language/ql-training/slide-snippets/intro-ql-general.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/language/ql-training/java/intro-ql-java.rst b/docs/language/ql-training/java/intro-ql-java.rst index 2d5a98fc9446..f93a619c142a 100644 --- a/docs/language/ql-training/java/intro-ql-java.rst +++ b/docs/language/ql-training/java/intro-ql-java.rst @@ -105,8 +105,8 @@ Each query library also implicitly defines a module. .. note:: - Queries are always contained in query files with the file extension ``.ql``. `Quick queries `__, run in `QL for Eclipse `__, are no exception: the quick query window maintains a temporary QL file in the background. - + Queries are always contained in query files with the file extension ``.ql``. + Parts of queries can be lifted into `library files `__ with the extension ``.qll``. Definitions within such libraries can be brought into scope using “import” statements, and similarly QLL files can import each other’s definitions using “import” statements. Logic can be encapsulated as user-defined `predicates `__ and `classes `__, and organized into `modules `__. Each QLL file implicitly defines a module, but QL and QLL files can also contain explicit module definitions, as we will see later. diff --git a/docs/language/ql-training/slide-snippets/intro-ql-general.rst b/docs/language/ql-training/slide-snippets/intro-ql-general.rst index ae0c0cdabb58..b53c6bbb0152 100644 --- a/docs/language/ql-training/slide-snippets/intro-ql-general.rst +++ b/docs/language/ql-training/slide-snippets/intro-ql-general.rst @@ -109,7 +109,7 @@ Analysis overview Queries are written in `QL `__ and usually depend on one or more of the `standard CodeQL libraries `__ (and of course you can write your own custom libraries). They are compiled into an efficiently executable format by the QL compiler and then run on a CodeQL database by the QL evaluator, either on a remote worker machine or locally on a developer’s machine. - Query results can be interpreted and presented in a variety of ways, including displaying them in an `IDE plugin `__ such as QL for Eclipse, or in a web dashboard as on `LGTM `__. + Query results can be interpreted and presented in a variety of ways, including displaying them in an `IDE extension `__ such as CodeQL for Visual Studio Code, or in a web dashboard as on `LGTM `__. Introducing QL ============== From 931cc73d1ee733f58ac53e6e54df8f68c09213c9 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 27 Nov 2019 15:05:50 +0000 Subject: [PATCH 3/3] docs: add brief instructions for using databases in VS Code --- .../slides-semmle-2/static/theme/css/default.css | 9 +++++++++ .../ql-training/slide-snippets/database-note.rst | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/language/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css b/docs/language/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css index 3f8a89c65555..dad8b305ed6b 100644 --- a/docs/language/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css +++ b/docs/language/ql-training/_static-training/slides-semmle-2/static/theme/css/default.css @@ -1667,6 +1667,15 @@ li > ul > li { margin-bottom: 0; } +.admonition.note ol { + width: 90%; + margin-left: 2.2em; +} + +.admonition.note ol > li { + margin-top: 0.5em; +} + /* * extra styles for more appropriate for syntax highlighting * diff --git a/docs/language/ql-training/slide-snippets/database-note.rst b/docs/language/ql-training/slide-snippets/database-note.rst index af6dce237289..f0bfbeca07f2 100644 --- a/docs/language/ql-training/slide-snippets/database-note.rst +++ b/docs/language/ql-training/slide-snippets/database-note.rst @@ -1 +1,9 @@ -Note that results generated in the query console are likely to differ to those generated in the QL plugin as LGTM.com analyzes the most recent revisions of each project that has been added–the CodeQL database available to download above is based on an historical version of the codebase. \ No newline at end of file +You can download the database as a zip file by clicking the link on the slide above. To use the database in CodeQL for Visual Studio Code: + +#. Unzip the file +#. Add the unzipped database to Visual Studio Code +#. Upgrade the database if necessary + +For further information, see `Using the extension `__ in the CodeQL for Visual Studio Code help. + +Note that results generated in the query console are likely to differ to those generated in CodeQL for Visual Studio Code as LGTM.com analyzes the most recent revisions of each project that has been added–the CodeQL database available to download above is based on an historical version of the codebase. \ No newline at end of file