mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-07-05 09:21:39 +02:00
Merge branch 'dev' of github.com:estruyf/vscode-front-matter into dev
This commit is contained in:
@@ -5,6 +5,7 @@ src/**
|
||||
.gitignore
|
||||
vsc-extension-quickstart.md
|
||||
**/tsconfig.json
|
||||
**/tsconfig.e2e.json
|
||||
**/*.map
|
||||
**/*.ts
|
||||
webpack.config.js
|
||||
@@ -28,3 +29,4 @@ webpack
|
||||
README.beta.md
|
||||
e2e
|
||||
storage
|
||||
pnpm-lock.yaml
|
||||
@@ -11,6 +11,7 @@
|
||||
### ⚡️ Optimizations
|
||||
|
||||
- [#639](https://github.com/estruyf/vscode-front-matter/issues/639): Add check for content type in page folders setting
|
||||
- [#642](https://github.com/estruyf/vscode-front-matter/issues/642): Store the search index in a storage file
|
||||
|
||||
### 🐞 Fixes
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 218 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 212 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 211 KiB |
@@ -331,8 +331,12 @@ export class Extension {
|
||||
let storageUri: Uri | undefined = undefined;
|
||||
if (type === 'global') {
|
||||
storageUri = await this.createGlobalStorageIfNotExists();
|
||||
// Clear workspace state
|
||||
await this.ctx.globalState.update(propKey, undefined);
|
||||
} else {
|
||||
storageUri = await this.createLocalStorageIfNotExists();
|
||||
// Clear workspace state
|
||||
await this.ctx.workspaceState.update(propKey, undefined);
|
||||
}
|
||||
|
||||
if (storageUri) {
|
||||
@@ -429,7 +433,10 @@ export class Extension {
|
||||
* @returns
|
||||
*/
|
||||
private isFileStorageNeeded(propKey: string) {
|
||||
return propKey === ExtensionState.Dashboard.Pages.Cache;
|
||||
return (
|
||||
propKey === ExtensionState.Dashboard.Pages.Cache ||
|
||||
propKey === ExtensionState.Dashboard.Pages.Index
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -243,7 +243,7 @@ export class PagesListener extends BaseListener {
|
||||
const pagesIndex = Fuse.createIndex(['title', 'slug', 'description', 'fmBody', 'type'], pages);
|
||||
await Extension.getInstance().setState(
|
||||
ExtensionState.Dashboard.Pages.Index,
|
||||
pagesIndex,
|
||||
pagesIndex.toJSON(),
|
||||
'workspace'
|
||||
);
|
||||
}
|
||||
@@ -279,7 +279,8 @@ export class PagesListener extends BaseListener {
|
||||
ExtensionState.Dashboard.Pages.Index,
|
||||
'workspace'
|
||||
);
|
||||
const fuse = new Fuse(this.lastPages, fuseOptions, pagesIndex);
|
||||
const fuseIndex = Fuse.parseIndex(pagesIndex);
|
||||
const fuse = new Fuse(this.lastPages, fuseOptions, fuseIndex);
|
||||
const results = fuse.search(data.query || '');
|
||||
const pageResults = results.map((page) => page.item);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user