public UnityHighlightingProcess([NotNull] IDaemonProcess process, [NotNull] ICSharpFile file,
                                        CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                        PerformanceCriticalCodeCallGraphMarksProvider performanceCriticalCodeCallGraphMarksProvider,
                                        bool isPerformanceAnalysisEnabled,
                                        CallGraphBurstMarksProvider callGraphBurstMarksProvider, bool isBurstAnalysisEnabled,
                                        IEnumerable <IUnityDeclarationHighlightingProvider> declarationHighlightingProviders,
                                        IEnumerable <IUnityProblemAnalyzer> performanceProblemAnalyzers, UnityApi api,
                                        UnityCommonIconProvider commonIconProvider,
                                        DaemonProcessKind processKind, IElementIdProvider provider,
                                        ILogger logger)
            : base(process, file)
        {
            myCallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
            myPerformanceCriticalCodeCallGraphMarksProvider = performanceCriticalCodeCallGraphMarksProvider;
            myIsPerformanceAnalysisEnabled     = isPerformanceAnalysisEnabled;
            myCallGraphBurstMarksProvider      = callGraphBurstMarksProvider;
            myIsBurstAnalysisEnabled           = isBurstAnalysisEnabled;
            myDeclarationHighlightingProviders = declarationHighlightingProviders;
            myPerformanceProblemAnalyzers      = performanceProblemAnalyzers;
            myAPI = api;
            myCommonIconProvider = commonIconProvider;
            myProcessKind        = processKind;
            myProvider           = provider;
            myLogger             = logger;

            myEventFunctions = DaemonProcess.CustomData.GetData(UnityEventFunctionAnalyzer.UnityEventFunctionNodeKey)
                               ?.Where(t => t != null && t.IsValid()).ToJetHashSet();

            DaemonProcess.CustomData.PutData(UnityEventFunctionAnalyzer.UnityEventFunctionNodeKey, myEventFunctions);

            myProblemAnalyzersByContext = myPerformanceProblemAnalyzers.GroupBy(t => t.Context)
                                          .ToDictionary(t => t.Key, t => t.ToList());
        }
示例#2
0
 public RiderEventHandlerDetector(ISolution solution,
                                  CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                  IApplicationWideContextBoundSettingStore settingsStore,
                                  AssetIndexingSupport assetIndexingSupport,
                                  PerformanceCriticalCodeCallGraphMarksProvider marksProvider,
                                  UnityEventsElementContainer unityEventsElementContainer,
                                  UnityCodeInsightProvider codeInsightProvider,
                                  UnityUsagesCodeVisionProvider usagesCodeVisionProvider,
                                  DeferredCacheController deferredCacheController,
                                  UnitySolutionTracker solutionTracker,
                                  BackendUnityHost backendUnityHost,
                                  IconHost iconHost, AssetSerializationMode assetSerializationMode,
                                  IElementIdProvider elementIdProvider)
     : base(solution, settingsStore, callGraphSwaExtensionProvider, unityEventsElementContainer, marksProvider,
            elementIdProvider)
 {
     myAssetIndexingSupport     = assetIndexingSupport;
     myCodeInsightProvider      = codeInsightProvider;
     myUsagesCodeVisionProvider = usagesCodeVisionProvider;
     myDeferredCacheController  = deferredCacheController;
     mySolutionTracker          = solutionTracker;
     myBackendUnityHost         = backendUnityHost;
     myIconHost = iconHost;
     myAssetSerializationMode = assetSerializationMode;
 }
示例#3
0
 public TypeDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                     IApplicationWideContextBoundSettingStore settingsStore, UnityApi unityApi,
                     PerformanceCriticalCodeCallGraphMarksProvider marksProvider, IElementIdProvider provider)
     : base(solution, settingsStore, callGraphSwaExtensionProvider, marksProvider, provider)
 {
     myUnityApi = unityApi;
 }
示例#4
0
 public InitialiseOnLoadCctorDetector(ISolution solution,
                                      CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                      IApplicationWideContextBoundSettingStore settingsStore,
                                      PerformanceCriticalCodeCallGraphMarksProvider marksProvider,
                                      IElementIdProvider provider)
     : base(solution, settingsStore, callGraphSwaExtensionProvider, marksProvider, provider)
 {
 }
示例#5
0
 public EventHandlerDetector(ISolution solution, IApplicationWideContextBoundSettingStore settingsStore,
                             CallGraphSwaExtensionProvider callGraphSwaExtension,
                             UnityEventsElementContainer unityEventsElementContainer,
                             PerformanceCriticalCodeCallGraphMarksProvider marksProvider,
                             IElementIdProvider provider)
     : base(solution, settingsStore, callGraphSwaExtension, marksProvider, provider)
 {
     UnityEventsElementContainer = unityEventsElementContainer;
 }
示例#6
0
 public UnityHighlightingStage(CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                               PerformanceCriticalCodeCallGraphMarksProvider performanceCriticalCodeCallGraphMarksProvider,
                               IEnumerable <IUnityDeclarationHighlightingProvider> higlightingProviders,
                               IEnumerable <IUnityProblemAnalyzer> performanceProblemAnalyzers,
                               UnityApi api, UnityCommonIconProvider commonIconProvider, IElementIdProvider provider, ILogger logger)
     : base(callGraphSwaExtensionProvider, performanceCriticalCodeCallGraphMarksProvider,
            higlightingProviders, performanceProblemAnalyzers, api, commonIconProvider, provider, logger)
 {
 }
示例#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;
 }
 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;
 }
示例#9
0
 public RiderInitialiseOnLoadCctorDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                           SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityCodeInsightFieldUsageProvider fieldUsageProvider,
                                           UnitySolutionTracker solutionTracker, ConnectionTracker connectionTracker,
                                           IconHost iconHost, IElementIdProvider provider)
     : base(solution, callGraphSwaExtensionProvider, settingsStore, marksProvider, provider)
 {
     myFieldUsageProvider = fieldUsageProvider;
     mySolutionTracker    = solutionTracker;
     myConnectionTracker  = connectionTracker;
     myIconHost           = iconHost;
     myProvider           = provider;
 }
示例#10
0
 protected UnityDeclarationHighlightingProviderBase(ISolution solution,
                                                    IApplicationWideContextBoundSettingStore settingsStore,
                                                    CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                                    PerformanceCriticalCodeCallGraphMarksProvider marksProvider,
                                                    IElementIdProvider provider)
 {
     Solution = solution;
     CallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
     MarksProvider     = marksProvider;
     SettingsStore     = settingsStore;
     ElementIdProvider = provider;
 }
 public UnityCommonIconProvider(ISolution solution,
                                CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi unityApi,
                                IElementIdProvider provider)
 {
     Solution = solution;
     CallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
     MarksProvider = marksProvider;
     UnityApi      = unityApi;
     Settings      = settingsStore.BindToContextTransient(ContextRange.Smart(solution.ToDataContext()));
     myProvider    = provider;
 }
示例#12
0
 public UnityCommonIconProvider(ISolution solution, UnityApi unityApi,
                                CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                IApplicationWideContextBoundSettingStore settingsStore,
                                PerformanceCriticalCodeCallGraphMarksProvider marksProvider,
                                IElementIdProvider provider)
 {
     mySolution = solution;
     CallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
     MarksProvider = marksProvider;
     UnityApi      = unityApi;
     SettingsStore = settingsStore;
     myProvider    = provider;
 }
示例#13
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));
        }
示例#14
0
 public RiderFieldDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                           SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi unityApi,
                           UnityCodeInsightFieldUsageProvider fieldUsageProvider, DeferredCacheController deferredCacheController,
                           UnitySolutionTracker solutionTracker, ConnectionTracker connectionTracker,
                           IconHost iconHost, AssetSerializationMode assetSerializationMode, IElementIdProvider provider)
     : base(solution, callGraphSwaExtensionProvider, settingsStore, marksProvider, unityApi, provider)
 {
     myFieldUsageProvider      = fieldUsageProvider;
     myDeferredCacheController = deferredCacheController;
     mySolutionTracker         = solutionTracker;
     myConnectionTracker       = connectionTracker;
     myIconHost = iconHost;
     myAssetSerializationMode = assetSerializationMode;
 }
示例#15
0
 public RiderInitialiseOnLoadCctorDetector(ISolution solution,
                                           CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                           IApplicationWideContextBoundSettingStore settingsStore,
                                           PerformanceCriticalCodeCallGraphMarksProvider marksProvider,
                                           UnityCodeInsightFieldUsageProvider fieldUsageProvider,
                                           UnitySolutionTracker solutionTracker,
                                           BackendUnityHost backendUnityHost,
                                           IconHost iconHost, IElementIdProvider elementIdProvider)
     : base(solution, callGraphSwaExtensionProvider, settingsStore, marksProvider, elementIdProvider)
 {
     myFieldUsageProvider = fieldUsageProvider;
     mySolutionTracker    = solutionTracker;
     myBackendUnityHost   = backendUnityHost;
     myIconHost           = iconHost;
 }
 protected UnityHighlightingAbstractStage(CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                          PerformanceCriticalCodeCallGraphMarksProvider performanceCriticalCodeCallGraphMarksProvider,
                                          IEnumerable <IUnityDeclarationHighlightingProvider> higlightingProviders,
                                          IEnumerable <IUnityProblemAnalyzer> performanceProblemAnalyzers, UnityApi api,
                                          UnityCommonIconProvider commonIconProvider, IElementIdProvider provider, ILogger logger)
 {
     myCallGraphSwaExtensionProvider = callGraphSwaExtensionProvider;
     myPerformanceCriticalCodeCallGraphMarksProvider = performanceCriticalCodeCallGraphMarksProvider;
     HiglightingProviders        = higlightingProviders;
     PerformanceProblemAnalyzers = performanceProblemAnalyzers;
     API = api;
     myCommonIconProvider = commonIconProvider;
     myProvider           = provider;
     Logger = logger;
 }
示例#17
0
 public RiderUnityCommonIconProvider(ISolution solution,
                                     CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                                     IApplicationWideContextBoundSettingStore settingsStore,
                                     PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi api,
                                     UnityCodeInsightProvider codeInsightProvider,
                                     UnitySolutionTracker solutionTracker,
                                     BackendUnityHost backendUnityHost,
                                     IconHost iconHost, IElementIdProvider provider)
     : base(solution, api, callGraphSwaExtensionProvider, settingsStore, marksProvider, provider)
 {
     myCodeInsightProvider = codeInsightProvider;
     mySolutionTracker     = solutionTracker;
     myBackendUnityHost    = backendUnityHost;
     myIconHost            = iconHost;
     myProvider            = provider;
 }
示例#18
0
 public RiderTypeDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider,
                          SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi unityApi,
                          AssetIndexingSupport assetIndexingSupport, UnityUsagesCodeVisionProvider usagesCodeVisionProvider, UnityCodeInsightProvider codeInsightProvider, AssetUsagesElementContainer assetUsagesElementContainer,
                          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;
     myAssetUsagesElementContainer = assetUsagesElementContainer;
     myDeferredCacheController     = deferredCacheController;
     mySolutionTracker             = solutionTracker;
     myConnectionTracker           = connectionTracker;
     myIconHost = iconHost;
     myAssetSerializationMode = assetSerializationMode;
 }
示例#19
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);
        }
示例#20
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.IsMarkedByCallGraphRootMarksProvider(marksProvider.Id,
                                                                                      kind == DaemonProcessKind.GLOBAL_WARNINGS, id.Value));
        }
示例#21
0
 public EventHandlerDetector(ISolution solution, SettingsStore settingsStore,
                             CallGraphSwaExtensionProvider callGraphSwaExtension, AssetMethodsElementContainer assetMethodsElementContainer, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, IElementIdProvider provider)
     : base(solution, callGraphSwaExtension, settingsStore, marksProvider, provider)
 {
     myCallGraphSwaExtension        = callGraphSwaExtension;
     myAssetMethodsElementContainer = assetMethodsElementContainer;
     myProvider = provider;
 }
示例#22
0
 public FieldDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider, SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi unityApi, IElementIdProvider provider)
     : base(solution, callGraphSwaExtensionProvider, settingsStore, marksProvider, provider)
 {
     myUnityApi = unityApi;
 }