Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering history #32

Open
dstd opened this issue Apr 17, 2024 · 1 comment
Open

Filtering history #32

dstd opened this issue Apr 17, 2024 · 1 comment

Comments

@dstd
Copy link

dstd commented Apr 17, 2024

Please add a history of filter queries. It's a really useful feature.

@earshinov
Copy link
Owner

Hello @dstd ,

Thank for taking time to submit this feature request.

Having search history definitely makes sense. VS Code itself has both for the simple "Find" and "Search: Find in files". The extension already has a limited support for it: you can set "filterlines.preserveSearch": true in your user settings and the extension will store the last value searched for.

I cannot support multiple values in search history for the moment as VS Code extension API doesn't have UI elements that would be required, see for example microsoft/vscode#35785.

1. The InputBox widget does not provide completions, a dropdown, or even a possibility to track user's keyboard input, such as Alt-↑↓ keys, which the extension could employ to support navigation through search history.

2. The QuickPick widget does provide a dropdown, and with a quick hack it is even possible to allow for arbitrary values in addition to the items in the dropdown (the search history), e.g.

const box = vscode.window.createQuickPick();
box.title = prompt;
box.onDidChangeValue((value) => {
  box.items = [{ label: value }];
});
return new Promise(resolve => {
  box.show();
  box.onDidAccept(() => resolve(box.value));
  box.onDidHide(() => resolve(undefined));
});

However, it looks ugly:

image

3. Technically, it is possible to devise our own UI (as in the Color Picker extension, for example), but it will involve kicking off a separate Electron process with a separate app / UI it, which is far too much for the task at hand.

Overall, I don't see any feasible options :-( I am going to leave this issue open for tracking and in case someone comes up one day with an acceptable solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants