void (@NotNull ParserDefinition definition) { Language language = definition.getFileNodeType().getLanguage(); myLangParserDefinition.registerExtension(new KeyedLazyInstance<>() { @Override public String getKey() { return language.getID(); } @NotNull @Override public ParserDefinition getInstance() { return definition; } }); LanguageParserDefinitions.INSTANCE.clearCache(language); disposeOnTearDown(() -> LanguageParserDefinitions.INSTANCE.clearCache(language)); }