public RiderXamlStylerHost(
            [NotNull] Lifetime lifetime,
            [NotNull] SolutionModel solutionModel,
            [NotNull] ISolution solution,
            [NotNull] DocumentManager documentManager)
        {
            _lifetime        = lifetime;
            _solutionModel   = solutionModel;
            _solution        = solution;
            _documentManager = documentManager;

            var rdSolutionModel = solutionModel.TryGetCurrentSolution();

            if (rdSolutionModel != null)
            {
                var rdXamlStylerModel = rdSolutionModel.GetXamlStylerModel();
                rdXamlStylerModel.PerformReformat.Set(PerformReformatHandler);
            }
        }
Exemple #2
0
        public static Action ProcessDataContext(
            [NotNull] Lifetime lifetime,
            [NotNull, ContextKey(typeof(ContextHighlighterPsiFileView.ContextKey))] IPsiDocumentRangeView psiDocumentRangeView,
            SolutionModel solutionModel,
            UnityApi unityApi)
        {
            var solution = solutionModel.TryGetCurrentSolution();

            if (solution == null)
            {
                return(null);
            }

            var unityName = GetUnityName(psiDocumentRangeView, unityApi);

            // This is called only if the process finished while the context is still valid
            return(() =>
            {
                solution.CustomData.Data["UNITY_ExternalDocContext"] = unityName;
            });
        }