public override void AddEventFunctionHighlighting(IHighlightingConsumer consumer, IMethod method, UnityEventFunction eventFunction,
                                                          string text, DaemonProcessKind kind)
        {
            var iconId = method.HasHotIcon(ContextProvider, SettingsStore.BoundSettingsStore, kind)
                ? InsightUnityIcons.InsightHot.Id
                : InsightUnityIcons.InsightUnity.Id;

            if (RiderIconProviderUtil.IsCodeVisionEnabled(SettingsStore.BoundSettingsStore, myCodeInsightProvider.ProviderId,
                                                          () => { base.AddEventFunctionHighlighting(consumer, method, eventFunction, text, kind); }, out var useFallback))
            {
                foreach (var declaration in method.GetDeclarations())
                {
                    if (declaration is ICSharpDeclaration cSharpDeclaration)
                    {
                        if (!useFallback)
                        {
                            consumer.AddImplicitConfigurableHighlighting(cSharpDeclaration);
                        }

                        myCodeInsightProvider.AddHighlighting(consumer, cSharpDeclaration, method, text, eventFunction.Description ?? string.Empty, text,
                                                              myIconHost.Transform(iconId), GetEventFunctionActions(cSharpDeclaration), RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myBackendUnityHost));
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected override void AddMonoBehaviourHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element,
                                                             string text,
                                                             string tooltip, DaemonProcessKind kind)
        {
            if (!myAssetSerializationMode.IsForceText ||
                !Settings.GetValue((UnitySettings key) => key.EnableInspectorPropertiesEditor) ||
                !Settings.GetValue((UnitySettings key) => key.IsAssetIndexingEnabled))
            {
                AddHighlighting(consumer, element, text, tooltip, kind);
                return;
            }

            if (RiderIconProviderUtil.IsCodeVisionEnabled(Settings, myFieldUsageProvider.ProviderId,
                                                          () => { base.AddHighlighting(consumer, element, text, tooltip, kind); }, out var useFallback))
            {
                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(element);
                }

                var isProcessing = myDeferredCacheController.IsProcessingFiles();
                myFieldUsageProvider.AddInspectorHighlighting(consumer, element, element.DeclaredElement, text,
                                                              tooltip, isProcessing ? "Inspector values are not available during asset indexing" : text,
                                                              isProcessing ? myIconHost.Transform(CodeInsightsThemedIcons.InsightWait.Id) : myIconHost.Transform(InsightUnityIcons.InsightUnity.Id),
                                                              GetActions(element), RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myConnectionTracker));
            }
        }
Ejemplo n.º 3
0
 protected virtual void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text,
                                        string tooltip, DaemonProcessKind kind)
 {
     consumer.AddImplicitConfigurableHighlighting(element);
     consumer.AddHotHighlighting(CallGraphSwaExtensionProvider, element, MarksProvider,
                                 SettingsStore.BoundSettingsStore, text, tooltip, kind, GetActions(element), ElementIdProvider);
 }
        protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text,
                                                string tooltip, DaemonProcessKind kind)
        {
            consumer.AddImplicitConfigurableHighlighting(element);

            var isIconHot = element.HasHotIcon(ContextProvider, SettingsStore.BoundSettingsStore, kind);

            var highlighting = isIconHot
                ? new UnityHotGutterMarkInfo(GetActions(element), element, tooltip)
                : (IHighlighting) new UnityGutterMarkInfo(GetActions(element), element, tooltip);

            consumer.AddHighlighting(highlighting);
        }
Ejemplo n.º 5
0
 public virtual void AddEventFunctionHighlighting(IHighlightingConsumer consumer, IMethod method,
                                                  UnityEventFunction eventFunction, string text, DaemonProcessKind kind)
 {
     foreach (var declaration in method.GetDeclarations())
     {
         if (declaration is ICSharpDeclaration cSharpDeclaration)
         {
             consumer.AddImplicitConfigurableHighlighting(cSharpDeclaration);
             consumer.AddHotHighlighting(Swa, CallGraphSwaExtensionProvider, cSharpDeclaration, Analyzer, Settings, text,
                                         GetEventFunctionTooltip(eventFunction), kind, GetEventFunctionActions(cSharpDeclaration));
         }
     }
 }
Ejemplo n.º 6
0
        protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text,
                                                string tooltip, DaemonProcessKind kind)
        {
            consumer.AddImplicitConfigurableHighlighting(element);

            var isIconHot = element.HasHotIcon(myCallGraphSwaExtension, Settings, MarksProvider, kind, myProvider);

            var highlighting = isIconHot
                ? new UnityHotGutterMarkInfo(GetActions(element), element, tooltip)
                : (IHighlighting) new UnityGutterMarkInfo(GetActions(element), element, tooltip);

            consumer.AddHighlighting(highlighting);
        }
        public virtual void AddEventFunctionHighlighting(IHighlightingConsumer consumer, IMethod method,
                                                         UnityEventFunction eventFunction, string text, IReadOnlyCallGraphContext context)
        {
            var tooltip = GetEventFunctionTooltip(eventFunction);

            foreach (var declaration in method.GetDeclarations())
            {
                if (declaration is ICSharpDeclaration cSharpDeclaration)
                {
                    consumer.AddImplicitConfigurableHighlighting(cSharpDeclaration);
                    consumer.AddHotHighlighting(PerformanceContextProvider, cSharpDeclaration,
                                                SettingsStore.BoundSettingsStore, text, tooltip, context, GetEventFunctionActions(cSharpDeclaration, context));
                }
            }
        }
Ejemplo n.º 8
0
 protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text,
                                         string tooltip,
                                         DaemonProcessKind kind)
 {
     if (RiderIconProviderUtil.IsCodeVisionEnabled(SettingsStore.BoundSettingsStore, myCodeInsightProvider.ProviderId,
                                                   () => { base.AddHighlighting(consumer, element, text, tooltip, kind); }, out var useFallback))
     {
         if (!useFallback)
         {
             consumer.AddImplicitConfigurableHighlighting(element);
         }
         myCodeInsightProvider.AddHighlighting(consumer, element, element.DeclaredElement, text,
                                               tooltip, text, myIconHost.Transform(InsightUnityIcons.InsightUnity.Id), GetActions(element),
                                               RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myBackendUnityHost));
     }
 }
Ejemplo n.º 9
0
        protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text, string tooltip,
                                                DaemonProcessKind kind)
        {
            var iconId = element.HasHotIcon(CallGraphSwaExtensionProvider, SettingsStore.BoundSettingsStore,
                                            MarksProvider, kind, ElementIdProvider)
                ? InsightUnityIcons.InsightHot.Id
                : InsightUnityIcons.InsightUnity.Id;

            if (RiderIconProviderUtil.IsCodeVisionEnabled(SettingsStore.BoundSettingsStore, myCodeInsightProvider.ProviderId,
                                                          () => { base.AddHighlighting(consumer, element, text, tooltip, kind); }, out var useFallback))
            {
                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(element);
                }

                IconModel iconModel = myIconHost.Transform(iconId);
                if (myAssetIndexingSupport.IsEnabled.Value && myAssetSerializationMode.IsForceText)
                {
                    if (myDeferredCacheController.IsProcessingFiles())
                    {
                        iconModel = myIconHost.Transform(CodeInsightsThemedIcons.InsightWait.Id);
                    }

                    if (!myDeferredCacheController.CompletedOnce.Value)
                    {
                        tooltip = "Usages in assets are not available during asset indexing";
                    }
                }

                if (!myAssetIndexingSupport.IsEnabled.Value || !myDeferredCacheController.CompletedOnce.Value || !myAssetSerializationMode.IsForceText)
                {
                    myCodeInsightProvider.AddHighlighting(consumer, element, element.DeclaredElement, text,
                                                          tooltip, text, iconModel, GetActions(element),
                                                          RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myBackendUnityHost));
                }
                else
                {
                    var count = UnityEventsElementContainer.GetAssetUsagesCount(element.DeclaredElement, out var estimate);
                    myUsagesCodeVisionProvider.AddHighlighting(consumer, element, element.DeclaredElement, count,
                                                               "Click to view usages in assets", "Assets usages", estimate, iconModel);
                }
            }
        }
Ejemplo n.º 10
0
        protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text, string tooltip,
                                                IReadOnlyCallGraphContext context)
        {
            var iconId = element.HasHotIcon(ContextProvider, SettingsStore.BoundSettingsStore, context)
                ? InsightUnityIcons.InsightHot.Id
                : InsightUnityIcons.InsightUnity.Id;

            if (RiderIconProviderUtil.IsCodeVisionEnabled(SettingsStore.BoundSettingsStore, myFieldUsageProvider.ProviderId,
                                                          () => { base.AddHighlighting(consumer, element, text, tooltip, context); }, out var useFallback))
            {
                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(element);
                }
                myFieldUsageProvider.AddHighlighting(consumer, element, element.DeclaredElement, text,
                                                     tooltip, text, myIconHost.Transform(iconId), GetActions(element),
                                                     RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myBackendUnityHost));
            }
        }
Ejemplo n.º 11
0
        protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text, string tooltip,
                                                DaemonProcessKind kind)
        {
            var iconId = element.HasHotIcon(Swa, CallGraphSwaExtensionProvider, Settings, Analyzer, kind)
                ? InsightUnityIcons.InsightHot.Id
                : InsightUnityIcons.InsightUnity.Id;

            if (RiderIconProviderUtil.IsCodeVisionEnabled(Settings, myCodeInsightProvider.ProviderId,
                                                          () => { base.AddHighlighting(consumer, element, text, tooltip, kind); }, out var useFallback))
            {
                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(element);
                }
                myCodeInsightProvider.AddHighlighting(consumer, element, element.DeclaredElement, text,
                                                      tooltip, text, myIconHost.Transform(iconId), GetActions(element),
                                                      RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myConnectionTracker));
            }
        }
Ejemplo n.º 12
0
        protected override void AddMonoBehaviourHiglighting(IHighlightingConsumer consumer, IClassLikeDeclaration declaration, string text,
                                                            string tooltip, DaemonProcessKind kind)
        {
            if (RiderIconProviderUtil.IsCodeVisionEnabled(Settings, myCodeInsightProvider.ProviderId,
                                                          () => { base.AddHighlighting(consumer, declaration, text, tooltip, kind); }, out var useFallback))
            {
                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(declaration);
                }

                if (!myUnityYamlSupport.IsUnityYamlParsingEnabled.Value || !myAssetSerializationMode.IsForceText)
                {
                    myCodeInsightProvider.AddHighlighting(consumer, declaration, declaration.DeclaredElement, text,
                                                          tooltip, text, myIconHost.Transform(InsightUnityIcons.InsightUnity.Id), GetActions(declaration),
                                                          RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myConnectionTracker));
                }
            }
        }
        public override void AddEventFunctionHighlighting(IHighlightingConsumer consumer,
                                                          IMethod method,
                                                          UnityEventFunction eventFunction,
                                                          string text,
                                                          IReadOnlyCallGraphContext context)
        {
            var boundStore = SettingsStore.BoundSettingsStore;
            var providerId = myCodeInsightProvider.ProviderId;

            void Fallback() => base.AddEventFunctionHighlighting(consumer, method, eventFunction, text, context);

            // here is order of IsCodeVisionEnabled and hasHotIcon matters
            // hasHotIcon differs if hot icon or event function icon, it depends on multiple settings
            if (!RiderIconProviderUtil.IsCodeVisionEnabled(boundStore, providerId, Fallback, out var useFallback))
            {
                return;
            }

            var iconId = method.HasHotIcon(PerformanceContextProvider, boundStore, context)
                ? InsightUnityIcons.InsightHot.Id
                : InsightUnityIcons.InsightUnity.Id;
            var iconModel    = myIconHost.Transform(iconId);
            var extraActions = RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myBackendUnityHost);

            foreach (var declaration in method.GetDeclarations())
            {
                if (!(declaration is ICSharpDeclaration cSharpDeclaration))
                {
                    continue;
                }

                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(cSharpDeclaration);
                }

                var actions = GetEventFunctionActions(cSharpDeclaration, context);

                myCodeInsightProvider.AddHighlighting(consumer, cSharpDeclaration, method, text,
                                                      eventFunction.Description ?? string.Empty, text, iconModel, actions, extraActions);
            }
        }
Ejemplo n.º 14
0
        protected override void AddMonoBehaviourHighlighting(IHighlightingConsumer consumer, IClassLikeDeclaration declaration, string text,
                                                             string tooltip, DaemonProcessKind kind)
        {
            if (RiderIconProviderUtil.IsCodeVisionEnabled(SettingsStore.BoundSettingsStore, myCodeInsightProvider.ProviderId,
                                                          () => { base.AddHighlighting(consumer, declaration, text, tooltip, kind); }, out var useFallback))
            {
                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(declaration);
                }

                IconModel iconModel = myIconHost.Transform(InsightUnityIcons.InsightUnity.Id);
                if (myAssetIndexingSupport.IsEnabled.Value && myAssetSerializationMode.IsForceText)
                {
                    if (myDeferredCacheController.IsProcessingFiles())
                    {
                        iconModel = myIconHost.Transform(CodeInsightsThemedIcons.InsightWait.Id);
                    }

                    if (!myDeferredCacheController.CompletedOnce.Value)
                    {
                        tooltip = "Usages in assets are not available during asset indexing";
                    }
                }

                if (!myAssetIndexingSupport.IsEnabled.Value || !myDeferredCacheController.CompletedOnce.Value || !myAssetSerializationMode.IsForceText)
                {
                    myCodeInsightProvider.AddHighlighting(consumer, declaration, declaration.DeclaredElement, text,
                                                          tooltip, text, iconModel, GetActions(declaration),
                                                          RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myBackendUnityHost));
                }
                else
                {
                    var count = myAssetScriptUsagesElementContainer.GetUsagesCount(declaration, out var estimatedResult);
                    myUsagesCodeVisionProvider.AddHighlighting(consumer, declaration, declaration.DeclaredElement, count,
                                                               "Click to view usages in assets", "Assets usages", estimatedResult, iconModel);
                }
            }
        }
Ejemplo n.º 15
0
        protected override void AddMonoBehaviourHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element,
                                                             string text,
                                                             string tooltip, DaemonProcessKind kind)
        {
            if (!myAssetSerializationMode.IsForceText ||
                !Settings.GetValue((UnitySettings key) => key.EnableInspectorPropertiesEditor))
            {
                AddHighlighting(consumer, element, text, tooltip, kind);
                return;
            }

            if (RiderIconProviderUtil.IsCodeVisionEnabled(Settings, myFieldUsageProvider.ProviderId,
                                                          () => { base.AddHighlighting(consumer, element, text, tooltip, kind); }, out var useFallback))
            {
                if (!useFallback)
                {
                    consumer.AddImplicitConfigurableHighlighting(element);
                }
                myFieldUsageProvider.AddInspectorHighlighting(consumer, element, element.DeclaredElement, text,
                                                              tooltip, text, myIconHost.Transform(InsightUnityIcons.InsightUnity.Id), GetActions(element),
                                                              RiderIconProviderUtil.GetExtraActions(mySolutionTracker, myConnectionTracker));
            }
        }
Ejemplo n.º 16
0
 protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text, string tooltip,
                                         IReadOnlyCallGraphContext context)
 {
     consumer.AddImplicitConfigurableHighlighting(element);
     consumer.AddHighlighting(new UnityGutterMarkInfo(element, tooltip));
 }
Ejemplo n.º 17
0
 protected override void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration declaration, string text, string tooltip, DaemonProcessKind kind)
 {
     consumer.AddImplicitConfigurableHighlighting(declaration);
     consumer.AddHighlighting(new UnityGutterMarkInfo(GetActions(declaration), declaration, tooltip));
 }
 protected virtual void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text,
                                        string tooltip, DaemonProcessKind kind)
 {
     consumer.AddImplicitConfigurableHighlighting(element);
     consumer.AddHotHighlighting(Swa, CallGraphSwaExtensionProvider, element, Analyzer, Settings, text, tooltip, kind, GetActions(element));
 }
 protected virtual void AddHighlighting(IHighlightingConsumer consumer, ICSharpDeclaration element, string text,
                                        string tooltip, IReadOnlyCallGraphContext context)
 {
     consumer.AddImplicitConfigurableHighlighting(element);
     consumer.AddHotHighlighting(ContextProvider, element, SettingsStore.BoundSettingsStore, text, tooltip, context, GetActions(element));
 }