Example #1
0
            public int OnLoadCompleted(int fReload)
            {
                _cp.Unadvise(_cookie);

                var         adapterService = _compModel.GetService <IVsEditorAdaptersFactoryService>();
                ITextBuffer diskBuffer     = adapterService.GetDocumentBuffer(_textLines);

                var factService = _compModel.GetService <IProjectionBufferFactoryService>();

                var contentRegistry = _compModel.GetService <IContentTypeRegistryService>();

                var bufferTagAggregatorFactory = _compModel.GetService <IBufferTagAggregatorFactoryService>();

                IContentType contentType = SniffContentType(diskBuffer) ??
                                           contentRegistry.GetContentType("HTML");

                var projBuffer = new PhpProjectionBuffer(contentRegistry, factService, bufferTagAggregatorFactory, diskBuffer, _compModel.GetService <IBufferGraphFactoryService>(), contentType);

                diskBuffer.Properties.AddProperty(typeof(PhpProjectionBuffer), projBuffer);

                Guid langSvcGuid = typeof(PhpLanguageInfo).GUID;

                _textLines.SetLanguageServiceID(ref langSvcGuid);

                adapterService.SetDataBuffer(_textLines, projBuffer.ProjectionBuffer);

                IVsTextView view;

                ErrorHandler.ThrowOnFailure(_window.GetPrimaryView(out view));

                if (contentType != null && contentType.IsOfType("HTML"))
                {
                    var editAdapter            = _compModel.GetService <IVsEditorAdaptersFactoryService>();
                    var newView                = editAdapter.GetWpfTextView(view);
                    var intellisenseController = HtmlIntellisenseControllerProvider.GetOrCreateController(_compModel, newView);
                    intellisenseController.AttachKeyboardFilter();
                }

                return(VSConstants.S_OK);
            }
Example #2
0
 public HtmlIntellisenseController(HtmlIntellisenseControllerProvider htmlIntellisenseControlerProvider, ITextView textView)
 {
     _provider = htmlIntellisenseControlerProvider;
     _textView = textView;
 }
 public HtmlIntellisenseController(HtmlIntellisenseControllerProvider htmlIntellisenseControlerProvider, ITextView textView)
 {
     _provider = htmlIntellisenseControlerProvider;
     _textView = textView;
 }