提交 b6e30bd8 编写于 作者: Y Youssef Victor

Map between our NavigateToItemKind to VisualStudio's one

上级 3921e0a5
......@@ -220,7 +220,7 @@ private void ReportMatchResult(Project project, INavigateToSearchResult result)
var navigateToItem = new NavigateToItem(
result.Name,
result.Kind,
GetKind(result.Kind),
GetNavigateToLanguage(project.Language),
result.SecondarySort,
result,
......@@ -229,6 +229,48 @@ private void ReportMatchResult(Project project, INavigateToSearchResult result)
_callback.AddItem(navigateToItem);
}
private static string GetKind(string kind)
=> kind switch
{
CodeAnalysis.NavigateTo.NavigateToItemKind.Class
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Class,
CodeAnalysis.NavigateTo.NavigateToItemKind.Constant
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Constant,
CodeAnalysis.NavigateTo.NavigateToItemKind.Delegate
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Delegate,
CodeAnalysis.NavigateTo.NavigateToItemKind.Enum
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Enum,
CodeAnalysis.NavigateTo.NavigateToItemKind.EnumItem
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.EnumItem,
CodeAnalysis.NavigateTo.NavigateToItemKind.Event
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Event,
CodeAnalysis.NavigateTo.NavigateToItemKind.Field
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Field,
CodeAnalysis.NavigateTo.NavigateToItemKind.File
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.File,
CodeAnalysis.NavigateTo.NavigateToItemKind.Interface
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Interface,
CodeAnalysis.NavigateTo.NavigateToItemKind.Line
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Line,
CodeAnalysis.NavigateTo.NavigateToItemKind.Method
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Method,
CodeAnalysis.NavigateTo.NavigateToItemKind.Module
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Module,
CodeAnalysis.NavigateTo.NavigateToItemKind.OtherSymbol
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.OtherSymbol,
CodeAnalysis.NavigateTo.NavigateToItemKind.Property
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Property,
// VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind doesn't have a record, fall back to class.
// This should be updated whenever NavigateToItemKind has a record.
CodeAnalysis.NavigateTo.NavigateToItemKind.Record
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Class,
CodeAnalysis.NavigateTo.NavigateToItemKind.Structure
=> VisualStudio.Language.NavigateTo.Interfaces.NavigateToItemKind.Structure,
_ => throw ExceptionUtilities.UnexpectedValue(kind)
};
private static PatternMatchKind GetPatternMatchKind(NavigateToMatchKind matchKind)
=> matchKind switch
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册