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; }
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); }
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); } } } }
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)); }
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)); }
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; }
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 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) { }
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; }
public FieldDetector(ISolution solution, CallGraphSwaExtensionProvider callGraphSwaExtensionProvider, SettingsStore settingsStore, PerformanceCriticalCodeCallGraphMarksProvider marksProvider, UnityApi unityApi, IElementIdProvider provider) : base(solution, callGraphSwaExtensionProvider, settingsStore, marksProvider, provider) { myUnityApi = unityApi; }