public int OnLoadCompleted(int fReload)
            {
                _connectionPoint.Unadvise(_cookie);
                _textLines.SetLanguageServiceID(ref _languageServiceId);

                return(VSConstants.S_OK);
            }
示例#2
0
            public int OnLoadCompleted(int fReload)
            {
                ThreadHelper.ThrowIfNotOnUIThread();

                _connectionPoint.Unadvise(_cookie);
                _textLines.SetLanguageServiceID(ref _languageServiceId);

                return(VSConstants.S_OK);
            }
            public int OnLoadCompleted(int fReload)
            {
                _connectionPoint.Unadvise(_cookie);

                Guid languageServiceId = typeof(MarkdownLanguageInfo).GUID;

                _textLines.SetLanguageServiceID(ref languageServiceId);

                return(VSConstants.S_OK);
            }
示例#4
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);
            }