コード例 #1
0
 public Analyzer(IForegroundNotificationService notificationService, IAsynchronousOperationListener listener, VisualStudioWorkspace workspace, ProjectCodeModelFactory projectCodeModelFactory)
 {
     _notificationService     = notificationService;
     _listener                = listener;
     _workspace               = workspace;
     _projectCodeModelFactory = projectCodeModelFactory;
 }
コード例 #2
0
ファイル: ProjectCodeModel.cs プロジェクト: josh-127/roslyn
 public ProjectCodeModel(IThreadingContext threadingContext, ProjectId projectId, ICodeModelInstanceFactory codeModelInstanceFactory, VisualStudioWorkspace visualStudioWorkspace, IServiceProvider serviceProvider, ProjectCodeModelFactory projectCodeModelFactory)
 {
     _threadingContext         = threadingContext;
     _projectId                = projectId;
     _codeModelInstanceFactory = codeModelInstanceFactory;
     _visualStudioWorkspace    = visualStudioWorkspace;
     _serviceProvider          = serviceProvider;
     _projectCodeModelFactory  = projectCodeModelFactory;
 }
コード例 #3
0
 public CodeModelIncrementalAnalyzerProvider(
     IForegroundNotificationService notificationService,
     IAsynchronousOperationListenerProvider listenerProvider,
     ProjectCodeModelFactory projectCodeModelFactory)
 {
     _listener                = listenerProvider.GetListener(FeatureAttribute.CodeModel);
     _notificationService     = notificationService;
     _projectCodeModelFactory = projectCodeModelFactory;
 }
コード例 #4
0
 internal CodeModelProjectCache(
     IThreadingContext threadingContext,
     ProjectId projectId,
     ICodeModelInstanceFactory codeModelInstanceFactory,
     ProjectCodeModelFactory projectFactory,
     IServiceProvider serviceProvider,
     HostLanguageServices languageServices,
     VisualStudioWorkspace workspace)
 {
     State      = new CodeModelState(threadingContext, serviceProvider, languageServices, workspace, projectFactory);
     _projectId = projectId;
     _codeModelInstanceFactory = codeModelInstanceFactory;
 }
コード例 #5
0
        public NodeKeyValidation(ProjectCodeModelFactory projectCodeModelFactory)
        {
            foreach (var projectCodeModel in projectCodeModelFactory.GetAllProjectCodeModels())
            {
                var fcms = projectCodeModel.GetCachedFileCodeModelInstances();

                foreach (var fcm in fcms)
                {
                    var globalNodeKeys = fcm.Object.GetCurrentNodeKeys();

                    _nodeKeysMap.Add(fcm, globalNodeKeys);
                }
            }
        }
コード例 #6
0
        public CodeModelState(
            IThreadingContext threadingContext,
            IServiceProvider serviceProvider,
            HostLanguageServices languageServices,
            VisualStudioWorkspace workspace,
            ProjectCodeModelFactory projectCodeModelFactory)
        {
            Debug.Assert(threadingContext != null);
            Debug.Assert(serviceProvider != null);
            Debug.Assert(languageServices != null);
            Debug.Assert(workspace != null);

            this.ThreadingContext        = threadingContext;
            this.ServiceProvider         = serviceProvider;
            this.CodeModelService        = languageServices.GetService <ICodeModelService>();
            this.SyntaxFactsService      = languageServices.GetService <ISyntaxFactsService>();
            this.CodeGenerator           = languageServices.GetService <ICodeGenerationService>();
            this.ProjectCodeModelFactory = projectCodeModelFactory;
            this.Workspace = workspace;
        }
コード例 #7
0
        public CodeModelState(
            IThreadingContext threadingContext,
            IServiceProvider serviceProvider,
            HostLanguageServices languageServices,
            VisualStudioWorkspace workspace,
            ProjectCodeModelFactory projectCodeModelFactory)
        {
            Debug.Assert(threadingContext != null);
            Debug.Assert(serviceProvider != null);
            Debug.Assert(languageServices != null);
            Debug.Assert(workspace != null);

            // ⚠ This code runs on the main thread. Language services accessed here should be preloaded in
            // ProjectCodemodelFactory to avoid blocking MEF operations.
            this.ThreadingContext        = threadingContext;
            this.ServiceProvider         = serviceProvider;
            this.CodeModelService        = languageServices.GetService <ICodeModelService>();
            this.SyntaxFactsService      = languageServices.GetService <ISyntaxFactsService>();
            this.CodeGenerator           = languageServices.GetService <ICodeGenerationService>();
            this.ProjectCodeModelFactory = projectCodeModelFactory;
            this.Workspace = workspace;
        }