Update Query History README (#20716)

* Add max entries to query history

* Update query history README
This commit is contained in:
Charles Gagnon
2022-10-03 16:19:02 -07:00
committed by GitHub
parent dd0e8fed2e
commit 266326252a
5 changed files with 22 additions and 6 deletions

View File

@@ -21,14 +21,15 @@ const DOUBLE_CLICK_TIMEOUT_MS = 500;
export async function activate(context: vscode.ExtensionContext): Promise<void> {
// Create the global storage folder now for storing the query history persistance file
const storageUri = context.globalStorageUri;
try {
await fs.mkdir(context.globalStorageUri.fsPath);
await fs.mkdir(storageUri.fsPath);
} catch (err) {
if (err.code !== 'EEXIST') {
console.error(`Error creating query history global storage folder ${context.globalStorageUri.fsPath}. ${err}`);
}
}
const treeDataProvider = new QueryHistoryProvider(context);
const treeDataProvider = new QueryHistoryProvider(context, storageUri);
context.subscriptions.push(treeDataProvider);
const treeView = vscode.window.createTreeView('queryHistory', {
treeDataProvider,
@@ -83,6 +84,9 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
context.subscriptions.push(vscode.commands.registerCommand('queryHistory.enableCapture', async () => {
return treeDataProvider.setCaptureEnabled(true);
}));
context.subscriptions.push(vscode.commands.registerCommand('queryHistory.openStorageFolder', async () => {
return vscode.env.openExternal(storageUri);
}));
}
async function openQuery(item: QueryHistoryItem): Promise<void> {