public RazorDirectiveCompletionProvider(
            [Import(typeof(RazorCodeDocumentProvider))] Lazy <RazorCodeDocumentProvider> codeDocumentProvider,
            [Import(typeof(RazorCompletionFactsService))] Lazy <RazorCompletionFactsService> completionFactsService,
            IAsyncCompletionBroker asyncCompletionBroker,
            RazorTextBufferProvider textBufferProvider)
        {
            if (codeDocumentProvider == null)
            {
                throw new ArgumentNullException(nameof(codeDocumentProvider));
            }

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

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

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

            _codeDocumentProvider   = codeDocumentProvider;
            _completionFactsService = completionFactsService;
            _asyncCompletionBroker  = asyncCompletionBroker;
            _textBufferProvider     = textBufferProvider;
        }
 public FailOnGetCompletionsProvider(
     Lazy <RazorCodeDocumentProvider> codeDocumentProvider,
     IAsyncCompletionBroker asyncCompletionBroker,
     RazorTextBufferProvider textBufferProvider,
     bool canGetSnapshotPoint = true)
     : base(codeDocumentProvider, new Lazy <RazorCompletionFactsService>(() => new DefaultRazorCompletionFactsService()), asyncCompletionBroker, textBufferProvider)
 {
     _canGetSnapshotPoint = canGetSnapshotPoint;
 }
 public FailOnGetCompletionsProvider(
     Lazy <RazorCodeDocumentProvider> codeDocumentProvider,
     Lazy <CompletionProviderDependencies> completionProviderDependencies,
     RazorTextBufferProvider textBufferProvider,
     bool canGetSnapshotPoint = true)
     : base(codeDocumentProvider, completionProviderDependencies, textBufferProvider)
 {
     _canGetSnapshotPoint = canGetSnapshotPoint;
 }
예제 #4
0
        // Internal for testing
        internal DefaultCodeDocumentProvider(
            RazorTextBufferProvider bufferProvider,
            TextBufferCodeDocumentProvider codeDocumentProvider)
        {
            if (bufferProvider == null)
            {
                throw new ArgumentNullException(nameof(bufferProvider));
            }

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

            _bufferProvider       = bufferProvider;
            _codeDocumentProvider = codeDocumentProvider;
        }
예제 #5
0
        public DefaultCodeDocumentProvider(
            RazorTextBufferProvider bufferProvider,
            VisualStudioWorkspaceAccessor workspaceAccessor)
        {
            if (bufferProvider == null)
            {
                throw new ArgumentNullException(nameof(bufferProvider));
            }

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

            _bufferProvider       = bufferProvider;
            _codeDocumentProvider = workspaceAccessor.Workspace.Services.GetLanguageServices(RazorLanguage.Name).GetRequiredService <TextBufferCodeDocumentProvider>();
        }
예제 #6
0
        public DefaultCodeDocumentProvider(
            RazorTextBufferProvider bufferProvider,
            [ImportMany] IEnumerable <TextBufferCodeDocumentProvider> codeDocumentProviders)
        {
            if (bufferProvider == null)
            {
                throw new ArgumentNullException(nameof(bufferProvider));
            }

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

            _bufferProvider        = bufferProvider;
            _codeDocumentProviders = codeDocumentProviders;
        }
        public RazorDirectiveCompletionProvider(
            [Import(typeof(RazorCodeDocumentProvider))] Lazy <RazorCodeDocumentProvider> codeDocumentProvider,
            [Import(typeof(CompletionProviderDependencies))] Lazy <CompletionProviderDependencies> dependencies,
            RazorTextBufferProvider textBufferProvider)
        {
            if (codeDocumentProvider == null)
            {
                throw new ArgumentNullException(nameof(codeDocumentProvider));
            }

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

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

            _codeDocumentProvider = codeDocumentProvider;
            _dependencies         = dependencies;
            _textBufferProvider   = textBufferProvider;
        }