Exemplo n.º 1
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
#pragma warning disable RS0030 // Do not used banned APIs
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            _projectSelectorService = await this.GetServiceAsync <SVsRegisterProjectTypes, IVsRegisterProjectSelector>();

#pragma warning restore RS0030 // Do not used banned APIs
            Guid selectorGuid = typeof(FSharpProjectSelector).GUID;
            _projectSelectorService.RegisterProjectSelector(ref selectorGuid, new FSharpProjectSelector(), out _projectSelectorCookie);

            var componentModel = (IComponentModel)(await GetServiceAsync(typeof(SComponentModel)));
            Lazy <DebugFrameworksDynamicMenuCommand> debugFrameworksCmd = componentModel.DefaultExportProvider.GetExport <DebugFrameworksDynamicMenuCommand>();

            var mcs = (await GetServiceAsync(typeof(IMenuCommandService))) as OleMenuCommandService;
            mcs.AddCommand(debugFrameworksCmd.Value);

            Lazy <DebugFrameworkPropertyMenuTextUpdater> debugFrameworksMenuTextUpdater = componentModel.DefaultExportProvider.GetExport <DebugFrameworkPropertyMenuTextUpdater>();
            mcs.AddCommand(debugFrameworksMenuTextUpdater.Value);

            // Need to use the CPS export provider to get the dotnet compatibility detector
            Lazy <IProjectServiceAccessor> projectServiceAccessor = componentModel.DefaultExportProvider.GetExport <IProjectServiceAccessor>();
            _dotNetCoreCompatibilityDetector = projectServiceAccessor.Value.GetProjectService().Services.ExportProvider.GetExport <IDotNetCoreProjectCompatibilityDetector>().Value;
            await _dotNetCoreCompatibilityDetector.InitializeAsync();

            IVsProjectFactory factory = new XprojProjectFactory();
            factory.SetSite(new ServiceProviderToOleServiceProviderAdapter(ServiceProvider.GlobalProvider));
            RegisterProjectFactory(factory);

#if DEBUG
            DebuggerTraceListener.RegisterTraceListener();
#endif
        }
Exemplo n.º 2
0
        protected override System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            _projectSelectorService = this.GetService <IVsRegisterProjectSelector, SVsRegisterProjectTypes>();
            var selectorGuid = typeof(FSharpProjectSelector).GUID;

            _projectSelectorService.RegisterProjectSelector(ref selectorGuid, new FSharpProjectSelector(), out _projectSelectorCookie);

            return(base.InitializeAsync(cancellationToken, progress));
        }
Exemplo n.º 3
0
        public async Task InitAsync(IAsyncServiceProvider asyncServiceProvider)
        {
            _vsprojectSelector = (IVsRegisterProjectSelector)await asyncServiceProvider.GetServiceAsync(typeof(SVsRegisterProjectTypes));

            Guid selectorGuid = GetType().GUID;

            _vsprojectSelector.RegisterProjectSelector(ref selectorGuid, this, out _cookie);
            return;
        }
Exemplo n.º 4
0
        public async Task InitializeAsync(IAsyncServiceProvider asyncServiceProvider)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            _projectSelector = (IVsRegisterProjectSelector)await asyncServiceProvider.GetServiceAsync(typeof(SVsRegisterProjectTypes));

            Guid selectorGuid = GetType().GUID;

            _projectSelector.RegisterProjectSelector(ref selectorGuid, this, out _cookie);
        }
Exemplo n.º 5
0
        protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            _projectSelectorService = this.GetService <IVsRegisterProjectSelector, SVsRegisterProjectTypes>();
            Guid selectorGuid = typeof(FSharpProjectSelector).GUID;

            _projectSelectorService.RegisterProjectSelector(ref selectorGuid, new FSharpProjectSelector(), out _projectSelectorCookie);

            await base.InitializeAsync(cancellationToken, progress);
        }