Skip to content

Commit 2f4eea5

Browse files
committed
Update docs for exploring ASTs
1 parent 91d224e commit 2f4eea5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

docs/codeql/codeql-for-visual-studio-code/exploring-the-structure-of-your-source-code.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,26 @@ CodeQL for Visual Studio Code contains an AST viewer. The viewer consists of a g
1818
Viewing the abstract syntax tree of a source file
1919
--------------------------------------------------
2020

21-
1. Open a source file from a CodeQL database. For example, you can navigate to a source file in the File Explorer.
21+
1. Open the CodeQL Databases view and right-click the database that you want to explore. Click **Add Database Source to Workspace**.
22+
23+
.. image:: ../images/codeql-for-visual-studio-code/add-database-source-to-workspace.png
24+
:width: 350
25+
:alt: Add database source to workspace
26+
27+
2. Navigate to a source file from a CodeQL database in the File Explorer.
2228

2329
.. image:: ../images/codeql-for-visual-studio-code/open-source-file.png
2430
:width: 350
2531
:alt: Open a source file
2632

27-
2. Run **CodeQL: View AST** from the Command Palette. This runs a CodeQL query (usually called ``printAST.ql``) over the active file, which may take a few seconds.
33+
3. Run **CodeQL: View AST** from the Command Palette. This runs a CodeQL query (usually called ``printAST.ql``) over the active file, which may take a few seconds.
2834

2935
.. pull-quote:: Note
3036

3137
If you don't have an appropriate ``printAST.ql`` query in your workspace, the **CodeQL: View AST** command won't work. To fix this, you can update your copy of the `CodeQL <https://github.com/github/codeql>`__ repository from ``main``. If you do this, you may need to upgrade your databases. Also, query caches may be discarded and your next query runs could be slower.
3238

33-
3. Once the query has run, the AST viewer displays the structure of the source file.
34-
4. To see the nested structure, click the arrows and expand the nodes.
39+
4. Once the query has run, the AST viewer displays the structure of the source file.
40+
5. To see the nested structure, click the arrows and expand the nodes.
3541

3642
.. image:: ../images/codeql-for-visual-studio-code/explore-ast.png
3743
:alt: Explore the AST
72.8 KB
Loading
-1.73 KB
Loading

0 commit comments

Comments
 (0)