Example #1
0
        public RazorLanguageEndpoint(
            ForegroundDispatcher foregroundDispatcher,
            DocumentResolver documentResolver,
            DocumentVersionCache documentVersionCache,
            ILoggerFactory loggerFactory)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (documentResolver == null)
            {
                throw new ArgumentNullException(nameof(documentResolver));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _documentResolver     = documentResolver;
            _documentVersionCache = documentVersionCache;
            _logger = loggerFactory.CreateLogger <RazorLanguageEndpoint>();
        }
        public DefaultGeneratedDocumentContainerStore(
            ForegroundDispatcher foregroundDispatcher,
            DocumentVersionCache documentVersionCache,
            GeneratedDocumentPublisher generatedDocumentPublisher)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (generatedDocumentPublisher is null)
            {
                throw new ArgumentNullException(nameof(generatedDocumentPublisher));
            }

            _foregroundDispatcher       = foregroundDispatcher;
            _documentVersionCache       = documentVersionCache;
            _generatedDocumentPublisher = generatedDocumentPublisher;
            _store = new ConcurrentDictionary <string, GeneratedDocumentContainer>(FilePathComparer.Instance);
        }
        public DefaultGeneratedDocumentContainerStore(
            ProjectSnapshotManagerDispatcher projectSnapshotManagerDispatcher,
            DocumentVersionCache documentVersionCache,
            GeneratedDocumentPublisher generatedDocumentPublisher)
        {
            if (projectSnapshotManagerDispatcher is null)
            {
                throw new ArgumentNullException(nameof(projectSnapshotManagerDispatcher));
            }

            if (documentVersionCache is null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (generatedDocumentPublisher is null)
            {
                throw new ArgumentNullException(nameof(generatedDocumentPublisher));
            }

            _projectSnapshotManagerDispatcher = projectSnapshotManagerDispatcher;
            _documentVersionCache             = documentVersionCache;
            _generatedDocumentPublisher       = generatedDocumentPublisher;
            _store = new ConcurrentDictionary <string, ReferenceOutputCapturingContainer>(FilePathComparer.Instance);
        }
        private DefaultRazorProjectService CreateProjectService(
            ProjectResolver projectResolver,
            ProjectSnapshotManagerBase projectSnapshotManager,
            DocumentResolver documentResolver         = null,
            DocumentVersionCache documentVersionCache = null)
        {
            documentVersionCache = documentVersionCache ?? Mock.Of <DocumentVersionCache>();
            var filePathNormalizer = new FilePathNormalizer();
            var accessor           = Mock.Of <ProjectSnapshotManagerAccessor>(a => a.Instance == projectSnapshotManager);

            documentResolver = documentResolver ?? Mock.Of <DocumentResolver>();
            var hostDocumentFactory     = new TestHostDocumentFactory();
            var remoteTextLoaderFactory = Mock.Of <RemoteTextLoaderFactory>(factory => factory.Create(It.IsAny <string>()) == Mock.Of <TextLoader>());
            var projectService          = new DefaultRazorProjectService(
                Dispatcher,
                hostDocumentFactory,
                remoteTextLoaderFactory,
                documentResolver,
                projectResolver,
                documentVersionCache,
                filePathNormalizer,
                accessor,
                LoggerFactory);

            return(projectService);
        }
        public DefaultGeneratedCodeContainerStore(
            ForegroundDispatcher foregroundDispatcher,
            DocumentVersionCache documentVersionCache,
            Lazy <ILanguageServer> server)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (server == null)
            {
                throw new ArgumentNullException(nameof(server));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _documentVersionCache = documentVersionCache;
            _server = server;
            _store  = new ConcurrentDictionary <string, GeneratedCodeContainer>(FilePathComparer.Instance);
        }
 public TestRazorDiagnosticsEndpointWithoutRazorDiagnostic(
     ForegroundDispatcher foregroundDispatcher,
     DocumentResolver documentResolver,
     DocumentVersionCache documentVersionCache,
     RazorDocumentMappingService documentMappingService,
     ILoggerFactory loggerFactory) :
     base(foregroundDispatcher, documentResolver, documentVersionCache, documentMappingService, loggerFactory)
 {
 }
Example #7
0
        public RazorLanguageEndpoint(
            ProjectSnapshotManagerDispatcher projectSnapshotManagerDispatcher,
            DocumentResolver documentResolver,
            DocumentVersionCache documentVersionCache,
            RazorDocumentMappingService documentMappingService,
            RazorFormattingService razorFormattingService,
            ILoggerFactory loggerFactory)
        {
            if (projectSnapshotManagerDispatcher is null)
            {
                throw new ArgumentNullException(nameof(projectSnapshotManagerDispatcher));
            }

            if (documentResolver is null)
            {
                throw new ArgumentNullException(nameof(documentResolver));
            }

            if (documentVersionCache is null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (documentMappingService is null)
            {
                throw new ArgumentNullException(nameof(documentMappingService));
            }

            if (razorFormattingService is null)
            {
                throw new ArgumentNullException(nameof(razorFormattingService));
            }

            if (loggerFactory is null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _projectSnapshotManagerDispatcher = projectSnapshotManagerDispatcher;
            _documentResolver       = documentResolver;
            _documentVersionCache   = documentVersionCache;
            _documentMappingService = documentMappingService;
            _razorFormattingService = razorFormattingService;
            _logger = loggerFactory.CreateLogger <RazorLanguageEndpoint>();
        }
        public BackgroundDocumentGenerator(
            ForegroundDispatcher foregroundDispatcher,
            DocumentVersionCache documentVersionCache,
            IEnumerable <DocumentProcessedListener> documentProcessedListeners,
            ILanguageServer router,
            ILoggerFactory loggerFactory)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (documentProcessedListeners == null)
            {
                throw new ArgumentNullException(nameof(documentProcessedListeners));
            }

            if (router == null)
            {
                throw new ArgumentNullException(nameof(router));
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _foregroundDispatcher       = foregroundDispatcher;
            _documentVersionCache       = documentVersionCache;
            _documentProcessedListeners = documentProcessedListeners;
            _router = router;
            _logger = loggerFactory.CreateLogger <BackgroundDocumentGenerator>();
            _work   = new Dictionary <string, DocumentSnapshot>(StringComparer.Ordinal);
        }
        public UnsynchronizableContentDocumentProcessedListener(
            ForegroundDispatcher foregroundDispatcher,
            DocumentVersionCache documentVersionCache,
            ILanguageServer router)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (router == null)
            {
                throw new ArgumentNullException(nameof(router));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _documentVersionCache = documentVersionCache;
            _router = router;
        }
        public DefaultHostDocumentFactory(
            ForegroundDispatcher foregroundDispatcher,
            DocumentVersionCache documentVersionCache,
            ILanguageServer router)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (router == null)
            {
                throw new ArgumentNullException(nameof(router));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _documentVersionCache = documentVersionCache;
            _router = router;
        }
Example #11
0
        public UnsynchronizableContentDocumentProcessedListener(
            ForegroundDispatcher foregroundDispatcher,
            DocumentVersionCache documentVersionCache,
            CSharpPublisher csharpPublisher)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (csharpPublisher is null)
            {
                throw new ArgumentNullException(nameof(csharpPublisher));
            }

            _foregroundDispatcher = foregroundDispatcher;
            _documentVersionCache = documentVersionCache;
            _csharpPublisher      = csharpPublisher;
        }
Example #12
0
        public UnsynchronizableContentDocumentProcessedListener(
            ProjectSnapshotManagerDispatcher projectSnapshotManagerDispatcher,
            DocumentVersionCache documentVersionCache,
            GeneratedDocumentPublisher generatedDocumentPublisher)
        {
            if (projectSnapshotManagerDispatcher == null)
            {
                throw new ArgumentNullException(nameof(projectSnapshotManagerDispatcher));
            }

            if (documentVersionCache == null)
            {
                throw new ArgumentNullException(nameof(documentVersionCache));
            }

            if (generatedDocumentPublisher is null)
            {
                throw new ArgumentNullException(nameof(generatedDocumentPublisher));
            }

            _projectSnapshotManagerDispatcher = projectSnapshotManagerDispatcher;
            _documentVersionCache             = documentVersionCache;
            _generatedDocumentPublisher       = generatedDocumentPublisher;
        }