Skip to content

Commit

Permalink
feat: Support sharing cache between windows and linux
Browse files Browse the repository at this point in the history
fixes: #5246

- Defaults to the universal format instead of legacy.
- Path separators are converted to `/` before being stored.
  • Loading branch information
Jason3S committed Feb 17, 2024
1 parent 45df1ce commit aa7cb38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cspell/src/app/util/cache/createCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function calcCacheSettings(
);

const cacheStrategy = cacheOptions.cacheStrategy ?? cs.cacheStrategy ?? 'metadata';
const cacheFormat = cacheOptions.cacheFormat ?? cs.cacheFormat ?? 'legacy';
const cacheFormat = cacheOptions.cacheFormat ?? cs.cacheFormat ?? 'universal';
const optionals: Partial<CreateCacheSettings> = {};
if (cacheOptions.cacheReset) {
optionals.reset = true;
Expand Down
6 changes: 2 additions & 4 deletions packages/cspell/src/app/util/cache/fileEntryCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ export function createFromFile(pathToCache: string, useCheckSum: boolean, useRel
}

export function normalizePath(filePath: string): string {
return filePath;

// if (path.sep !== '\\') return filePath;
// return filePath.replace(/\\/g, '/');
if (path.sep === '/') return filePath;
return filePath.split(path.sep).join('/');
}

0 comments on commit aa7cb38

Please sign in to comment.