Closed IrishBruse closed 3 weeks ago
Please remove all unrelated changes from this PR.
There are still changes that seem unrelated to a Visual Studio Code extension, for example in common/Core/Search
and renderer/Core/Search
.
There was no way to fuzzy find the items so i needed to make that common
Then please separate this into 2 PRs: one PR for the refactoring of the filtering and on PR for your extension.
One issue i need some input on when a file path gets very long it overflows how best do we want to handle this should i shorten it somehow and replace with ...
Please don't put file paths into the description of the search result items. As you can see all other search resullt items just show short description of what this is, for example "Browser Bookmark" or "Application" or "Workflow".
Is this ready to be merged? For me it looks good, I didn't test it tough.
I forgot to mention: can you please add a readme file for your extension in docs/Extensions/<Extension_ID>/README.md
similar to the others? Just quickly explain what it does and how it works.
And I just tested the extension and it seems to fail when one of the recent items is a .code-workspace
file.
Code workspace works fine for me its the same with .gitconfig so not an issue with files starting with . whats the error showing up as? Im on linux mint so it might be a windows related bug havent tested on windows or mac yet. But it should support them just fine the only os specific thing is the file location and they were just documented in the vscode docs.
Yeah its ready to merge once we figure out that bug on your end
I added a try/catch
around URL.fileURLToPath(uri)
to find out which recent item is causing the issue:
try {
path = URL.fileURLToPath(uri);
} catch (error) {
console.log({ uri, recent, error });
}
This is the error that I got:
{
uri: undefined,
recent: {
workspace: {
id: '118472e49418a2388512d52628dc6abb',
configPath: 'file:///Users/oliverschwendener/themes.code-workspace'
}
},
error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of URL. Received undefined
at Module.fileURLToPath (node:internal/url:1461:11)
at VSCodeExtension.getSearchItem (/Users/oliverschwendener/projects/ueli/dist-main/index.js:6074:29)
at async Promise.all (index 31)
at async VSCodeExtension.getSearchResultItems (/Users/oliverschwendener/projects/ueli/dist-main/index.js:6046:25)
at async Promise.allSettled (index 13)
at async ExtensionManager.populateSearchIndex (/Users/oliverschwendener/projects/ueli/dist-main/index.js:753:28)
at async /Users/oliverschwendener/projects/ueli/dist-main/index.js:876:19 {
code: 'ERR_INVALID_ARG_TYPE'
}
}
Havent used workspaces so didnt catch that my bad, no clue why they are stored differently too should work now tested it locally too.
It works now, thanks!
Thanks for your efforts! I sent you an invite to be direct collaborator on this repository. This enables you to directly be notified when someone wants to change something in your extension.
This is a WIP extension that adds the ability to open recent folders and files opened in vscode.
Feedback is welcome thanks.