Skip to content

Commit

Permalink
merged with latest changes, renamed DocumentSymbolInformationOrDocume…
Browse files Browse the repository at this point in the history
…ntSymbol
  • Loading branch information
david-driscoll committed Mar 14, 2019
1 parent 36b84cf commit fa32c0c
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 41 deletions.
4 changes: 2 additions & 2 deletions src/Protocol/Document/Client/DocumentSymbolExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Client
{
public static class DocumentSymbolExtensions
{
public static Task<DocumentSymbolInformationOrDocumentSymbolContainer> DocumentSymbol(this ILanguageClientDocument mediator, DocumentSymbolParams @params)
public static Task<SymbolInformationOrDocumentSymbolContainer> DocumentSymbol(this ILanguageClientDocument mediator, DocumentSymbolParams @params)
{
return mediator.SendRequest<DocumentSymbolParams, DocumentSymbolInformationOrDocumentSymbolContainer>(DocumentNames.DocumentSymbol, @params);
return mediator.SendRequest<DocumentSymbolParams, SymbolInformationOrDocumentSymbolContainer>(DocumentNames.DocumentSymbol, @params);
}
}
}
2 changes: 1 addition & 1 deletion src/Protocol/Document/Server/IDocumentSymbolHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ namespace OmniSharp.Extensions.LanguageServer.Protocol.Server
{
using static DocumentNames;
[Parallel, Method(DocumentSymbol)]
public interface IDocumentSymbolHandler : IJsonRpcRequestHandler<DocumentSymbolParams, DocumentSymbolInformationOrDocumentSymbolContainer>, IRegistration<TextDocumentRegistrationOptions>, ICapability<DocumentSymbolCapability> { }
public interface IDocumentSymbolHandler : IJsonRpcRequestHandler<DocumentSymbolParams, SymbolInformationOrDocumentSymbolContainer>, IRegistration<TextDocumentRegistrationOptions>, ICapability<DocumentSymbolCapability> { }
}

This file was deleted.

2 changes: 1 addition & 1 deletion src/Protocol/Models/DocumentSymbolParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
{
public class DocumentSymbolParams : ITextDocumentIdentifierParams, IRequest<DocumentSymbolInformationOrDocumentSymbolContainer>
public class DocumentSymbolParams : ITextDocumentIdentifierParams, IRequest<SymbolInformationOrDocumentSymbolContainer>
{
/// <summary>
/// The text document.
Expand Down
36 changes: 36 additions & 0 deletions src/Protocol/Models/SymbolInformationOrDocumentSymbolContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;

namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
{
public class SymbolInformationOrDocumentSymbolContainer : Container<SymbolInformationOrDocumentSymbol>
{
public SymbolInformationOrDocumentSymbolContainer() : this(Enumerable.Empty<SymbolInformationOrDocumentSymbol>())
{
}

public SymbolInformationOrDocumentSymbolContainer(IEnumerable<SymbolInformationOrDocumentSymbol> items) : base(items)
{
}

public SymbolInformationOrDocumentSymbolContainer(params SymbolInformationOrDocumentSymbol[] items) : base(items)
{
}

public static implicit operator SymbolInformationOrDocumentSymbolContainer(SymbolInformationOrDocumentSymbol[] items)
{
return new SymbolInformationOrDocumentSymbolContainer(items);
}

public static implicit operator SymbolInformationOrDocumentSymbolContainer(Collection<SymbolInformationOrDocumentSymbol> items)
{
return new SymbolInformationOrDocumentSymbolContainer(items);
}

public static implicit operator SymbolInformationOrDocumentSymbolContainer(List<SymbolInformationOrDocumentSymbol> items)
{
return new SymbolInformationOrDocumentSymbolContainer(items);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ public override CommandOrCodeAction ReadJson(JsonReader reader, Type objectType,

public override bool CanRead => true;
}
//DocumentSymbolInformationOrDocumentSymbolConverter
}

0 comments on commit fa32c0c

Please sign in to comment.