提交 beaa2a63 编写于 作者: C CyrusNajmabadi

Moving hte Glyph enum back to the 'Features' dll.

上级 ac53ab13
......@@ -259,7 +259,9 @@ void IDisposable.Dispose()
// same as display text
string ISuggestedAction.IconAutomationText => DisplayText;
ImageMoniker ISuggestedAction.IconMoniker => CodeAction.Glyph?.GetImageMoniker() ?? default(ImageMoniker);
ImageMoniker ISuggestedAction.IconMoniker => CodeAction.Glyph.HasValue
? ((Glyph)CodeAction.Glyph.Value).GetImageMoniker()
: default(ImageMoniker);
string ISuggestedAction.InputGestureText
{
......
......@@ -391,7 +391,7 @@ private class MyCodeAction : CodeAction.SolutionChangeAction
_glyph = glyph;
}
internal override Glyph? Glyph => _glyph;
internal override int? Glyph => _glyph.HasValue ? (int)_glyph.Value : (int?)null;
}
private struct SearchResult<T> where T : ISymbol
......
......@@ -147,6 +147,7 @@
<Compile Include="CodeRefactorings\PredefinedCodeRefactoringProviderNames.cs" />
<Compile Include="CodeRefactorings\ServicesLayerCodeActionHelpersService.cs" />
<Compile Include="CodeRefactorings\WorkspaceServices\IAddMetadataReferenceCodeActionOperationFactoryWorkspaceService.cs" />
<Compile Include="Common\Glyph.cs" />
<Compile Include="Completion\AbstractCompletionService.cs" />
<Compile Include="Completion\CommonCompletionUtilities.cs" />
<Compile Include="Completion\CompletionFilterReason.cs" />
......@@ -253,6 +254,7 @@
<Compile Include="RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsService.cs" />
<Compile Include="ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs" />
<Compile Include="ReplaceMethodWithProperty\IReplaceMethodWithPropertyService.cs" />
<Compile Include="Shared\Extensions\ProjectExtensions.cs" />
<Compile Include="Shared\Options\OrganizerOptionsProvider.cs" />
<Compile Include="Shared\Options\RuntimeOptions.cs" />
<Compile Include="Shared\Options\RuntimeOptionsProvider.cs" />
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.CodeAnalysis.Shared.Extensions
{
internal static class ProjectExtensions
{
public static Glyph GetGlyph(this Project project)
{
// TODO: Get the glyph from the hierarchy
return project.Language == LanguageNames.CSharp ? Glyph.CSharpProject :
project.Language == LanguageNames.VisualBasic ? Glyph.BasicProject :
Glyph.Assembly;
}
}
}
......@@ -47,7 +47,11 @@ public abstract class CodeAction
internal virtual bool IsInvokable => true;
internal virtual Glyph? Glyph => null;
/// <summary>
/// Will map this int to the Glyph enum in 'Features'. Once a proper image abstration moves
/// to the workspace layer we can appropriately use that here instead of a raw int.
/// </summary>
internal virtual int? Glyph => null;
internal virtual ImmutableArray<CodeAction> GetCodeActions()
{
......
......@@ -38,13 +38,5 @@ public static async Task<VersionStamp> GetVersionAsync(this Project project, Can
return version.GetNewerVersion(latestVersion);
}
public static Glyph GetGlyph(this Project project)
{
// TODO: Get the glyph from the hierarchy
return project.Language == LanguageNames.CSharp ? Glyph.CSharpProject :
project.Language == LanguageNames.VisualBasic ? Glyph.BasicProject :
Glyph.Assembly;
}
}
}
\ No newline at end of file
......@@ -385,7 +385,6 @@
<Compile Include="FindSymbols\FindReferences\Finders\ILanguageServiceReferenceFinder.cs" />
<Compile Include="FindSymbols\SymbolTree\ISymbolTreeInfoCacheService.cs" />
<Compile Include="FindSymbols\FindReferences\MetadataUnifyingEquivalenceComparer.cs" />
<Compile Include="Shared\Glyph.cs" />
<Compile Include="Utilities\ArraySlice.cs" />
<Compile Include="Utilities\BKTree.cs" />
<Compile Include="FindSymbols\SyntaxTree\AbstractSyntaxTreeInfo.cs" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册