public void VsTextViewCreated(IVsTextView textViewAdapter)
        {
            IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter);

            view.TextBuffer.Properties.GetOrCreateSingletonProperty(() => view);
            _errorList = view.TextBuffer.Properties.GetOrCreateSingletonProperty(() => new ErrorListProvider(ServiceProvider));

            if (_errorList == null)
                return;

            if (ExtensibilityToolsPackage.Options.PkgdefShowIntellisense)
            {

                PkgdefCompletionController completion = new PkgdefCompletionController(view, CompletionBroker);
                IOleCommandTarget completionNext;
                textViewAdapter.AddCommandFilter(completion, out completionNext);
                completion.Next = completionNext;
            }

            PkgdefFormatter formatter = new PkgdefFormatter(view);
            IOleCommandTarget formatterNext;
            textViewAdapter.AddCommandFilter(formatter, out formatterNext);
            formatter.Next = formatterNext;

            view.Closed += OnViewClosed;
        }
Пример #2
0
        public void VsTextViewCreated(IVsTextView textViewAdapter)
        {
            IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter);

            view.TextBuffer.Properties.GetOrCreateSingletonProperty(() => view);
            _errorList = view.TextBuffer.Properties.GetOrCreateSingletonProperty(() => new ErrorListProvider(ServiceProvider));

            if (_errorList == null)
            {
                return;
            }

            if (ExtensibilityToolsPackage.Options.PkgdefShowIntellisense)
            {
                PkgdefCompletionController completion = new PkgdefCompletionController(view, CompletionBroker);
                IOleCommandTarget          completionNext;
                textViewAdapter.AddCommandFilter(completion, out completionNext);
                completion.Next = completionNext;
            }

            PkgdefFormatter   formatter = new PkgdefFormatter(view);
            IOleCommandTarget formatterNext;

            textViewAdapter.AddCommandFilter(formatter, out formatterNext);
            formatter.Next = formatterNext;

            view.Closed += OnViewClosed;
        }