Пример #1
0
        public int GetTextViewFilter(IVsIntellisenseHost pISenseHost, IOleCommandTarget pNextCmdTarget, out IVsTextViewFilter pTextViewFilter)
        {
            IVsTextLines buffer;

            ErrorHandler.ThrowOnFailure(bufferCoordinator.GetSecondaryBuffer(out buffer));
            bool doOutlining = LanguageService.Preferences.AutoOutlining;

            LanguageService.Preferences.AutoOutlining = false;
            PythonSource source = LanguageService.CreateSource(buffer) as PythonSource;

            LanguageService.Preferences.AutoOutlining = doOutlining;
            CodeWindowManager windowMgr = LanguageService.CreateCodeWindowManager(null, source);

            language.AddCodeWindowManager(windowMgr);
            TextViewWrapper view = new TextViewWrapper(languageHost, pISenseHost, bufferCoordinator, pNextCmdTarget);

            windowMgr.OnNewView(view);
            language.AddSpecialSource(source, view);
            pTextViewFilter = view.InstalledFilter;
            PythonViewFilter pythonFilter = pTextViewFilter as PythonViewFilter;

            if (null != pythonFilter)
            {
                pythonFilter.BufferCoordinator = this.bufferCoordinator;
            }
            return(VSConstants.S_OK);
        }
 public int GetTextViewFilter(IVsIntellisenseHost pISenseHost, IOleCommandTarget pNextCmdTarget, out IVsTextViewFilter pTextViewFilter)
 {
     IVsTextLines buffer;
     ErrorHandler.ThrowOnFailure(bufferCoordinator.GetSecondaryBuffer(out buffer));
     bool doOutlining = LanguageService.Preferences.AutoOutlining;
     LanguageService.Preferences.AutoOutlining = false;
     PythonSource source = LanguageService.CreateSource(buffer) as PythonSource;
     LanguageService.Preferences.AutoOutlining = doOutlining;
     CodeWindowManager windowMgr = LanguageService.CreateCodeWindowManager(null, source);
     language.AddCodeWindowManager(windowMgr);
     TextViewWrapper view = new TextViewWrapper(languageHost, pISenseHost, bufferCoordinator, pNextCmdTarget);
     windowMgr.OnNewView(view);
     language.AddSpecialSource(source, view);
     pTextViewFilter = view.InstalledFilter;
     PythonViewFilter pythonFilter = pTextViewFilter as PythonViewFilter;
     if (null != pythonFilter) {
         pythonFilter.BufferCoordinator = this.bufferCoordinator;
     }
     return VSConstants.S_OK;
 }
 public override void Init(IVsTextView textView, Declarations declarations, bool completeWord)
 {
     view = textView as TextViewWrapper;
     base.Init(textView, declarations, completeWord);
 }