Пример #1
0
        protected override void Initialize()
        {
            base.Initialize();

            // Force initialisation of [Imports] on this class.
            var componentModel = GetService(typeof(SComponentModel)) as IComponentModel;

            componentModel.DefaultCompositionService.SatisfyImportsOnce(this);

            // Wire up the Error Provider to the notifications from the service.
            errorProvider      = new DartErrorListProvider(this);
            errorsSubscription = SubscribeAsync(errorProvider);

            // Warn users if dependencies aren't installed.
            vsbaseWarningProvider = new ErrorListProvider(this);
            if (componentModel.DefaultExportProvider.GetExportedValueOrDefault <IOutputWindowService>() == null)
            {
                ErrorTask task = new ErrorTask()
                {
                    Category      = TaskCategory.Misc,
                    ErrorCategory = TaskErrorCategory.Error,
                    Text          = "The required VSBase Services debugging support extension is not installed. Click here for more information."
                };
                task.Navigate += HandleNavigateToVsBaseServicesExtension;
                vsbaseWarningProvider.Tasks.Add(task);
                vsbaseWarningProvider.Show();
            }

            // Register icons so they show in the solution explorer nicely.
            IconRegistration.RegisterIcons();

            ((IServiceContainer)this).AddService(typeof(DartLanguageInfo), new DartLanguageInfo(textDocumentFactory, editorAdapterFactory, analysisServiceFactory), true);
        }
Пример #2
0
        private async Task <IDisposable> SubscribeAsync(DartErrorListProvider errorProvider)
        {
            DartAnalysisService analysisService = await analysisServiceFactory.GetAnalysisServiceAsync().ConfigureAwait(false);

            return(analysisService.AnalysisErrorsNotification.Subscribe(errorProvider.UpdateErrors));
        }