Skip to content

Commit

Permalink
Merge pull request #71098 from CyrusNajmabadi/removeTSAPI
Browse files Browse the repository at this point in the history
Remove dead goto-def/peek/ctrl-click EA impls for TS.  TS is now entirely on LSP for these experiences.
  • Loading branch information
CyrusNajmabadi authored Dec 6, 2023
2 parents 0e267c8 + 8ffa18a commit 85b7e0b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api
{
[Obsolete("TS, remove your implementation of this type now that you're entirely on LSP for go-to-def. Then let us know.", error: false)]
internal interface IVSTypeScriptGoToDefinitionService
{
Task<IEnumerable<IVSTypeScriptNavigableItem>?> FindDefinitionsAsync(Document document, int position, CancellationToken cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.CodeAnalysis.Host;

namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api
{
[Obsolete("TS, remove your implementation of this type now that you're entirely on LSP for go-to-def. Then let us know.", error: false)]
internal interface IVSTypeScriptGoToDefinitionServiceFactoryImplementation
{
IVSTypeScriptGoToDefinitionService? CreateLanguageService(HostLanguageServices languageServices);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public AbstractGoToDefinitionHandler(IMetadataAsSourceFileService metadataAsSour
var locations = ArrayBuilder<LSP.Location>.GetInstance();
var position = await document.GetPositionFromLinePositionAsync(ProtocolConversions.PositionToLinePosition(request.Position), cancellationToken).ConfigureAwait(false);

var service = document.GetRequiredLanguageService<INavigableItemsService>();
var service = document.GetLanguageService<INavigableItemsService>();
if (service is null)
return null;

var definitions = await service.GetNavigableItemsAsync(document, position, cancellationToken).ConfigureAwait(false);
if (definitions.Length > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ internal static class OmniSharpFindDefinitionService
{
internal static async Task<ImmutableArray<OmniSharpNavigableItem>> FindDefinitionsAsync(Document document, int position, CancellationToken cancellationToken)
{
var service = document.GetRequiredLanguageService<INavigableItemsService>();
var service = document.GetLanguageService<INavigableItemsService>();
if (service is null)
return ImmutableArray<OmniSharpNavigableItem>.Empty;

var result = await service.GetNavigableItemsAsync(document, position, cancellationToken).ConfigureAwait(false);
return await result.NullToEmpty().SelectAsArrayAsync(
async (original, solution, cancellationToken) => new OmniSharpNavigableItem(original.DisplayTaggedParts, await original.Document.GetRequiredDocumentAsync(solution, cancellationToken).ConfigureAwait(false), original.SourceSpan),
Expand Down

0 comments on commit 85b7e0b

Please sign in to comment.