예제 #1
0
        public DefaultLSPDocumentManager(
            JoinableTaskContext joinableTaskContext,
            FileUriProvider fileUriProvider,
            LSPDocumentFactory documentFactory,
            [ImportMany] IEnumerable <LSPDocumentManagerChangeTrigger> changeTriggers)
        {
            if (joinableTaskContext is null)
            {
                throw new ArgumentNullException(nameof(joinableTaskContext));
            }

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

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

            _joinableTaskContext = joinableTaskContext;
            _fileUriProvider     = fileUriProvider;
            _documentFactory     = documentFactory;
            _documents           = new ConcurrentDictionary <Uri, LSPDocument>();

            foreach (var trigger in changeTriggers)
            {
                trigger.Initialize(this);
            }
        }
        public DefaultLSPDocumentManager(
            JoinableTaskContext joinableTaskContext,
            FileUriProvider fileUriProvider,
            LSPDocumentFactory documentFactory,
            [ImportMany] IEnumerable <Lazy <LSPDocumentChangeListener, IContentTypeMetadata> > documentManagerChangeListeners)
        {
            if (joinableTaskContext is null)
            {
                throw new ArgumentNullException(nameof(joinableTaskContext));
            }

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

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

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

            _joinableTaskContext            = joinableTaskContext;
            _fileUriProvider                = fileUriProvider;
            _documentFactory                = documentFactory;
            _documentManagerChangeListeners = documentManagerChangeListeners;
            _documents = new ConcurrentDictionary <Uri, LSPDocument>();
        }