提交 79a476bc 编写于 作者: I Ivan Basov

Helpers for intellicode items

上级 e8935509
......@@ -4,6 +4,8 @@
using Microsoft.VisualStudio.Text;
using AsyncCompletionData = Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data;
using RoslynTrigger = Microsoft.CodeAnalysis.Completion.CompletionTrigger;
using RoslynCompletionItem = Microsoft.CodeAnalysis.Completion.CompletionItem;
using VSCompletionItem = Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data.CompletionItem;
namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.AsyncCompletion
{
......@@ -63,7 +65,7 @@ internal static CompletionFilterReason GetFilterReason(AsyncCompletionData.Compl
}
}
internal static bool IsFilterCharacter(CompletionItem item, char ch, string textTypedSoFar)
internal static bool IsFilterCharacter(RoslynCompletionItem item, char ch, string textTypedSoFar)
{
// First see if the item has any specific filter rules it wants followed.
foreach (var rule in item.Rules.FilterCharacterRules)
......@@ -97,5 +99,15 @@ internal static bool IsFilterCharacter(CompletionItem item, char ch, string text
return false;
}
// This is a temporarily method to support preferrrence of IntelliCode items comparing to non-IntelliCode items.
// We expect that Editor will intorduce this support and we will get rid of relying on the "★" then.
internal static bool IsPreferredItem(this RoslynCompletionItem completionItem)
=> completionItem.DisplayText.StartsWith("★");
// This is a temporarily method to support preferrrence of IntelliCode items comparing to non-IntelliCode items.
// We expect that Editor will intorduce this support and we will get rid of relying on the "★" then.
internal static bool IsPreferredItem(this VSCompletionItem completionItem)
=> completionItem.DisplayText.StartsWith("★");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册