Skip to main content

Diese Version von GitHub Enterprise Server wird eingestellt am 2026-04-09. Es wird keine Patch-Freigabe vorgenommen, auch nicht für kritische Sicherheitsprobleme. Für bessere Leistung, verbesserte Sicherheit und neue Features aktualisiere auf die neueste Version von GitHub Enterprise Server. Wende dich an den GitHub Enterprise-Support, um Hilfe zum Upgrade zu erhalten.

Exploring the structure of your source code

Visualize how your code maps to CodeQL classes in VS Code.

Prerequisites

To view the abstract syntax tree (AST) of a source file, you need to have an appropriate CodeQL query (usually printAST.ql) in your workspace. If you do not have an appropriate query, you can update your copy of the github/codeql repository from the main branch.

Hinweis

Updating your repository may discard your query caches, making your next query runs slower.

Viewing the abstract syntax tree of a source file

  1. Open the "Databases" view in the extension, and right-click the database that you want to explore. Click Add Database Source to Workspace.
  2. Navigate to a CodeQL database's source file in the File Explorer.
  3. Run CodeQL: View AST from the VS Code Command Palette. This runs a CodeQL query over the active file, which may take a few seconds. Once the query is complete, the AST viewer will display the structure of the source file.
  4. To see the nested structure of the source file, click the arrows and expand the nodes. These nodes represent different elements of your code, such as statements and expressions.
  5. To see the source code corresponding to a particular node, click the node in the AST viewer. Similarly, you can click a section of the source code to display the corresponding node.