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 void Dispose()
 {
     if (_cookie != 0)
     {
         IConnectionPoint connectionPoint = _connectionPoint.Target;
         if (connectionPoint != null)
         {
             connectionPoint.Unadvise(_cookie);
             _cookie = 0;
         }
     }
 }
예제 #5
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);
            }