Пример #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 VirtualDocumentFactoryBase(
            IContentTypeRegistryService contentTypeRegistry,
            ITextBufferFactoryService textBufferFactory,
            ITextDocumentFactoryService textDocumentFactory,
            FileUriProvider filePathProvider)
        {
            if (contentTypeRegistry is null)
            {
                throw new ArgumentNullException(nameof(contentTypeRegistry));
            }

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

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

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

            ContentTypeRegistry = contentTypeRegistry;

            _textBufferFactory   = textBufferFactory;
            _textDocumentFactory = textDocumentFactory;
            _fileUriProvider     = filePathProvider;
        }
        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>();
        }
Пример #4
0
        public DefaultLSPDocumentSynchronizer(FileUriProvider fileUriProvider)
        {
            if (fileUriProvider is null)
            {
                throw new ArgumentNullException(nameof(fileUriProvider));
            }

            _fileUriProvider         = fileUriProvider;
            _virtualDocumentContexts = new Dictionary <Uri, DocumentContext>();
        }
        public DefaultLSPDocumentFactory(
            FileUriProvider fileUriProvider,
            [ImportMany] IEnumerable <Lazy <VirtualDocumentFactory, IContentTypeMetadata> > virtualBufferFactories)
        {
            if (fileUriProvider is null)
            {
                throw new ArgumentNullException(nameof(fileUriProvider));
            }

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

            _fileUriProvider          = fileUriProvider;
            _virtualDocumentFactories = virtualBufferFactories;
        }