Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .README/hide-detailed-console-query.png
Binary file not shown.
Binary file added .README/hide-source-expressions.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: 4 additions & 0 deletions .github/workflows/prod_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ jobs:
run: npm run publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@v2
with:
pat: ${{ secrets.OPEN_VSX_TOKEN }}
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

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

# v1.15.0

### Enhancements

- Deprecated the `Hide Detailed Console Query Output` setting and added a new `Hide Source Expressions` setting.

### Fixes

- Resolved an issue where QDoc comments were not collapsing as expected
- Resolved an issue where query history was not showing for some files
- Resolved an issue where stopping the bundled q triggered multiple errors
- Resolved an issue with walkthrough error messages not displaying correctly
- Resolved an issue where recently added connections were not showing
- Resolved an issue where authentication details were missing for modified connections
- Updated the subscribe notification text

### Internal Improvements

- Updated dependencies to address security vulnerabilities

# v1.14.0

### Enhancements
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If you want to use q outside of VS Code, set a [`QHOME` environment variable](ht

If q is installed at `C:\q`, then `QHOME` is `C:\q`.

**Note!** The kdb VS Code Extension treats the `QHOME` environment variable and the `kdb.qHomeDirectory` setting as identical when locating the q executable for REPL and bundled q connections. For more details, refer to the [QHomeDirectory](https://github.com/KxSystems/kx-vscode/wiki/qHomeDirectory) wiki page.
**Note!** The kdb VS Code Extension treats the `QHOME` environment variable and the `kdb.qHomeDirectory` setting as identical when locating the q executable for REPL and bundled q connections. For more details, refer to the [QHomeDirectory](https://github.com/KxSystems/kx-vscode/wiki/qHomeDirectory) wiki page.

### Versions available

Expand Down Expand Up @@ -805,9 +805,9 @@ All query executions happen remotely from the **kdb VS Code extension** either a

![Output autoscrolling](https://raw.githubusercontent.com/KxSystems/kx-vscode/main/.README/auto-scrolling.png)

**Note** You can hide or show the full details in the console output. Go to settings of the VS Code, search for kdb, check the option **Hide Detailed Console Query Output** (this option is checked by default)
**Note** You can hide or show the full details in the console output. Go to settings of the VS Code, search for kdb, check the option **Hide Source Expressions** (this option is checked by default)

![Hide Detailed Console Query Output](https://raw.githubusercontent.com/KxSystems/kx-vscode/main/.README/hide-detailed-console-query.png)
![Hide Source Expressions](https://raw.githubusercontent.com/KxSystems/kx-vscode/main/.README/hide-source-expressions.png)

- **KDB Results** - This window displays the kdb returned data in a table.

Expand Down Expand Up @@ -904,7 +904,7 @@ To update kdb VS Code settings, search for **kdb** from _Preferences_ > _Setting
| **Hide notification for installation path, after first install** | yes/no; default no |
| **Hide subscribe for registration notification** | yes/no; default no |
| **Hide the extension survey dialog box** | yes/no; default no |
| **Hide detailed console query output** | yes/no; default yes |
| **Hide source expressions** | yes/no; default yes |
| **kdb Insights Enterprise connections for explorer** | [edit JSON settings](#kdb-insights-enterprise-connections-for-explorer) |
| **Linting** | Enable linting for q and quke files |
| **Refactoring** | Choose refactoring scope |
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

15 changes: 11 additions & 4 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 including the q programming language",
"publisher": "KX",
"version": "1.14.0",
"version": "1.15.0",
"engines": {
"vscode": "^1.96.0"
},
Expand Down Expand Up @@ -70,7 +70,7 @@
"title": "q runtime installed",
"description": " \n",
"media": {
"markdown": "out/qinstall.md"
"markdown": "resources/walkthrough/qinstall.md"
},
"completionEvents": [
"onLink:https://code.kx.com/q/learn/install/"
Expand Down Expand Up @@ -166,6 +166,13 @@
"type": "boolean",
"description": "Hide detailed console query output",
"default": true,
"scope": "machine",
"deprecationMessage": "This setting is deprecated, use kdb.hideSourceExpressions instead"
},
"kdb.hideSourceExpressions": {
"type": "boolean",
"description": "When disabled, the console shows all evaluated expressions, intermediate steps, and results from your query. Enable this to streamline logs and reduce visual clutter when running simple or production-ready queries.",
"default": true,
"scope": "machine"
},
"kdb.autoFocusOutputOnEntry": {
Expand Down Expand Up @@ -1212,7 +1219,7 @@
"@vscode/extension-telemetry": "^1.0.0",
"@windozer/node-q": "^2.6.0",
"ag-grid-community": "^33.3.2",
"axios": "^1.11.0",
"axios": ">=1.12.0",
"chevrotain": "^10.5.0",
"extract-zip": "^2.0.1",
"fs-extra": "^11.3.0",
Expand All @@ -1227,4 +1234,4 @@
"vscode-languageserver-textdocument": "^1.0.12",
"vscode-uri": "^3.1.0"
}
}
}
1 change: 1 addition & 0 deletions resources/walkthrough/qinstall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Install q
2 changes: 2 additions & 0 deletions server/src/qLangServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import {
WhiteSpace,
CommentEndOfLine,
CommentLiteral,
Documentation,
} from "./parser";
import {
Name,
Expand Down Expand Up @@ -460,6 +461,7 @@ export default class QLangServer {
break;
case ExitCommentBegin:
case LineComment:
case Documentation:
if (!range) start();
break;
case CommentBegin:
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ sonar.test.inclusions=test/**/*.ts
sonar.test.exclusions=**/*.js,**/node_modules/**
sonar.javascript.lcov.reportPaths=lcov.info
sonar.typescript.lcov.reportPaths=lcov.info
sonar.coverage.exclusions=server/src/utils/parserUtils.ts,src/ipc/**,src/models/**,src/extension.ts,src/classes/**,src/commands/installTools.ts,src/utils/cpUtils.ts,test/**,**/*.test.ts,**/*.spec.ts
sonar.coverage.exclusions=server/src/utils/parserUtils.ts,src/ipc/**,src/models/**,src/extension.ts,src/classes/**,src/commands/installTools.ts,src/utils/cpUtils.ts,test/**,**/*.test.ts,**/*.spec.ts,src/commands/serverCommand.ts
sonar.cpd.exclusions=src/services/completionProvider.ts,src/extension.ts
sonar.sourceEncoding=UTF-8
22 changes: 10 additions & 12 deletions src/commands/installTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ export async function installTools(): Promise<void> {
logger,
});
}
await writeFile(
join(__dirname, "qinstall.md"),
`# q runtime installed location: \n### ${QHOME}`,
);
notify(`Installation of q found here: ${QHOME}`, MessageKind.DEBUG, {
logger,
});
Expand Down Expand Up @@ -314,14 +310,16 @@ export async function startLocalProcess(viewItem: KdbNode): Promise<void> {
}

export async function stopLocalProcess(viewItem: KdbNode): Promise<void> {
ext.localProcessObjects[viewItem.children[0]].kill();
notify(
`Child process id ${ext.localProcessObjects[viewItem.children[0]]
.pid!} removed in cache.`,
MessageKind.DEBUG,
{ logger },
);
await removeLocalConnectionStatus(`${getServerName(viewItem.details)}`);
const proc = ext.localProcessObjects[viewItem.children[0]];
proc.once("exit", () => {
notify(
`Child process id ${proc.pid!} removed in cache.`,
MessageKind.DEBUG,
{ logger },
);
removeLocalConnectionStatus(`${getServerName(viewItem.details)}`);
});
proc.kill();
}

export async function stopLocalProcessByServerName(
Expand Down
79 changes: 63 additions & 16 deletions src/commands/serverCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,49 @@ function removeAuthConnection(serverKey: string) {
}
}

// Not possible to test secrets
/* c8 ignore next */
export function updateAuthDataKey(oldServerKey: string, newServerKey: string) {
const storeAuthData = ext.secretSettings.storeAuthData as {
[key: string]: any;
};

if (Object.prototype.hasOwnProperty.call(storeAuthData, newServerKey)) {
notify(
`Auth data already exists for key: ${newServerKey}`,
MessageKind.ERROR,
{ logger },
);
return;
}

storeAuthData[newServerKey] = storeAuthData[oldServerKey];
delete storeAuthData[oldServerKey];

return;
}

// Not possible to test secrets
/* c8 ignore next */
export function handleEditAuthData(
oldServerKey: string,
newServerKey: string,
editAuth: boolean,
isAuth?: boolean,
username?: string,
password?: string,
) {
if (editAuth) {
removeAuthConnection(oldServerKey);
if (isAuth && username !== "" && password !== "") {
addAuthConnection(newServerKey, username!, password!);
return;
}
} else if (oldServerKey !== newServerKey) {
updateAuthDataKey(oldServerKey, newServerKey);
}
}

export async function enableTLS(serverKey: string): Promise<void> {
const servers: Server | undefined = getServers();

Expand Down Expand Up @@ -530,7 +573,12 @@ export async function editKdbConnection(
});

updatedServers[newKey] = {
auth: removedAuth ? false : kdbData.auth,
auth:
editAuth === false
? oldServer.auth
: removedAuth
? false
: kdbData.auth,
serverName: kdbData.serverName,
serverPort: kdbData.serverPort,
serverAlias: kdbData.serverAlias,
Expand All @@ -541,7 +589,12 @@ export async function editKdbConnection(
await updateServers(updatedServers);
} else {
servers[oldKey] = {
auth: removedAuth ? false : kdbData.auth,
auth:
editAuth === false
? oldServer.auth
: removedAuth
? false
: kdbData.auth,
serverName: kdbData.serverName,
serverPort: kdbData.serverPort,
serverAlias: kdbData.serverAlias,
Expand Down Expand Up @@ -576,20 +629,14 @@ export async function editKdbConnection(
MessageKind.INFO,
{ logger },
);
if (oldKey !== newKey) {
removeConnFromLabels(oldKey);
removeAuthConnection(oldKey);
if (kdbData.auth) {
addAuthConnection(newKey, kdbData.username!, kdbData.password!);
}
} else {
if (editAuth && !removedAuth) {
addAuthConnection(newKey, kdbData.username!, kdbData.password!);
}
if (editAuth && removedAuth) {
removeAuthConnection(newKey);
}
}
handleEditAuthData(
oldKey,
newKey,
editAuth ?? false,
kdbData.auth,
kdbData.username,
kdbData.password,
);

NewConnectionPannel.close();
}
Expand Down
4 changes: 0 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -870,10 +870,6 @@ function registerConnectionsCommands(): CommandRegistration[] {
{
command: "kdb.connections.localProcess.stop",
callback: async (viewItem: KdbNode) => {
await vscode.commands.executeCommand(
"kdb.connections.disconnect",
viewItem,
);
await stopLocalProcess(viewItem);
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/utils/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export function getAutoFocusOutputOnEntrySetting(): boolean {
export function getHideDetailedConsoleQueryOutputSetting(): boolean {
return workspace
.getConfiguration("kdb")
.get<boolean>("hideDetailedConsoleQueryOutput", true);
.get<boolean>("hideSourceExpressions", true);
}

export function setOutputWordWrapper(): void {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function showRegistrationNotification(): void {
.get<boolean>("kdb.hideSubscribeRegistrationNotification", false);
if (setting === false) {
notify(
"Subscribe to updates",
"Subscribe to the kdb VS Code extension newsletter?",
MessageKind.INFO,
{},
"Opt-In",
Expand Down
Loading