Exemple #1
0
        public void VsTextViewCreated(IVsTextView textViewAdapter)
        {
            IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter);

            Debug.Assert(view != null);

            ITextDocument document;

            if (!TextDocumentFactoryService.TryGetTextDocument(view.TextDataModel.DocumentBuffer, out document))
            {
                return;
            }

            if (!PaketDependenciesClassifierProvider.IsPaketReferencesFile(document.FilePath))
            {
                return;
            }

            CommandFilter filter = new CommandFilter(view, CompletionBroker);

            IOleCommandTarget next;

            ErrorHandler.ThrowOnFailure(textViewAdapter.AddCommandFilter(filter, out next));
            filter.Next = next;
        }
Exemple #2
0
        public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer)
        {
            string filename = System.IO.Path.GetFileName(textBuffer.GetFileName());

            if (PaketDependenciesClassifierProvider.IsPaketReferencesFile(filename))
            {
                return(new PaketReferencesFileCompletionSource(glyphService, textBuffer, NavigatorService.GetTextStructureNavigator(textBuffer)));
            }

            return(null);
        }