Search in sources :

Example 1 with HighlightingLevelManager

use of com.intellij.codeInsight.daemon.impl.analysis.HighlightingLevelManager in project intellij-community by JetBrains.

the class HectorComponent method isModified.

private boolean isModified() {
    final FileViewProvider viewProvider = myFile.getViewProvider();
    for (Language language : mySliders.keySet()) {
        JSlider slider = mySliders.get(language);
        final PsiFile root = viewProvider.getPsi(language);
        HighlightingLevelManager highlightingLevelManager = HighlightingLevelManager.getInstance(myFile.getProject());
        if (root != null && getValue(highlightingLevelManager.shouldHighlight(root), highlightingLevelManager.shouldInspect(root)) != slider.getValue()) {
            return true;
        }
    }
    for (HectorComponentPanel panel : myAdditionalPanels) {
        if (panel.isModified()) {
            return true;
        }
    }
    return false;
}
Also used : HighlightingLevelManager(com.intellij.codeInsight.daemon.impl.analysis.HighlightingLevelManager) FileViewProvider(com.intellij.psi.FileViewProvider) Language(com.intellij.lang.Language) HectorComponentPanel(com.intellij.openapi.editor.HectorComponentPanel) PsiFile(com.intellij.psi.PsiFile)

Example 2 with HighlightingLevelManager

use of com.intellij.codeInsight.daemon.impl.analysis.HighlightingLevelManager in project intellij-community by JetBrains.

the class LineMarkersPass method doCollectInformation.

@Override
public void doCollectInformation(@NotNull ProgressIndicator progress) {
    final List<LineMarkerInfo> lineMarkers = new ArrayList<>();
    FileViewProvider viewProvider = myFile.getViewProvider();
    for (Language language : viewProvider.getLanguages()) {
        final PsiFile root = viewProvider.getPsi(language);
        HighlightingLevelManager highlightingLevelManager = HighlightingLevelManager.getInstance(myProject);
        if (!highlightingLevelManager.shouldHighlight(root))
            continue;
        Divider.divideInsideAndOutsideInOneRoot(root, myRestrictRange, myPriorityBounds, elements -> {
            Collection<LineMarkerProvider> providers = getMarkerProviders(language, myProject);
            List<LineMarkerProvider> providersList = new ArrayList<>(providers);
            queryProviders(elements.inside, root, providersList, (element, info) -> {
                lineMarkers.add(info);
                ApplicationManager.getApplication().invokeLater(() -> LineMarkersUtil.addLineMarkerToEditorIncrementally(myProject, getDocument(), info), myProject.getDisposed());
            });
            queryProviders(elements.outside, root, providersList, (element, info) -> lineMarkers.add(info));
            return true;
        });
    }
    myMarkers = mergeLineMarkers(lineMarkers, getDocument());
    if (LOG.isDebugEnabled()) {
        LOG.debug("LineMarkersPass.doCollectInformation. lineMarkers: " + lineMarkers + "; merged: " + myMarkers);
    }
}
Also used : HighlightingLevelManager(com.intellij.codeInsight.daemon.impl.analysis.HighlightingLevelManager) InjectedFileViewProvider(com.intellij.psi.impl.source.tree.injected.InjectedFileViewProvider) FileViewProvider(com.intellij.psi.FileViewProvider) Language(com.intellij.lang.Language) PsiFile(com.intellij.psi.PsiFile)

Aggregations

HighlightingLevelManager (com.intellij.codeInsight.daemon.impl.analysis.HighlightingLevelManager)2 Language (com.intellij.lang.Language)2 FileViewProvider (com.intellij.psi.FileViewProvider)2 PsiFile (com.intellij.psi.PsiFile)2 HectorComponentPanel (com.intellij.openapi.editor.HectorComponentPanel)1 InjectedFileViewProvider (com.intellij.psi.impl.source.tree.injected.InjectedFileViewProvider)1