The main body of the Quick Query window is a standard text editor for CodeQL queries. It is particularly useful for developing and testing new queries. If you want to edit CodeQL libraries or saved query files, you can use the QL editor.
Displaying the Quick Query window
To display the Quick Query window, click the Quick Query icon () in the Results view.
In the Quick Query window, there are two main areas of control:
- Top toolbar—defines the display name
for any results of this query. It also includes three icons:
- Bottom toolbar—defines the initial display format for the query results. The buttons and display styles are the same as those described for the Results panel of the Results view.
|Run the query (equivalent to Ctrl+R).|
|Save the query.|
|Restore the previous query.|
The Quick Query window supports the following options:
|Auto-complete||Display auto-complete information in a pop-up window. This is normally triggered automatically as you type your query. You can also manually re-display the information (for example, after deleting a predicate).||
Automatic or Ctrl+Space
Format the currently open
|QL entity info||Show a description of the current QL entity including any QLDoc. This is displayed in a pop-up window when you hover over an entity with your mouse cursor.||Hover over code|
Find all QL references to the selected element in files and display the results in a Search window.
Available only for types: find QL types that directly extend the selected type and display the results in a Search window.
|Multiline comments||When you
You can enable or disable this using the CodeQL for Eclipse preferences page.
Open the declaration of the selected predicate, type, or module in a QL file. This is the same as Jump to definition (F3).
Evaluate the currently selected snippet of QL code and report the results in the Results view. Possible targets for quick evaluation include:
This is particularly useful when you are debugging a query and want to locate the part of the query that is wrong.
|Spell check||Check the spelling of text in comments using the tool built in to Eclipse. You can enable or disable it using the General > Editors > Text Editors > Spelling preferences page.||Automatic|
|Syntax check||Underline any errors in red and highlight the line. The Run option is disabled until you have corrected the error. Hover the cursor over the error icon to display a tooltip describing the problem. Any warnings are underlined in orange.||Automatic|
You can close the Quick Query window at any time by pressing the keyboard Escape key.