Skip to content

Commit 3e50a51

Browse files
committed
New extension command to get the cache of parsed URIs
Signed-off-by: worksofliam <[email protected]>
1 parent 09e6cbc commit 3e50a51

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

extension/client/src/commands.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import { commands, ExtensionContext, window } from "vscode";
2-
import { clearTableCache } from "./requests";
1+
import { commands, ExtensionContext, Uri, window } from "vscode";
2+
import { clearTableCache, getCache } from "./requests";
33
import { LanguageClient } from "vscode-languageclient/node";
44

55
export function registerCommands(context: ExtensionContext, client: LanguageClient) {
66
context.subscriptions.push(
77
commands.registerCommand(`vscode-rpgle.server.reloadCache`, () => {
88
clearTableCache(client);
9+
}),
10+
11+
commands.registerCommand(`vscode-rpgle.server.getCache`, (uri: Uri) => {
12+
return getCache(client, uri);
913
})
1014
)
1115
}

extension/client/src/requests.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import path = require('path');
2-
import { Uri, workspace, RelativePattern, commands } from 'vscode';
2+
import { Uri, workspace } from 'vscode';
33
import { LanguageClient } from 'vscode-languageclient/node';
44
import { getInstance } from './base';
55
import { IBMiMember } from '@halcyontech/vscode-ibmi-types';
@@ -181,4 +181,8 @@ export function buildRequestHandlers(client: LanguageClient) {
181181

182182
export function clearTableCache(client: LanguageClient) {
183183
client.sendRequest(`clearTableCache`);
184+
}
185+
186+
export function getCache(client: LanguageClient, uri: Uri): Promise<any> {
187+
return client.sendRequest(`getCache`, uri.toString());
184188
}

0 commit comments

Comments
 (0)