コード例 #1
0
 public RiderTypeDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                          SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi unityApi,
                          AssetIndexingSupport assetIndexingSupport, UnityUsagesCodeVisionProvider usagesCodeVisionProvider, UnityCodeInsightProvider codeInsightProvider, AssetScriptUsagesElementContainer assetScriptUsagesElementContainer,
                          DeferredCacheController deferredCacheController, UnitySolutionTracker solutionTracker, ConnectionTracker connectionTracker,
                          IconHost iconHost, AssetSerializationMode assetSerializationMode, IElementIdProvider provider)
     : base(solution, callGraphSwaExtensionProvider, settingsStore, unityApi, marksProvider, provider)
 {
     myAssetIndexingSupport              = assetIndexingSupport;
     myUsagesCodeVisionProvider          = usagesCodeVisionProvider;
     myCodeInsightProvider               = codeInsightProvider;
     myAssetScriptUsagesElementContainer = assetScriptUsagesElementContainer;
     myDeferredCacheController           = deferredCacheController;
     mySolutionTracker        = solutionTracker;
     myConnectionTracker      = connectionTracker;
     myIconHost               = iconHost;
     myAssetSerializationMode = assetSerializationMode;
 }
コード例 #2
0
        public static void AddHotHighlighting(this IHighlightingConsumer consumer,
                                              CallGraphSwaExtensionProvider swaExtensionProvider, ICSharpDeclaration element, PerformanceCriticalCodeCallGraphMarksProvider marksProvider,
                                              IContextBoundSettingsStore settings, string text,
                                              string tooltip, DaemonProcessKind kind, IEnumerable <BulbMenuItem> items, IElementIdProvider provider, bool onlyHot = false)
        {
            var isIconHot = element.HasHotIcon(swaExtensionProvider, settings, marksProvider, kind, provider);

            if (onlyHot && !isIconHot)
            {
                return;
            }

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

            consumer.AddHighlighting(highlighting);
        }
コード例 #3
0
        public void FindEdges(ITreeNode treeNode, IDeclaredElement caller, ICallGraphEdgeConsumer consumer, IElementIdProvider provider)
        {
            if (treeNode is IInvocationExpression invocationExpression)
            {
                var name = invocationExpression.Reference?.Resolve().DeclaredElement?.ShortName;

                if (name != null && (name.Equals("Invoke") || name.Equals("InvokeRepeating")))
                {
                    var implicitlyInvokeDeclaredElement = invocationExpression.Arguments.FirstOrDefault()?.Value
                                                          ?.GetReferences <UnityEventFunctionReference>().FirstOrDefault()?.Resolve().DeclaredElement;
                    if (implicitlyInvokeDeclaredElement != null)
                    {
                        consumer.TryAddEdge(caller, implicitlyInvokeDeclaredElement, provider);
                    }
                }
            }
        }
コード例 #4
0
        public static bool HasHotIcon(this ICSharpDeclaration element,
                                      CallGraphSwaExtensionProvider callGraphSwaExtensionProvider, IContextBoundSettingsStore settingsStore,
                                      PerformanceCriticalCodeCallGraphMarksProvider marksProvider, DaemonProcessKind kind, IElementIdProvider provider)
        {
            var declaredElement = element.DeclaredElement;

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

            return(declaredElement.HasHotIcon(callGraphSwaExtensionProvider, settingsStore, marksProvider, kind, provider));
        }
コード例 #5
0
        public static bool HasHotIcon(this IDeclaredElement element,
                                      CallGraphSwaExtensionProvider callGraphSwaExtensionProvider, IContextBoundSettingsStore settingsStore,
                                      PerformanceCriticalCodeCallGraphMarksProvider marksProvider, DaemonProcessKind kind, IElementIdProvider provider)
        {
            if (!settingsStore.GetValue((UnitySettings key) => key.EnableIconsForPerformanceCriticalCode))
            {
                return(false);
            }

            if (!settingsStore.GetValue((UnitySettings key) => key.EnablePerformanceCriticalCodeHighlighting))
            {
                return(false);
            }

            var id = provider.GetElementId(element);

            if (!id.HasValue)
            {
                return(false);
            }

            return(callGraphSwaExtensionProvider.IsMarkedByCallGraphAnalyzer(marksProvider.Id,
                                                                             kind == DaemonProcessKind.GLOBAL_WARNINGS, id.Value));
        }
コード例 #6
0
 public RiderUnityCommonIconProvider(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                     SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi api, UnityCodeInsightProvider codeInsightProvider,
                                     UnitySolutionTracker solutionTracker, ConnectionTracker connectionTracker, IconHost iconHost, IElementIdProvider provider)
     : base(solution, callGraphSwaExtensionProvider, settingsStore, marksProvider, api, provider)
 {
     myCodeInsightProvider = codeInsightProvider;
     mySolutionTracker     = solutionTracker;
     myConnectionTracker   = connectionTracker;
     myIconHost            = iconHost;
     myProvider            = provider;
 }
コード例 #7
0
 public UnityDeclarationHighlightingProviderBase(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                                 SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, IElementIdProvider provider)
 {
     Solution = solution;
     CallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
     MarksProvider = marksProvider;
     Settings      = settingsStore.BindToContextTransient(ContextRange.Smart(solution.ToDataContext()));
     myProvider    = provider;
 }
コード例 #8
0
 public UnityHighlightingGlobalStage(CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                     PerformanceCriticalCodeCallGraphMarksProvider performanceCriticalCodeCallGraphMarksProvider,
                                     CallGraphBurstMarksProvider callGraphBurstMarksProvider,
                                     IEnumerable <IUnityDeclarationHighlightingProvider> higlightingProviders,
                                     IEnumerable <IUnityProblemAnalyzer> performanceProblemAnalyzers,
                                     UnityApi api, UnityCommonIconProvider commonIconProvider, IElementIdProvider provider, ILogger logger)
     : base(callGraphSwaExtensionProvider, performanceCriticalCodeCallGraphMarksProvider, callGraphBurstMarksProvider,
            higlightingProviders, performanceProblemAnalyzers, api, commonIconProvider, provider, logger)
 {
 }
コード例 #9
0
 protected UnityHighlightingAbstractStage(CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                          PerformanceCriticalCodeCallGraphMarksProvider performanceCriticalCodeCallGraphMarksProvider,
                                          CallGraphBurstMarksProvider callGraphBurstMarksProvider,
                                          IEnumerable <IUnityDeclarationHighlightingProvider> higlightingProviders,
                                          IEnumerable <IUnityProblemAnalyzer> performanceProblemAnalyzers, UnityApi api,
                                          UnityCommonIconProvider commonIconProvider, IElementIdProvider provider, ILogger logger)
 {
     myCallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
     myPerformanceCriticalCodeCallGraphMarksProvider = performanceCriticalCodeCallGraphMarksProvider;
     myCallGraphBurstMarksProvider = callGraphBurstMarksProvider;
     HiglightingProviders          = higlightingProviders;
     PerformanceProblemAnalyzers   = performanceProblemAnalyzers;
     API = api;
     myCommonIconProvider = commonIconProvider;
     myProvider           = provider;
     Logger = logger;
 }
コード例 #10
0
 public FieldDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider, SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi unityApi, IElementIdProvider provider)
     : base(solution, callGraphSwaExtensionProvider, settingsStore, marksProvider, provider)
 {
     myUnityApi = unityApi;
 }