vscode kdb+/q extension
This plugin is put into maintenance mode, which means I will not do any active development for it. All new features will be implemented for vscode-k-pro.
This extension provides q language support:
See the change log.
Preferences: Open Workspace Settings
and change the following values.configuration | type | default value | description |
---|---|---|---|
q-server.sourceFiles.globsPattern | array | ["**/src/**/*.q"] |
source folder to be included |
q-server.sourceFiles.ignorePattern | array | ["**/build","**/node_modules"] |
folder to be excluded |
q-client.queryMode | string | Console |
query mode, Console, Grid or Visualization |
q-client.queryGrid.decimals | number | 3 |
decimals in q grid |
q-client.term.qBinary | string | q |
q executable file or full path |
q-client.term.envPath | string | '' |
environment file relative or absolute path |
q-client.expl.prevQueryLimit | string | 5 |
q explorer preview query limit |
q-client.expl.autoRefresh | boolean | false |
q explorer auto refresh |
q-client.expl.excludedNamespaces | array | ["q","Q","j","o","h"] |
namespaced to be excluded from q explorer |
q-client.output.autoClear | boolean | false |
Auto Clear Output |
q-client.output.includeQuery | boolean | false |
Include Query in Output |
q-client.output.consoleSize | string | '36 180' |
Console Size for Output |
The server will analyze q source files in all 'src' folder. Insert ';' to indicated end of statement if necessary.
Files with postfix *.qnb are using notebook feature. There are 2 output mode for q notebook, switch to following query mode for different output format
List servers, click to switch server. Generate tree structure from tags.
Special tag color:
The url should be a REST API endpoint, which returns a list of {host:string, port:number, label:string}
. The returned list will be added to Server List, but it won't be saved.
List variables defined on the active server.
Type ctrl+shift+p and call kdb+/q ext: Switch Query Mode
to switch Query Console.
The query view, powered by perspective, can pivot and virtualize table data. In Query View mode, only table will be showed in a webview, but other result will still be in output. It will limit to 1000 rows when query a table, click the flame in q Ext panel , or call kdb+/q ext: Toggle Unlimited Query
, to remove 1000 rows limit. Be noted that, Query View only support millisecond precision. Use Query Grid, if you need nanosecond precision.
The query grid, powered by ag-grid-community and chart.js, can filter and sort table data. In Query Grid mode, only table will be showed in a webview, but other result will still be in output. It will limit to 1000 rows when query a table, click the flame in q Ext panel , or call kdb+/q ext: Toggle Unlimited Query
, to remove 1000 rows limit.
Output just like q console to an output channel. The console size is set to the same as q http size. Use system "C rows columns"
to change console size.
Record query histories.
Type ctrl+shift+p and call kdb+/q ext: Connect to q Server
to connect to a q server.
Append space to },],)
by formatting the file. Turn on Editor: Format On Save
to automatically append space.
To change shortcuts
To use this extension in an earlier version of vscode.
...
"engines": {
"vscode": "^1.**.*"
},
...
"devDependencies": {
...
"@types/vscode": "^1.**.*",
...
},
npm i
sudo npm i -g vsce
vsce package
Output>Smart Scroll
.Type ctrl+shift+p, call Open Setting(Json)
, and add following configuration.
"[Log]": {
"editor.wordWrap": "off"
}
There may be a conflict with other extensions. Disable or uninstall them and try again.
Type ctrl+shift+p, call Open Setting(Json)
, and add following configuration.
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope":"comment.line.attention",
"settings": {
"fontStyle": "italic",
"foreground": "#B71C1C"
}
},
{
"scope":"comment.line.todo",
"settings": {
"fontStyle": "italic",
"foreground": "#2E7D32"
}
}
]
}
Querying comment line /<=> quant,prod,local-1800
will connect to quant,prod,local-1800
.
Type ctrl+shift+p, call kdb+/q ext Insert Active Connection Label
to insert active connection label.
refer to vscode-q-auth
Special thanks to the following packages.
If you'd like to contribute to this extension, please read the contributing guidelines.