Skip to content

Commit

Permalink
Merge pull request #369 from KxSystems/v1.6.0-dev-to-main
Browse files Browse the repository at this point in the history
V1.6.0 dev to main
  • Loading branch information
Philip-Carneiro-KX authored Jul 2, 2024
2 parents 55f6e0a + de9c8fb commit 2a559b4
Show file tree
Hide file tree
Showing 51 changed files with 2,158 additions and 388 deletions.
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,44 @@

All notable changes to the **kdb VS Code extension** are documented in this file.

# v1.6.0

### Enhancements

- Display meta data for Insights connections
- Added option to click at meta data and open in json format the meta data
- Ability to change the name of the Keycloak realm, used for authentication, from the default value of `insights`. This enables the connection to a kdb Insights Enterprise Free trial instance.
- Improve the console log quality to "kdb"output pane
- Insights free trial instances are supported
- Added execute block command for q code
- Added hotkey to cache function parameters for q code
- Extension now reconigze which version of Insights is connected
- Extension changes scratchpad endpoints accordly to the Insights versions
- Allow connection information in user settings to be editable
- Allow same server address to be used in multiple connections
- Language server features works on unsaved files
- Expand Selection command is implemented

### Fixes

- Disconnect when q process is stopped
- Fix query execution on KDB+ connections not refreshing completion items
- Fixed delay when executing query on KDB+ connections
- Make connection names case insensitive
- Fixed GUID type displayed as number for Insights
- Fixed problem when the user close(not hide) the Results Tab
- Fixed time zone for populate scratchpad

### Internal Improvements

- Added logging framework

# v1.5.2

### Fixes

- Local connection listener behaviour fixed (if the connection is closed, the connection will disconnect)
- Return to show console output if results tab isn't visible in case of query execuion
- Return to show console output if results tab isn't visible in case of query execution
- Linter fixes

# v1.5.1
Expand Down
83 changes: 64 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ Set the following properties:

![connecttoinsights](https://github.com/KxSystems/kx-vscode/blob/main/img/insightsconnection.png?raw=true)

Set the following from the Advanced properties if necessary:

| Property | Description |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Define Realm | Specify the Keycloak realm for authentication. Usually the realm is set to `insights`, which is the default value used by the extension. You only need to change this field if a different realm has been configured on your server. |

![connecttoinsights](https://github.com/KxSystems/kx-vscode/blob/main/img/insightsconnectionadvanced.png?raw=true)

!!!note "For kdb Insights Enterprise Free Trial instances"
The realm is configured as `insights-{URL}` where {URL} is the 10 digit code in the trial URL. For example: if your trial url is https://fstc83yi5b.ft1.cld.kx.com/ the realm should be `insights-fstc83yi5b`.

1. Click **Create Connection** and the **kdb Insights Enterprise** connection appears under **CONNECTIONS** in the primary sidebar.

1. Right-click the connection, and click **Connect server**.
Expand Down Expand Up @@ -264,6 +275,8 @@ For any file with a **.q** or **.py** extension there are additional options ava

- **Execute current selection** - Takes the current selection (or current line if nothing is selected) and executes it against the active connection. Results are displayed in the [Output window and/or the KDB Results window](#view-results).

- **Execute current block** - Selects the q expression under the cursor and executes it against the active connection. Results are displayed in the [Output window and/or the KDB Results window](#view-results).

- **Run q file in new q instance** - If q is installed and executable from the terminal you can execute an entire q script on a newly launched q instance. Executing a file on a new instance is done in the terminal, and allows interrogation of the active q process from the terminal window.

### Insights query execution
Expand Down Expand Up @@ -330,6 +343,16 @@ To do this:

1. Use a [Workbook](#workbooks) to execute q or Python code against the data in your scratchpad using the variable you provided.

## Meta

The Get Meta data is exposed for **connected Insights** connections.

![Insights Meta Tree](https://github.com/KxSystems/kx-vscode/blob/main/img/insights-meta-tree.png?raw=true)

To open the meta object, just click on it, and a json with the **"[Connection Name] - [META OBJECT]"** as title

![Insights Meta JSON](https://github.com/KxSystems/kx-vscode/blob/main/img/insights-meta-json.png?raw=true)

## Workbooks

Workbooks provide a convenient way to prototype and execute q and python code against a q process and using the variables [populated into the scratchpad](#populate-scratchpad) of a **kdb Insights Enterprise** deployment by data sources.
Expand Down Expand Up @@ -359,16 +382,14 @@ To create a Workbook and run code against a specific connection:
1. Click **Run** from above the first line of code in the workbook file.
![workbook links](https://github.com/KxSystems/kx-vscode/blob/main/img/workbookrunlink.png?raw=true)

1. Select **Run** from the upper right of the editor. Using the dropdown next to the button you can choose to **KX: Execute Entire File** or **KX Execute Current Selection**.
1. Select **Run** from the upper right of the editor. Using the dropdown next to the button you can choose any of the [**KX:** menu items](#kdb-process-executing-q-and-python-code) to run some, or all of the code in the workbook.
![play dropdown](https://github.com/KxSystems/kx-vscode/blob/main/img/wortkbookplaydropdown.png?raw=true)

1. Click **Run** on the right-hand side of the status bar.
![status bar run ](https://github.com/KxSystems/kx-vscode/blob/main/img/workbookstatusbarrun.png?raw=true)

1. Right-click and choose **KX: Execute Entire File** from the menu.

1. If you wish to only run the current selection (or current line if nothing is selected), right-click and choose **KX: Execute Current Selection** from the menu.

1. If you have not yet chosen a connection to associate with the workbook you are asked to choose a connection before the code is executed.
![choose connection](https://github.com/KxSystems/kx-vscode/blob/main/img/workbookconnectionlink.png?raw=true)

Expand Down Expand Up @@ -429,6 +450,16 @@ q REPL can be started from the command prompt by searching **q REPL**.

![REPL](https://github.com/KxSystems/kx-vscode/blob/main/img/repl.png?raw=true)

## Logs

Any error or info will be posted at **OUTPUT** in **kdb** tab

![LOG](https://github.com/KxSystems/kx-vscode/blob/main/img/log-sample.png?raw=true)

The format will be:

`[DATE TIME] [INFO or ERROR] Message`

## Settings

To update kdb VS Code settings, search for **kdb** from _Preferences_ > _Settings_, or right-click the settings icon in kdb VS Code marketplace panel and choose **Extension Settings**.
Expand Down Expand Up @@ -502,26 +533,40 @@ To update kdb VS Code settings, search for **kdb** from _Preferences_ > _Setting
}
```

### Double Click Selection

The following setting will change double click behaviour to select the whole identifier including dots:

```JSON
"[q]": {
"editor.wordSeparators": "`~!@#$%^&*()-=+[{]}\\|;:'\",<>/?"
}
```

## Shortcuts

### For Windows

| Key | Action |
| ------------------ | ---------------------------- |
| F12 | Go to definition |
| Shift + F12 | Go to references |
| Ctrl + Shift + F12 | Find all references |
| Ctrl + D | Execute current selection |
| Ctrl + Shift + D | Execute entire file |
| Ctrl + Shift + R | Run q file in new q instance |
| Key | Action |
| ------------------ | --------------------------------- |
| F12 | Go to definition |
| Shift + F12 | Go to references |
| Ctrl + Shift + F12 | Find all references |
| Ctrl + D | Execute current selection |
| Ctrl + Shift + E | Execute current block |
| Ctrl + Shift + D | Execute entire file |
| Ctrl + Shift + R | Run q file in new q instance |
| Ctrl + Shift + Y | Toggle paramater cache for lambda |

### For MacOS

| Key | Action |
| --------------- | ---------------------------- |
| F12 | Go to definition |
| Shift + F12 | Go to references |
| ⌘ + Shift + F12 | Find all references |
| ⌘ + D | Execute current selection |
| ⌘ + Shift + D | Execute entire file |
| ⌘ + Shift + R | Run q file in new q instance |
| Key | Action |
| --------------- | --------------------------------- |
| F12 | Go to definition |
| Shift + F12 | Go to references |
| ⌘ + Shift + F12 | Find all references |
| ⌘ + D | Execute current selection |
| ⌘ + Shift + E | Execute current block |
| ⌘ + Shift + D | Execute entire file |
| ⌘ + Shift + R | Run q file in new q instance |
| ⌘ + Shift + Y | Toggle paramater cache for lambda |
Binary file added img/insights-meta-json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/insights-meta-tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/insightsconnection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/insightsconnectionadvanced.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/log-sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/workbookplaydropdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 62 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "kdb",
"description": "IDE support for kdb product suite",
"publisher": "KX",
"version": "1.5.2",
"version": "1.6.0",
"engines": {
"vscode": "^1.86.0"
},
Expand Down Expand Up @@ -183,7 +183,7 @@
{
"category": "KX",
"command": "kdb.refreshServerObjects",
"title": "Refresh server objects",
"title": "Refresh server objects & insights meta",
"icon": "$(refresh)"
},
{
Expand Down Expand Up @@ -263,6 +263,11 @@
"command": "kdb.connect",
"title": "Connect server"
},
{
"category": "KX",
"command": "kdb.insights.refreshMeta",
"title": "Refresh get meta"
},
{
"category": "KX",
"command": "kdb.connect.via.dialog",
Expand All @@ -273,6 +278,11 @@
"command": "kdb.active.connection",
"title": "Active connection"
},
{
"category": "KX",
"command": "kdb.open.meta",
"title": "Open meta object"
},
{
"category": "KX",
"command": "kdb.addAuthentication",
Expand Down Expand Up @@ -374,6 +384,17 @@
"category": "KX",
"command": "kdb.deleteFile",
"title": "Delete"
},
{
"category": "KX",
"command": "kdb.execute.block",
"title": "KX: Execute Current q Block",
"icon": "$(run-above)"
},
{
"category": "KX",
"command": "kdb.toggleParameterCache",
"title": "KX: Toggle parameter cache"
}
],
"keybindings": [
Expand Down Expand Up @@ -405,6 +426,18 @@
"key": "ctrl+shift+r",
"mac": "cmd+shift+r",
"when": "editorLangId == q && !(resourceFilename =~ /.kdb.q/)"
},
{
"command": "kdb.execute.block",
"key": "ctrl+shift+e",
"mac": "cmd+shift+e",
"when": "editorLangId == q && !(resourceFilename =~ /.kdb.q/)"
},
{
"command": "kdb.toggleParameterCache",
"key": "ctrl+shift+y",
"mac": "cmd+shift+y",
"when": "editorLangId == q && !(resourceFilename =~ /.kdb.q/)"
}
],
"snippets": [
Expand Down Expand Up @@ -512,6 +545,10 @@
"command": "kdb.insightsRemove",
"when": "false"
},
{
"command": "kdb.insights.refreshMeta",
"when": "false"
},
{
"command": "kdb.startLocalProcess",
"when": "false"
Expand All @@ -532,6 +569,10 @@
"command": "kdb.connect",
"when": "false"
},
{
"command": "kdb.open.meta",
"when": "false"
},
{
"command": "kdb.connect.via.dialog",
"when": "false"
Expand Down Expand Up @@ -621,12 +662,12 @@
"view/item/context": [
{
"command": "kdb.connect",
"when": "view == kdb-servers && viewItem not in kdb.connected",
"when": "view == kdb-servers && viewItem not in kdb.connected && (viewItem in kdb.rootNodes || viewItem in kdb.insightsNodes)",
"group": "connection@1"
},
{
"command": "kdb.active.connection",
"when": "view == kdb-servers && viewItem in kdb.connected && (viewItem in kdb.rootNodes || viewItem in kdb.insightsNodes)",
"when": "view == kdb-servers && viewItem in kdb.connected && (viewItem in kdb.rootNodes || viewItem in kdb.insightsNodes) && viewItem not in kdb.connected.active",
"group": "connection@1"
},
{
Expand All @@ -639,6 +680,11 @@
"when": "view == kdb-servers && viewItem not in kdb.insightsNodes && viewItem in kdb.kdbNodesWithoutTls && viewItem not in kdb.local",
"group": "connection@4"
},
{
"command": "kdb.insights.refreshMeta",
"when": "view == kdb-servers && viewItem in kdb.connected && viewItem in kdb.insightsNodes",
"group": "connection@3"
},
{
"command": "kdb.insightsRemove",
"when": "view == kdb-servers && viewItem in kdb.insightsNodes",
Expand Down Expand Up @@ -692,8 +738,13 @@
"when": "editorLangId == q"
},
{
"command": "kdb.terminal.run",
"command": "kdb.execute.block",
"group": "q@2",
"when": "editorLangId == q"
},
{
"command": "kdb.terminal.run",
"group": "q@3",
"when": "editorLangId == q && !(resourceFilename =~ /.kdb.q/)"
},
{
Expand All @@ -719,8 +770,13 @@
"when": "editorLangId == q"
},
{
"command": "kdb.terminal.run",
"command": "kdb.execute.block",
"group": "q@2",
"when": "editorLangId == q"
},
{
"command": "kdb.terminal.run",
"group": "q@3",
"when": "editorLangId == q && !(resourceFilename =~ /.kdb.q/)"
},
{
Expand Down
8 changes: 8 additions & 0 deletions resources/metaIcons/aggicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions resources/metaIcons/apiicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2a559b4

Please sign in to comment.