Exemplo n.º 1
0
        public static Action ProcessContext(
            [NotNull] Lifetime lifetime,
            [NotNull] HighlightingProlongedLifetime prolongedLifetime,
            [NotNull, ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))] IPsiDocumentRangeView psiDocumentRangeView
            )
        {
            var psiView = psiDocumentRangeView.View <JsonLanguage>();

            foreach (var file in psiView.SortedSourceFiles)
            {
                if (!file.IsAsmDef())
                {
                    return(null);
                }
            }

            var declaredElement = FindDeclaredElement(psiView, out var literalExpressionUnderCaret);

            if (declaredElement == null)
            {
                return(null);
            }

            var highlighter = new AsmDefUsagesContextHighlighter(declaredElement, literalExpressionUnderCaret);

            return(highlighter.GetDataProcessAction(prolongedLifetime, psiDocumentRangeView));
        }
Exemplo n.º 2
0
        public static Action ProcessContext(
            [NotNull] Lifetime lifetime, [NotNull] HighlightingProlongedLifetime prolongedLifetime,
            [NotNull, ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))] IPsiDocumentRangeView psiDocumentRangeView,
            [NotNull] ShaderLabUsageContextHighlighterAvailability contextHighlighterAvailability)
        {
            var psiView = psiDocumentRangeView.View <ShaderLabLanguage>();

            foreach (var file in psiView.SortedSourceFiles)
            {
                if (!contextHighlighterAvailability.IsAvailable(file))
                {
                    return(null);
                }
            }

            var declaredElement = FindDeclaredElement(psiView, out var declarationUnderCaret);

            if (declaredElement == null)
            {
                return(null);
            }

            var highlighter = new ShaderLabUsagesContextHighlighter(declaredElement, declarationUnderCaret);

            return(highlighter.GetDataProcessAction(prolongedLifetime, psiDocumentRangeView));
        }
 public static Action ProcessContext(
     [NotNull] HighlightingProlongedLifetime prolongedLifetime,
     [NotNull][ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))]
     IPsiDocumentRangeView psiDocumentRangeView,
     MessageTemplateParser messageTemplate)
 {
     return(new TemplateFormatItemAndMatchingArgumentHighlighter(messageTemplate).GetDataProcessAction(
                prolongedLifetime,
                psiDocumentRangeView));
 }
        public static Action ProcessDataContext(
            Lifetime lifetime,
            [NotNull, ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))]
            IPsiDocumentRangeView psiDocumentRangeView,
            [NotNull] InvisibleBraceHintManager invisibleBraceHintManager,
            [NotNull] MatchingBraceSuggester matchingBraceSuggester,
            [NotNull] HighlightingProlongedLifetime prolongedLifetime)
        {
            var highlighter = new FSharpTypeParametersMatchingBracesContextHighlighter();

            return(highlighter.ProcessDataContextImpl(
                       lifetime, prolongedLifetime, psiDocumentRangeView, invisibleBraceHintManager, matchingBraceSuggester));
        }
Exemplo n.º 5
0
        public static Action ProcessDataContext(
            [NotNull] Lifetime lifetime,
            [NotNull, ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))]
            IPsiDocumentRangeView psiDocumentRangeView,
            [NotNull] InvisibleBraceHintManager invisibleBraceHintManager,
            [NotNull] MatchingBraceSuggester matchingBraceSuggester,
            [NotNull] MatchingBraceConsumerFactory consumerFactory,
            [NotNull] HighlightingProlongedLifetime prolongedLifetime)
        {
            var highlighter = new ShaderLabMatchingBraceContextHighlighter();

            return(highlighter.ProcessDataContextImpl(lifetime, prolongedLifetime, psiDocumentRangeView,
                                                      invisibleBraceHintManager, matchingBraceSuggester, consumerFactory));
        }
        public override Action GetDataProcessAction(
            HighlightingProlongedLifetime prolongedLifetime,
            IPsiDocumentRangeView psiDocumentRangeView)
        {
            var consumer = new HighlightingsConsumer();

            CollectHighlightings(psiDocumentRangeView, consumer);
            return(() =>
            {
                foreach (var highlightInfo in consumer.HighlightInfos)
                {
                    CaretDependentFeaturesUtil.HighlightForLifetime(prolongedLifetime.Lifetime, highlightInfo);
                }
            });
        }
Exemplo n.º 7
0
        public static Action ProcessContext(
            [NotNull] Lifetime lifetime, [NotNull] HighlightingProlongedLifetime prolongedLifetime,
            [NotNull, ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))] IPsiDocumentRangeView psiDocumentRangeView)
        {
            var isEnabled = GetSettingValue(psiDocumentRangeView, HighlightingSettingsAccessor.ContextExitsHighlightingEnabled);

            if (!isEnabled)
            {
                return(null);
            }

            var highlighter = new PerformanceCriticalCodeContextHighlighter();

            return(highlighter.GetDataProcessAction(prolongedLifetime, psiDocumentRangeView));
        }
        public static Action ProcessContext(
            Lifetime lifetime, [NotNull] HighlightingProlongedLifetime prolongedLifetime,
            [NotNull, ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))]
            IPsiDocumentRangeView psiDocumentRangeView,
            [NotNull] UsagesContextHighlighterAvailabilityComponent contextHighlighterAvailability)
        {
            var psiView = psiDocumentRangeView.View <FSharpLanguage>();

            foreach (var psiSourceFile in psiView.SortedSourceFiles)
            {
                if (!contextHighlighterAvailability.IsAvailable(psiSourceFile))
                {
                    return(null);
                }
            }

            return(new FSharpUsagesContextHighlighter().GetDataProcessAction(prolongedLifetime, psiDocumentRangeView));
        }