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

            _workspaceAccessor = workspaceAccessor;
        }
示例#2
0
        public RazorTextViewConnectionListener(VisualStudioWorkspaceAccessor workspaceAccessor)
        {
            if (workspaceAccessor == null)
            {
                throw new ArgumentNullException(nameof(workspaceAccessor));
            }

            _foregroundDispatcher = workspaceAccessor.Workspace.Services.GetRequiredService <ForegroundDispatcher>();

            var languageServices = workspaceAccessor.Workspace.Services.GetLanguageServices(RazorLanguage.Name);

            _documentManager = languageServices.GetRequiredService <RazorDocumentManager>();
        }
        public DefaultRazorEditorFactoryService(VisualStudioWorkspaceAccessor workspaceAccessor)
        {
            if (workspaceAccessor == null)
            {
                throw new ArgumentNullException(nameof(workspaceAccessor));
            }

            var razorLanguageServices = workspaceAccessor.Workspace.Services.GetLanguageServices(RazorLanguage.Name);

            _documentTrackerFactory    = razorLanguageServices.GetRequiredService <VisualStudioDocumentTrackerFactory>();
            _parserFactory             = razorLanguageServices.GetRequiredService <VisualStudioRazorParserFactory>();
            _braceSmartIndenterFactory = razorLanguageServices.GetRequiredService <BraceSmartIndenterFactory>();
        }
示例#4
0
        public RazorDirectiveCompletionProvider(VisualStudioWorkspaceAccessor workspaceAccessor)
        {
            if (workspaceAccessor == null)
            {
                throw new ArgumentNullException(nameof(workspaceAccessor));
            }

            // Lazy because we don't want Microsoft.AspNetCore.Razor.Language assembly getting loaded for non Razor scenarios.
            _codeDocumentProvider = new Lazy <RazorCodeDocumentProvider>(() =>
            {
                var languageServices = workspaceAccessor.Workspace.Services.GetLanguageServices(RazorLanguage.Name);
                return(languageServices.GetRequiredService <RazorCodeDocumentProvider>());
            });
        }
示例#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 RazorTextViewConnectionListener(
            VisualStudioWorkspaceAccessor workspaceAccessor,
            RazorDocumentManager documentManager)
        {
            if (workspaceAccessor == null)
            {
                throw new ArgumentNullException(nameof(workspaceAccessor));
            }

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

            _documentManager      = documentManager;
            _foregroundDispatcher = workspaceAccessor.Workspace.Services.GetRequiredService <ForegroundDispatcher>();
        }
        public DefaultRazorDocumentManager(
            RazorEditorFactoryService editorFactoryService,
            TextBufferProjectService projectService,
            VisualStudioWorkspaceAccessor workspaceAccessor)
        {
            if (editorFactoryService == null)
            {
                throw new ArgumentNullException(nameof(editorFactoryService));
            }

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

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

            _editorFactoryService = editorFactoryService;
            _projectService       = projectService;
            _foregroundDispatcher = workspaceAccessor.Workspace.Services.GetRequiredService <ForegroundDispatcher>();
        }
示例#8
0
        public DefaultTagHelperCompletionService(VisualStudioWorkspaceAccessor workspaceAccessor)
        {
            var razorLanguageServices = workspaceAccessor.Workspace.Services.GetLanguageServices(RazorLanguage.Name);

            _tagHelperFactsService = razorLanguageServices.GetRequiredService <TagHelperFactsServiceInternal>();
        }
示例#9
0
        public DefaultEditorSettingsManager(VisualStudioWorkspaceAccessor workspaceAccessor)
        {
            var razorLanguageServices = workspaceAccessor.Workspace.Services.GetLanguageServices(RazorLanguage.Name);

            _editorSettingsManager = razorLanguageServices.GetRequiredService <EditorSettingsManagerInternal>();
        }