提交 831a2e11 编写于 作者: C CyrusNajmabadi

Delete files that are no longer necessary.

上级 85502dbf
......@@ -120,7 +120,6 @@
<Compile Include="Formatting\Indentation\WhitespaceExtensions.cs" />
<Compile Include="Formatting\CSharpEditorFormattingService.PasteFormattingRule.cs" />
<Compile Include="GoToDefinition\CSharpGoToDefinitionService.cs" />
<Compile Include="GoToImplementation\CSharpGoToImplementationService.cs" />
<Compile Include="Highlighting\KeywordHighlighters\AbstractAsyncHighlighter.cs" />
<Compile Include="Highlighting\KeywordHighlighters\AsyncAnonymousMethodHighlighter.cs" />
<Compile Include="Highlighting\KeywordHighlighters\AsyncMethodHighlighter.cs" />
......
#if false
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Composition;
using Microsoft.CodeAnalysis.Editor.GoToImplementation;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Editor.CSharp.GoToImplementation
{
[ExportLanguageService(typeof(IGoToImplementationService), LanguageNames.CSharp), Shared]
internal sealed class CSharpGoToImplementationService : AbstractGoToImplementationService
{
[ImportingConstructor]
public CSharpGoToImplementationService(
[ImportMany]IEnumerable<Lazy<INavigableItemsPresenter>> presenters)
: base(presenters)
{
}
}
}
#endif
\ No newline at end of file
......@@ -261,7 +261,6 @@
<Compile Include="Implementation\Diagnostics\SuggestionAdornmentManagerProvider.cs" />
<Compile Include="Implementation\Diagnostics\SuggestionTag.cs" />
<Compile Include="FindUsages\AbstractFindUsagesService.ProgressAdapter.cs" />
<Compile Include="GoToImplementation\AbstractGoToImplementationService.cs" />
<Compile Include="GoToImplementation\IGoToImplementationService.cs" />
<Compile Include="Implementation\Intellisense\Completion\BraceCompletionMetadata.cs" />
<Compile Include="Implementation\Intellisense\Completion\OptionSetExtensions.cs" />
......
#if false
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.FindUsages;
using Microsoft.CodeAnalysis.Editor.GoToDefinition;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.FindSymbols;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Navigation;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Editor.GoToImplementation
{
internal abstract class AbstractGoToImplementationService : IGoToImplementationService
{
private readonly IEnumerable<Lazy<INavigableItemsPresenter>> _navigableItemPresenters;
public AbstractGoToImplementationService(
IEnumerable<Lazy<INavigableItemsPresenter>> navigableItemPresenters)
{
_navigableItemPresenters = navigableItemPresenters;
}
public bool TryGoToImplementation(Document document, int position, CancellationToken cancellationToken, out string message)
{
var result = FindUsagesHelpers.FindImplementationsAsync(document, position, cancellationToken).WaitAndGetResult(cancellationToken);
if (result == null)
{
message = EditorFeaturesResources.Cannot_navigate_to_the_symbol_under_the_caret;
return false;
}
if (result.Value.message != null)
{
message = result.Value.message;
return false;
}
return TryGoToImplementations(
result.Value.symbol, result.Value.project,
result.Value.implementations, cancellationToken, out message);
}
private bool TryGoToImplementations(
ISymbol symbol, Project project, ImmutableArray<ISymbol> implementations, CancellationToken cancellationToken, out string message)
{
if (implementations.Length == 0)
{
message = EditorFeaturesResources.The_symbol_has_no_implementations;
return false;
}
else if (implementations.Length == 1)
{
GoToDefinitionHelpers.TryGoToDefinition(
implementations.Single(), project, _navigableItemPresenters,
SpecializedCollections.EmptyEnumerable<Lazy<IStreamingFindUsagesPresenter>>(),
cancellationToken);
message = null;
return true;
}
else
{
return TryPresentInNavigableItemsPresenter(symbol, project, implementations, out message);
}
}
private bool TryPresentInNavigableItemsPresenter(
ISymbol symbol, Project project, ImmutableArray<ISymbol> implementations, out string message)
{
// We have multiple symbols, so we'll build a list of all preferred locations for all the symbols
var navigableItems = implementations.SelectMany(
implementation => CreateItemsForImplementation(implementation, project.Solution));
var presenter = _navigableItemPresenters.First();
var taggedParts = NavigableItemFactory.GetSymbolDisplayTaggedParts(project, symbol);
presenter.Value.DisplayResult(taggedParts.JoinText(), navigableItems);
message = null;
return true;
}
private static IEnumerable<INavigableItem> CreateItemsForImplementation(ISymbol implementation, Solution solution)
{
var symbolDisplayService = solution.Workspace.Services.GetLanguageServices(implementation.Language).GetRequiredService<ISymbolDisplayService>();
return NavigableItemFactory.GetItemsFromPreferredSourceLocations(
solution,
implementation,
displayTaggedParts: symbolDisplayService.ToDisplayParts(implementation).ToTaggedText());
}
}
}
#endif
\ No newline at end of file
......@@ -106,7 +106,6 @@
<Compile Include="Formatting\Indentation\SpecialFormattingOperation.vb" />
<Compile Include="Formatting\Indentation\VisualBasicIndentationService.Indenter.vb" />
<Compile Include="Formatting\Indentation\VisualBasicIndentationService.vb" />
<Compile Include="GoToImplementation\VisualBasicGoToImplementationService.vb" />
<Compile Include="GoToDefinition\VisualBasicGoToDefinitionService.vb" />
<Compile Include="Highlighting\KeywordHighlighters\AccessorDeclarationHighlighter.vb" />
<Compile Include="Highlighting\KeywordHighlighters\ConditionalPreprocessorHighlighter.vb" />
......
#If False Then
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Composition
Imports Microsoft.CodeAnalysis.Editor.GoToImplementation
Imports Microsoft.CodeAnalysis.Editor.Host
Imports Microsoft.CodeAnalysis.Host.Mef
Namespace Microsoft.CodeAnalysis.Editor.VisualBasic.GoToImplementation
<ExportLanguageService(GetType(IGoToImplementationService), LanguageNames.VisualBasic), [Shared]>
Friend Class VisualBasicGoToImplementationService
Inherits AbstractGoToImplementationService
<ImportingConstructor>
Public Sub New(<ImportMany> presenters As IEnumerable(Of Lazy(Of INavigableItemsPresenter)))
MyBase.New(presenters)
End Sub
End Class
End Namespace
#end if
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册