Remove InferredXmlCompletionSource for now.
This commit is contained in:
Родитель
908be6f1aa
Коммит
d09c0ca405
|
@ -27,23 +27,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.ComponentModel.Composition;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
|
||||
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data;
|
||||
using Microsoft.VisualStudio.Text.Editor;
|
||||
using Microsoft.VisualStudio.Utilities;
|
||||
using MonoDevelop.Xml.Dom;
|
||||
|
||||
namespace MonoDevelop.Xml.Editor.Completion
|
||||
{
|
||||
//[Export (typeof (IAsyncCompletionSourceProvider))]
|
||||
//[ContentType (XmlContentTypeNames.XmlCore)]
|
||||
//[Name ("Xml completion item source")]
|
||||
class InferredXmlCompletionProvider : IXmlCompletionProvider, IAsyncCompletionSourceProvider
|
||||
class InferredXmlCompletionProvider : IXmlCompletionProvider
|
||||
{
|
||||
XmlCompletionSource source;
|
||||
Dictionary<string, HashSet<string>> elementCompletions = new Dictionary<string, HashSet<string>> ();
|
||||
Dictionary<string, HashSet<string>> attributeCompletions = new Dictionary<string, HashSet<string>> ();
|
||||
|
||||
|
@ -90,12 +83,12 @@ namespace MonoDevelop.Xml.Editor.Completion
|
|||
|
||||
public Task<CompletionContext> GetChildElementCompletionDataAsync (IAsyncCompletionSource source, XmlElementPath path, CancellationToken token)
|
||||
{
|
||||
return GetCompletionsAsync (source, elementCompletions, path);
|
||||
return GetCompletions (source, elementCompletions, path);
|
||||
}
|
||||
|
||||
public Task<CompletionContext> GetAttributeCompletionDataAsync (IAsyncCompletionSource source, XmlElementPath path, CancellationToken token)
|
||||
{
|
||||
return GetCompletionsAsync (source, attributeCompletions, path);
|
||||
return GetCompletions (source, attributeCompletions, path);
|
||||
}
|
||||
|
||||
public Task<CompletionContext> GetAttributeValueCompletionDataAsync (IAsyncCompletionSource source, XmlElementPath path, string name, CancellationToken token)
|
||||
|
@ -105,12 +98,12 @@ namespace MonoDevelop.Xml.Editor.Completion
|
|||
|
||||
public Task<CompletionContext> GetChildElementCompletionDataAsync (IAsyncCompletionSource source, string tagName, CancellationToken token)
|
||||
{
|
||||
return GetCompletionsAsync (source, elementCompletions, tagName);
|
||||
return GetCompletions (source, elementCompletions, tagName);
|
||||
}
|
||||
|
||||
public Task<CompletionContext> GetAttributeCompletionDataAsync (IAsyncCompletionSource source, string tagName, CancellationToken token)
|
||||
{
|
||||
return GetCompletionsAsync (source, attributeCompletions, tagName);
|
||||
return GetCompletions (source, attributeCompletions, tagName);
|
||||
}
|
||||
|
||||
public Task<CompletionContext> GetAttributeValueCompletionDataAsync (IAsyncCompletionSource source, string tagName, string name, CancellationToken token)
|
||||
|
@ -118,7 +111,7 @@ namespace MonoDevelop.Xml.Editor.Completion
|
|||
return Task.FromResult (CompletionContext.Empty);
|
||||
}
|
||||
|
||||
static Task<CompletionContext> GetCompletionsAsync (IAsyncCompletionSource source, Dictionary<string, HashSet<string>> map, string tagName)
|
||||
static Task<CompletionContext> GetCompletions (IAsyncCompletionSource source, Dictionary<string, HashSet<string>> map, string tagName)
|
||||
{
|
||||
var items = ImmutableArray<CompletionItem>.Empty;
|
||||
HashSet<string> values;
|
||||
|
@ -129,17 +122,11 @@ namespace MonoDevelop.Xml.Editor.Completion
|
|||
return Task.FromResult (context);
|
||||
}
|
||||
|
||||
static Task<CompletionContext> GetCompletionsAsync (IAsyncCompletionSource source, Dictionary<string, HashSet<string>> map, XmlElementPath path)
|
||||
static Task<CompletionContext> GetCompletions (IAsyncCompletionSource source, Dictionary<string, HashSet<string>> map, XmlElementPath path)
|
||||
{
|
||||
if (path == null || path.Elements.Count == 0)
|
||||
return Task.FromResult (CompletionContext.Empty);
|
||||
return GetCompletionsAsync (source, map, path.Elements[path.Elements.Count - 1].Name);
|
||||
}
|
||||
|
||||
public IAsyncCompletionSource GetOrCreate (ITextView textView)
|
||||
{
|
||||
source = new InferredXmlCompletionSource (textView);
|
||||
return source;
|
||||
return GetCompletions (source, map, path.Elements[path.Elements.Count - 1].Name);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.VisualStudio.Text.Editor;
|
||||
|
||||
namespace MonoDevelop.Xml.Editor.Completion
|
||||
{
|
||||
public class InferredXmlCompletionSource : XmlCompletionSource
|
||||
{
|
||||
public InferredXmlCompletionSource (ITextView textView)
|
||||
: base(textView)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче