Skip to content

[vscode_projects:1.11] Updates recents search to use latest vscode configuration, performance improvements #225

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Sharsie
Copy link
Contributor

@Sharsie Sharsie commented Jul 7, 2025

This PR replaces searching through legacy json vscode configuration files by querying sqlite database. Recents are only stored and updated in the db in the latest versions.

It also improves documentation and introduces some performance optimizations and error handling.

Removes support for multiple paths per configuration and only uses a single path to read configuration from. Previously, this was implemented to support older versions of vscode, but sqlite has completely replaced this a while ago so I've cleaned up the code that deals with the multi-config feature.

It also enables searching through recents when only query trigger is supplied with empty query. Previously typing a query trigger yielded no results. I believe this improves UX by offering the latest entries immediately.

Comes bundled with #224 - I honestly did not know how to version these properly without having to update one PR after the other gets merged. So ideally #224 should be merged first.

Sharsie added 2 commits July 3, 2025 23:13
… refactoring

Improve documentation

Use a single path to state and configuration files and optimize lookup

Search recents even with empty query

Performance optimizations
@Sharsie
Copy link
Contributor Author

Sharsie commented Jul 7, 2025

@Silureth I would appreciate if you could take a peek since it seems noone else would review the plugin.

Python is not my strong suit, but I've been using this code locally for months now. Though I made some improvements so it's presentable.

@Silureth
Copy link

Silureth commented Jul 7, 2025

@Sharsie checked it out. It did return some recents but i couldn't figure out, how it did it.Here is a screenshot from VS code and the recents list when i type in the trigger:
image
It looks like it leaves out the workspaces?

@Sharsie
Copy link
Contributor Author

Sharsie commented Jul 7, 2025

Thanks for the feedback, yes that is likely, I do not use workspaces at all, so it may have different data structure. I intentionally skip single files, but that was more of a personal preference and I think workspace comes a single file .code-workspace as it seems.

There was another option I exposed as a configuration value - custom command that can be used inside the project's workdir, which pretty much changes dir to the workdir of the project and then runs whatever command you set (e.g. code .) - I'm using it in combination with direnv to load the environment before opening vscode (e.g. direnv exec . code .)

I think it goes against the concept of workspaces, where there is no such thing as a single working directory, since it can contain multiple different system paths.

Definitely makes sense to support it, but I have to think about handling both of these use-cases - likely disabling custom commands for single-file recents, but that introduces a conditional behavior I don't like very much. I'll ponder what to do with that.

@Silureth
Copy link

Silureth commented Jul 7, 2025

Ah, now I get it. I almost exclusively use workspaces :D Since I can make a complex group of folder structures its own entity, it's two similar problems that each have their use cases and are mutually exclusive.

Now I also, understand the use case of custom commands. It seems the only way to support it is to basically make two different, separate behaviors of the plugin.

That said, I'm fine without recents, so I think an extra line in the options that "workspaces are not supported" is fine at this point.

Copy link

@Silureth Silureth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recents works as intended for folder based projects.

@Sharsie Sharsie force-pushed the hotfix/vscode_projects_recents branch from 1817a99 to 27e3547 Compare July 7, 2025 20:59
@Sharsie
Copy link
Contributor Author

Sharsie commented Jul 7, 2025

I had a go at implementing this, but pushed it too soon seeing the comments popping up... still have to do some testing, but I feel like with a little bit of documentation about the custom command, it's fine. Better than documenting that workspaces and single files do not work

@Sharsie
Copy link
Contributor Author

Sharsie commented Jul 7, 2025

dc96d2c expands support for workspaces and single file recent entries

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

Successfully merging this pull request may close these issues.

2 participants