Logo
  1. Potens.io
  2. Goliath
  3. User Manual

Articles > IntelliSense

  • Command Palette
  • Top Navigator Menu
  • Navigator
  • Browser
  • Playground
  • Data Explorer
  • Geography Visualization
  • Execution Details
  • IntelliSense
  • Sessions
See more

The Editor provides IntelliSense that includes formatting, highlighting, auto-completion for keywords and data objects, code folding. Options can be configured in Settings.

 

Line numbering

Screen_Shot_2023-02-27_at_11.49.05_AM.png

Query editor contains line numbers for each line of text

Context Sensitive Syntax Coloring

i1.jpg
Keywords are color coded

Auto Completion with Hints

Screen_Shot_2023-02-27_at_11.53.45_AM.png

Keyword autocomplete

  1. Ctrl-Space for list of keyword selections
  2. Select from list to add to query

Bracket Matching

Screen_Shot_2023-02-27_at_11.57.20_AM.png

Brackets such as (), [], and {} color code match

  1. Place cursor next to bracket to color code identify its corresponding bracket

Embracing Selection in Brackets

Screen_Shot_2023-02-27_at_12.00.24_PM.png

Words can be embraced in brackets such as (), {}, [], “”, ‘’, and ``

  1. Highlight text to embrace
  2. Type a qualifying open bracket to embrace selection

Multiline Cursor and Selection

Screen_Shot_2023-02-27_at_12.01.45_PM.png

Multiple cursors can be made across the same and multiple lines

  1. Place cursor at desired location
  2. Click Ctrl and place cursor at desired location
  3. Repeat step 2 until all cursors are created

 

Multiple selections can be made across the same and multiple lines

  1. Select desired content
  2. Click Ctrl + select desired content
  3. Repeat step 2 until all desired content is selected

Block Selection

Screen_Shot_2023-02-27_at_12.02.57_PM.png

  1. Select consecutive multiple lines
  2. Hit tab to indent
  3. Hit shift + tab to reduce indent

Multi Query

Multiple queries can be composed in the query text area.  
Construct multiple queries by separating them using ##bq
Query in focus is the query that will be selected to run.  Query in focus selection can be made by highlighting text or positioning cursor between ##bq separators.

Screen_Shot_2023-02-27_at_1.03.03_PM.png

Adding multiple queries to the query text area

  1. Separate queries by ##bq
  2. Construct query

 

Screen_Shot_2023-02-27_at_1.03.14_PM.png

 

One of two ways to set query in focus is by highlighting text

  1. Highlight text to set query in focus
  2. Run query or F5

 

Screen_Shot_2023-02-27_at_1.03.31_PM.png

The second of two ways to set query in focus is by placing
the cursor between the query separators (##bq)

  1. Identify query to set in focus
  2. Place cursor in area between query separators (##bq)
  3. Run query or F5

 

Screen_Shot_2023-02-27_at_1.04.08_PM.png

Screen_Shot_2023-02-27_at_1.04.38_PM.png

To validate a query within multiple queries set the query in focus

  1. Identify query to evaluate
  2. Set the query in focus
  3. Wait for selection to be validated

 

 

Fold/Unfold Code

When editing SQL, GoBQ and JavaScript within an editor the code is foldable. 

Foldable code is indicated by arrows in the left margin next to the line numbers. 

Ellipsis at the end of a line indicates folded code. Clicking an ellipsis expands the folded lines.

Screen_Shot_2023-02-27_at_1.14.28_PM.png

 

Clicking the arrows expands and collapses foldable lines.

Screen_Shot_2023-02-27_at_1.14.46_PM.png

 

Hovering over an ellipsis displays a popup with a preview of the collapsed code.

Screen_Shot_2023-02-27_at_1.15.04_PM.png

 

Foldable lines may also be toggled using keyboard shortcuts. CTRL+Q toggles folding for the active line. CTRL+SHIFT+Q toggles folding for all foldable lines.

Multiline Comments

To add multiline comments follow steps for Multiline Cursor and Selection (7) above and then type comments

Multiline

See Multiline Cursor and Selection and Multiline Comments above

IntelliSense for Data Objects

Project/Dataset/Table Selection

Shift + Ctrl and space opens projects list along with column count.

Screen_Shot_2023-02-27_at_1.19.23_PM.png

 

Make selection to list project datasets along with table count.  The project is added to query editor.

Screen_Shot_2023-02-27_at_1.21.22_PM.png

 

Make selection to list dataset tables.  The dataset is added to query editor.

Screen_Shot_2023-02-27_at_1.21.31_PM.png

 

Make selection to add table to query editor.

Screen_Shot_2023-02-27_at_1.21.42_PM.png

A table can be selected and added to query editor by

  1. Hold Shift + Ctrl and click space to bring up project list.
  2. From the display of projects and dataset count select project to list datasets
  3. From the display of project.datasets and table counts select dataset to list tables
  4. From list of tables make a selection to add it to query editor

Column Selection

Add tables to query editor

Screen_Shot_2023-02-27_at_1.22.31_PM.png

 

Place cursor between SELECT and FROM then Ctrl + space to bring up column selection for those tables 

Screen_Shot_2023-02-27_at_1.22.31_PM.png

Make a selection to view columns along with data types for that table

Screen_Shot_2023-02-27_at_1.22.41_PM.png

 

Select column to add it to query editor

Screen_Shot_2023-02-27_at_2.05.24_PM.png

Columns can be selected and added to the query editor by

  1. After SELECT statement click Ctrl + space to bring up IntelliSense list.  Notice names of tables from query editor appear at top of list
  2. Make table selection to list table’s columns along with datatype
  3. Make a column selection to add the column to query editor

Meta-tables

Shift + Ctrl and space opens projects list along with column count.

Screen_Shot_2023-02-27_at_1.19.23_PM.png

 

Make selection to list project datasets along with table count.  The project is added to query editor.

Screen_Shot_2023-02-27_at_2.11.26_PM.png

 

Make selection to list dataset tables.  The dataset is added to query editor.  Scroll to bottom of list to see meta-tables

Screen_Shot_2023-02-27_at_1.24.00_PM.png

 

Make selection to add meta-table to query editor

Screen_Shot_2023-02-27_at_1.24.11_PM.png

A meta-table can be selected and added to query editor by

  1. Hold Shift + Ctrl and click space to bring up project list.
  2. From the display of projects and dataset count select project to list datasets
  3. From the display of project.datasets and table counts scroll to bottom of list to see meta-tables
  4. From list of meta-tables make a selection to add it to query editor

Pseudo Column

Add tables to query editor

Screen_Shot_2023-02-27_at_1.25.01_PM.png

 

Place cursor between SELECT and FROM then Ctrl + space to bring up column selection for those tables 

Screen_Shot_2023-02-27_at_1.25.15_PM.png

 

Make a selection to view columns along with data types for that table. Pseudo columns are on the bottom of list

Screen_Shot_2023-02-27_at_1.25.29_PM.png

 

Select pseudo column to add it to query editor

Screen_Shot_2023-02-27_at_1.25.37_PM.png

If a table has a pseudo column such as _PARTITIONTIME for a partitioned table the pseudo column is available for selection

  1. After SELECT statement click Ctrl + space to bring up IntelliSense list.  Notice names of tables from query editor appear at top of list
  2. Make table selection to list table’s columns along with datatype.  Pseudo columns are on bottom of list
  3. Make a pseudo column selection to add the column to query editor

Table/view Aliases 

When an aliased table/view is following by a dot, the hints column for the table will present respective columns to pick from.

image2021-11-1_16-47-44.png

Information Schema

Make selections to list dataset tables.  The dataset is added to query editor.  Scroll to bottom of list to see Information Schema options.

Screen_Shot_2023-02-27_at_1.24.00_PM.png

Information Schema are views that display metadata.

An Information Schema view can be selected and added to query editor by

  1. Hold Shift + Ctrl and click space to bring up project list.
  2. From the display of projects and dataset count select project to list datasets
  3. From the display of project.datasets and table counts scroll to bottom of list to see Information Schemas
  4. From list of Information Schemas make a selection to add it to query editor

Find/Replace

Editor content can be searched for and replace specific text (regular expression is supported) within SQL queries, making it easier to make edits and changes.

To invoke the feature, click a combination of keyboard shortcuts while the query editor is in focus. Actions are outlined in the below table. 

PC

Mac

Action

CTRL + F

⌘F

Find

SHIFT + CTRL + R

⌥⌘R

Replace

CTRL + G

⌘G

Find Next

SHIFT + CTRL + G

⇧⌘G

Find Previous

ALT + F

⌥F

Quick Search

Alt + G

⌥G

Jump to Line

 

You can also find the list of key binds by hovering over Shortcuts in the upper right corner.

Screen_Shot_2022-12-09_at_9.25.51_AM.png

 

Find

Find searches the query text and highlights matches. Matches are highlighted in yellow while the current focused match is orange. To invoke Find, focus the query editor, and click Ctrl+F on a PC or ⌘F on a Mac. A dialog box will open at the bottom of the editor prompting for input.

Screen_Shot_2023-02-27_at_4.39.16_PM.png

 
Click enter in the Find input field to cycle through matches.

Screen_Shot_2023-02-27_at_4.39.29_PM.png


Find accepts regular expression search by using the syntax of /re/. To use regular expression, wrap the expression in ‘/’. For example, to search for digits enter /\d+/.

Screen_Shot_2023-02-27_at_4.41.13_PM.png


To close the dialog box, click ESC or mouse click outside the box. It will close, and matches will be cleared.
 

Replace 

Replace prompts to search the query text and replace the matches with another input value. Replace contains three steps. The first step requests the value to match. The second step asks what value to replace with. The final step will prompt for Yes, No, All, or Stop. Yes will replace the current match and move to the next match. No, will skip replacement of the current match and move to the next match. All will replace all the matches. Stop will close the dialogue and stop replacing. 

To invoke Replace, focus the query editor, and click SHIFT + CTRL + R on a PC or ⌥⌘R on a Mac. A dialog box will open at the bottom of the editor prompting for input.
Screen_Shot_2022-12-09_at_10.17.44_AM.png

Enter the text to be replaced and click enter. Regular expression can be used for Replace. The next dialogue will prompt for the value to be replaced with. Add the value then click enter to proceed to the next step.
Screen_Shot_2022-12-09_at_10.19.56_AM.png


A Replace? prompt will appear for each match. Yes will replace the current match and move to the next match. No, will skip replacement of the current match and move to the next match. All will replace all the matches. Stop will close the dialogue and stop replacing.

Screen_Shot_2022-12-09_at_10.21.33_AM.png


Find Next

Find Next identifies the next match in a list of matches. The match will be highlighted with orange. If Find is already invoked then Find Next will move to the next match. If Find is not invoked, Find Next will open a dialogue to enter the value to match. To invoke Find Next, focus the query editor, and click Ctrl+G on a PC or ⌘G on a Mac.

Find Previous 

Find Previous identifies the previous match in a list of matches. The match will be highlighted with orange. If Find is already invoked then Find Previous will move to the previous match. If Find is not invoked, Find Previous will open a dialogue to enter the value to match. To invoke Find Previous, focus the query editor, and click SHIFT + CTRL + G on a PC or ⇧⌘G on a Mac.

Quick Search 

Quick Search opens a dialogue box prompting for a value to match. Quick Search accepts regular expression search by using the syntax of /re/. Clicking enter closes the dialogue and displays all matches in yellow with the current match in orange. To clear the matches, reopen the dialogue box, either via Find or Quick Search, and click ESC or enter with no value. To invoke Quick Search, focus the query editor, and click ALT + F on a PC or ⌥F on a Mac.

Jump to Line 

Jump to line moves the cursor to the entered position. The jump can be by line and column or by a scroll percentage. 
The syntax for line and column is line:column where line and column are separated by a colon. Line is a number representing the line count of the query. Column is a number representing the count in position starting from the left of the line. Column is optional. If not supplied the default will be the current column position. To enter without column simply add the line number without : and column such as 9. To invoke Jump to Line, focus the query editor, and click Alt + G on a PC or ⌥G on a Mac. To move the cursor to line 9 and column 5 would be represented as 9:5.
Screen_Shot_2022-12-09_at_10.49.31_AM.png

 

The syntax for scroll% is #% where # is a number 0 – 100. The total line count is calculated and multiplied by the inputted value / 100. Decimals can also be added in the format of #.#% such as 14.5%. The resulting line is calculated and rounded. The line is then jumped to. For example, if there are 27 lines in the text and 50% is entered, the cursor will jump to line 14.
Screen_Shot_2022-12-09_at_10.59.54_AM.png


Matches on Scrollbar
 

If the scrollbar is set to persist (see your OS options), matches will appear in the scrollbar to indicate the position within the query editor. For example, if the query text exceeds the view port, a scroll bar will appear on the right. When using Find or Quick Search, matches that exists outside of the view port will have their position highlighted in the scrollbar. Scroll up or down to navigate to the locations for these matches. 

A match in view, with another match outside of view as indicated on the scrollbar.

Screen_Shot_2022-12-09_at_11.07.51_AM.png

Scrolling to the other match with the previous match now outside of view but shown in the scrollbar.

Screen_Shot_2022-12-09_at_11.08.03_AM.png

Settings

IntelliSense options can be configured in settings. Configuration includes autocomplete, search style, type case, and information schema default region.

Autocomplete Mode by default

IntelliSense matches keywords via auto complete. This option can be toggled to enable and disable. When enabled, typing will trigger keyword matches and display hints. Disable will not show hints while typing. Instead autocomplete can be triggered via the shortcut CTRL+Space.

Screen_Shot_2023-02-27_at_2.31.08_PM_copy.png

Search Style

When typing project, dataset, table, and column names in a query they can be matched anywhere in their name by text typed.
An option is available under Settings to toggle  between matching start of the name or anywhere in word.
Hover over Settings, identify option Match Start of Word and check or uncheck to set behavior.

Screen_Shot_2023-02-27_at_2.31.08_PM_copy_2.png

If checked, the match will be made by the start of the word. 
If unchecked, words will be matched by the typed text anywhere in the word. 

 

Match Start of Word

Match Anywhere in Word

image2021-11-6_18-11-48.png

image2021-11-6_18-12-9.png

image2021-11-6_18-12-1.png

image2021-11-6_18-12-18.png

Type Case

Keywords can be configured to stay in the case typed or transformed into upper or lower case. The preferred style for reserved words (keywords) can be selected in Settings by picking an option from the IntelliSense Case Type options.  

Screen_Shot_2023-02-27_at_2.33.49_PM.png

Note: when query is pasted into Goliath Editor from outside sources – the query will be formatted based on selected preferences.

A keyboard shortcut, SHIFT+CTRL+U, is available to switch between upper and lower cases.
Using of this shortcut will also change respective setting.
Note: Change of preferred case (either through Settings or respective shortcut)  is applied to all tabs in Editor and queries/scripts in them.

Screen_Shot_2023-02-27_at_2.34.51_PM_copy.png


Reminder: Upper/Lower Case management happens dynamically on background and does not change actual text of query/script, thus when you will copy / paste it outside of Goliath – you might see formatting different from how it appears/displayed in Goliath Editor. To make sure copy/paste preserves displayed format – use SHIFT+CTRL+F before copying.

Lower case option selected

image2021-4-24_18-28-5.png
vs. Upper case option selected

image2021-4-24_18-28-28.png

Information Schema Default Region

Information schema views are available when listing hints for data objects. Many of these views need to reference the processing location region. Instead of filling the hints list with all regions, only the default region will display. To change the default region, click and select the option from the Information Schema Default region drop down.

Screen_Shot_2023-02-27_at_2.31.08_PM_copy_4.png

Potens.io
Launch Magnus | Goliath