Skip to content

Commit 03e2e05

Browse files
authored
Merge pull request #677 from KxSystems/ee-fixes
Multiple fixes
2 parents e26ba18 + b604502 commit 03e2e05

File tree

12 files changed

+109
-40
lines changed

12 files changed

+109
-40
lines changed
-16.4 KB
Binary file not shown.
37.6 KB
Loading

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

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

5+
# v1.15.0
6+
7+
### Enhancments
8+
9+
- Deprecated the `Hide Detailed Console Query Output` setting and added a new `Hide Source Expressions` setting.
10+
11+
### Fixes
12+
13+
- Resolved an issue where QDoc comments were not collapsing as expected
14+
- Resolved an issue where query history was not showing for some files
15+
- Resolved an issue where stopping the bundled q triggered multiple errors
16+
- Resolved an issue with walkthrough error messages not displaying correctly
17+
- Resolved an issue where recently added connections were not showing
18+
- Resolved an issue where authentication details were missing for modified connections
19+
- Updated the subscribe notification text
20+
21+
### Internal Improvements
22+
23+
- Updated dependencies to address security vulnerabilities
24+
525
# v1.14.0
626

727
### Enhancements

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ If you want to use q outside of VS Code, set a [`QHOME` environment variable](ht
9696

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

99-
**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.
99+
**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.
100100

101101
### Versions available
102102

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

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

808-
**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)
808+
**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)
809809

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

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

@@ -904,7 +904,7 @@ To update kdb VS Code settings, search for **kdb** from _Preferences_ > _Setting
904904
| **Hide notification for installation path, after first install** | yes/no; default no |
905905
| **Hide subscribe for registration notification** | yes/no; default no |
906906
| **Hide the extension survey dialog box** | yes/no; default no |
907-
| **Hide detailed console query output** | yes/no; default yes |
907+
| **Hide source expressions** | yes/no; default yes |
908908
| **kdb Insights Enterprise connections for explorer** | [edit JSON settings](#kdb-insights-enterprise-connections-for-explorer) |
909909
| **Linting** | Enable linting for q and quke files |
910910
| **Refactoring** | Choose refactoring scope |

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"title": "q runtime installed",
7171
"description": " \n",
7272
"media": {
73-
"markdown": "out/qinstall.md"
73+
"markdown": "resources/walkthrough/qinstall.md"
7474
},
7575
"completionEvents": [
7676
"onLink:https://code.kx.com/q/learn/install/"
@@ -166,6 +166,13 @@
166166
"type": "boolean",
167167
"description": "Hide detailed console query output",
168168
"default": true,
169+
"scope": "machine",
170+
"deprecationMessage": "This setting is deprecated, use kdb.hideSourceExpressions instead"
171+
},
172+
"kdb.hideSourceExpressions": {
173+
"type": "boolean",
174+
"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.",
175+
"default": true,
169176
"scope": "machine"
170177
},
171178
"kdb.autoFocusOutputOnEntry": {

resources/walkthrough/qinstall.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Install q

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ sonar.test.inclusions=test/**/*.ts
77
sonar.test.exclusions=**/*.js,**/node_modules/**
88
sonar.javascript.lcov.reportPaths=lcov.info
99
sonar.typescript.lcov.reportPaths=lcov.info
10-
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
10+
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
1111
sonar.cpd.exclusions=src/services/completionProvider.ts,src/extension.ts
1212
sonar.sourceEncoding=UTF-8

src/commands/installTools.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,6 @@ export async function installTools(): Promise<void> {
202202
logger,
203203
});
204204
}
205-
await writeFile(
206-
join(__dirname, "qinstall.md"),
207-
`# q runtime installed location: \n### ${QHOME}`,
208-
);
209205
notify(`Installation of q found here: ${QHOME}`, MessageKind.DEBUG, {
210206
logger,
211207
});
@@ -314,14 +310,16 @@ export async function startLocalProcess(viewItem: KdbNode): Promise<void> {
314310
}
315311

316312
export async function stopLocalProcess(viewItem: KdbNode): Promise<void> {
317-
ext.localProcessObjects[viewItem.children[0]].kill();
318-
notify(
319-
`Child process id ${ext.localProcessObjects[viewItem.children[0]]
320-
.pid!} removed in cache.`,
321-
MessageKind.DEBUG,
322-
{ logger },
323-
);
324-
await removeLocalConnectionStatus(`${getServerName(viewItem.details)}`);
313+
const proc = ext.localProcessObjects[viewItem.children[0]];
314+
proc.once("exit", () => {
315+
notify(
316+
`Child process id ${proc.pid!} removed in cache.`,
317+
MessageKind.DEBUG,
318+
{ logger },
319+
);
320+
removeLocalConnectionStatus(`${getServerName(viewItem.details)}`);
321+
});
322+
proc.kill();
325323
}
326324

327325
export async function stopLocalProcessByServerName(

src/commands/serverCommand.ts

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,49 @@ function removeAuthConnection(serverKey: string) {
341341
}
342342
}
343343

344+
// Not possible to test secrets
345+
/* c8 ignore next */
346+
export function updateAuthDataKey(oldServerKey: string, newServerKey: string) {
347+
const storeAuthData = ext.secretSettings.storeAuthData as {
348+
[key: string]: any;
349+
};
350+
351+
if (Object.prototype.hasOwnProperty.call(storeAuthData, newServerKey)) {
352+
notify(
353+
`Auth data already exists for key: ${newServerKey}`,
354+
MessageKind.ERROR,
355+
{ logger },
356+
);
357+
return;
358+
}
359+
360+
storeAuthData[newServerKey] = storeAuthData[oldServerKey];
361+
delete storeAuthData[oldServerKey];
362+
363+
return;
364+
}
365+
366+
// Not possible to test secrets
367+
/* c8 ignore next */
368+
export function handleEditAuthData(
369+
oldServerKey: string,
370+
newServerKey: string,
371+
editAuth: boolean,
372+
isAuth?: boolean,
373+
username?: string,
374+
password?: string,
375+
) {
376+
if (editAuth) {
377+
removeAuthConnection(oldServerKey);
378+
if (isAuth && username !== "" && password !== "") {
379+
addAuthConnection(newServerKey, username!, password!);
380+
return;
381+
}
382+
} else if (oldServerKey !== newServerKey) {
383+
updateAuthDataKey(oldServerKey, newServerKey);
384+
}
385+
}
386+
344387
export async function enableTLS(serverKey: string): Promise<void> {
345388
const servers: Server | undefined = getServers();
346389

@@ -530,7 +573,12 @@ export async function editKdbConnection(
530573
});
531574

532575
updatedServers[newKey] = {
533-
auth: removedAuth ? false : kdbData.auth,
576+
auth:
577+
editAuth === false
578+
? oldServer.auth
579+
: removedAuth
580+
? false
581+
: kdbData.auth,
534582
serverName: kdbData.serverName,
535583
serverPort: kdbData.serverPort,
536584
serverAlias: kdbData.serverAlias,
@@ -541,7 +589,12 @@ export async function editKdbConnection(
541589
await updateServers(updatedServers);
542590
} else {
543591
servers[oldKey] = {
544-
auth: removedAuth ? false : kdbData.auth,
592+
auth:
593+
editAuth === false
594+
? oldServer.auth
595+
: removedAuth
596+
? false
597+
: kdbData.auth,
545598
serverName: kdbData.serverName,
546599
serverPort: kdbData.serverPort,
547600
serverAlias: kdbData.serverAlias,
@@ -576,20 +629,14 @@ export async function editKdbConnection(
576629
MessageKind.INFO,
577630
{ logger },
578631
);
579-
if (oldKey !== newKey) {
580-
removeConnFromLabels(oldKey);
581-
removeAuthConnection(oldKey);
582-
if (kdbData.auth) {
583-
addAuthConnection(newKey, kdbData.username!, kdbData.password!);
584-
}
585-
} else {
586-
if (editAuth && !removedAuth) {
587-
addAuthConnection(newKey, kdbData.username!, kdbData.password!);
588-
}
589-
if (editAuth && removedAuth) {
590-
removeAuthConnection(newKey);
591-
}
592-
}
632+
handleEditAuthData(
633+
oldKey,
634+
newKey,
635+
editAuth ?? false,
636+
kdbData.auth,
637+
kdbData.username,
638+
kdbData.password,
639+
);
593640

594641
NewConnectionPannel.close();
595642
}

src/extension.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,10 +870,6 @@ function registerConnectionsCommands(): CommandRegistration[] {
870870
{
871871
command: "kdb.connections.localProcess.stop",
872872
callback: async (viewItem: KdbNode) => {
873-
await vscode.commands.executeCommand(
874-
"kdb.connections.disconnect",
875-
viewItem,
876-
);
877873
await stopLocalProcess(viewItem);
878874
},
879875
},

0 commit comments

Comments
 (0)