Search in sources :

Example 1 with IEditor

use of org.metaborg.core.editor.IEditor in project spoofax by metaborg.

the class LanguageChangeProcessor method removedImpl.

/**
 * Implementation was removed
 *
 * @param impl
 *            Removed implementation
 */
protected void removedImpl(ILanguageImpl impl) {
    for (ILanguageCache languageCache : languageCaches) {
        languageCache.invalidateCache(impl);
    }
    parseResultProcessor.invalidate(impl);
    analysisResultProcessor.invalidate(impl);
    final Iterable<IEditor> editors = editorRegistry.openEditors();
    for (IEditor editor : editors) {
        final ILanguageImpl language = editor.language();
        if (language != null && language.equals(impl)) {
            editor.reconfigure();
            editor.disable();
        }
    }
}
Also used : IEditor(org.metaborg.core.editor.IEditor) ILanguageImpl(org.metaborg.core.language.ILanguageImpl) ILanguageCache(org.metaborg.core.language.ILanguageCache)

Example 2 with IEditor

use of org.metaborg.core.editor.IEditor in project spoofax by metaborg.

the class LanguageChangeProcessor method reloadedImpl.

/**
 * Implementation was reloaded
 *
 * @param impl
 *            Reloaded implementation
 */
protected void reloadedImpl(ILanguageImpl impl) {
    for (ILanguageCache languageCache : languageCaches) {
        languageCache.invalidateCache(impl);
    }
    parseResultProcessor.invalidate(impl);
    analysisResultProcessor.invalidate(impl);
    final Iterable<IEditor> editors = editorRegistry.openEditors();
    for (IEditor editor : editors) {
        final ILanguageImpl editorLanguage = editor.language();
        if (editorLanguage == null || impl.equals(editorLanguage)) {
            editor.reconfigure();
            editor.forceUpdate();
        }
    }
}
Also used : IEditor(org.metaborg.core.editor.IEditor) ILanguageImpl(org.metaborg.core.language.ILanguageImpl) ILanguageCache(org.metaborg.core.language.ILanguageCache)

Aggregations

IEditor (org.metaborg.core.editor.IEditor)2 ILanguageCache (org.metaborg.core.language.ILanguageCache)2 ILanguageImpl (org.metaborg.core.language.ILanguageImpl)2