Fix behavior of new ScopeResolver config caching in specs

This commit is contained in:
Andrew Dupont 2023-12-15 21:20:04 -08:00
parent 32ff14f732
commit 09db9e060b
2 changed files with 12 additions and 0 deletions

View File

@ -104,6 +104,10 @@ describe('ScopeResolver', () => {
atom.config.set('core.useExperimentalModernTreeSitter', true);
});
afterEach(() => {
ScopeResolver.clearConfigCache();
});
it('resolves all scopes in absence of any tests or adjustments', async () => {
await grammar.setQueryForTest('highlightsQuery', `
(comment) @comment

View File

@ -124,6 +124,10 @@ ConfigCache.forConfig = (config) => {
return configCache;
};
ConfigCache.clear = () => {
ConfigCache.CACHES_FOR_CONFIG_OBJECTS.clear();
};
// A data structure for storing scope information while processing capture
// data. The data is reset in between each task.
@ -954,5 +958,9 @@ ScopeResolver.ADJUSTMENTS = {
}
};
ScopeResolver.clearConfigCache = () => {
ConfigCache.clear();
};
module.exports = ScopeResolver;