Пример #1
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));
            }
        }
        private string GetText()
        {
            if (myDeferredCacheController.IsProcessingFiles())
            {
                return("Symbol will not be renamed in assets.");
            }

            return("Please ensure the project is saved in the Unity Editor, or any changes will be lost.");
        }
Пример #3
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);
                }
            }
        }
Пример #4
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);
                }
            }
        }