Skip to content

Commit

Permalink
another cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyu123 committed Jan 4, 2024
1 parent ee8e224 commit 4539429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ export function createSvelteModuleLoader(
resolveModuleNames,
resolveTypeReferenceDirectiveReferences,
mightHaveInvalidatedResolutions,
clearPendingInvalidations
clearPendingInvalidations,
getModuleResolutionCache: () => tsModuleCache,
};

function resolveModuleNames(
Expand Down
5 changes: 4 additions & 1 deletion packages/language-server/src/plugins/typescript/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ declare module 'typescript' {
* that might change the module resolution results
*/
hasInvalidatedResolutions?: (sourceFile: string) => boolean;

getModuleResolutionCache?(): ts.ModuleResolutionCache;
}

interface ResolvedModuleWithFailedLookupLocations {
Expand Down Expand Up @@ -278,7 +280,8 @@ async function createLanguageService(
getNewLine: () => tsSystem.newLine,
resolveTypeReferenceDirectiveReferences:
svelteModuleLoader.resolveTypeReferenceDirectiveReferences,
hasInvalidatedResolutions: svelteModuleLoader.mightHaveInvalidatedResolutions
hasInvalidatedResolutions: svelteModuleLoader.mightHaveInvalidatedResolutions,
getModuleResolutionCache: svelteModuleLoader.getModuleResolutionCache,
};

const documentRegistry = getOrCreateDocumentRegistry(
Expand Down

0 comments on commit 4539429

Please sign in to comment.