Beispiel #1
0
        public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer)
        {
            ICompletionSource completionSource;

            textBuffer.Properties.TryGetProperty(typeof(ICompletionSource), out completionSource);

            if (completionSource != null)
            {
                return(completionSource);
            }

            ITextDocument textDocument;

            textBuffer.Properties.TryGetProperty(typeof(ITextDocument), out textDocument);

            completionSource = RuntimeLoader.CreateCompletionSource(textDocument.FilePath, _serviceProvider, textBuffer);
            textBuffer.Properties.AddProperty(typeof(ICompletionSource), completionSource);

            return(completionSource);
        }