Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions language-server-protocol.sha.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol/commits/gh-pages
lastSha: 1cf527d8410a493789de4992f78ee9874a4fd215
lastSha: a94f201e01fcdc0a308741bf3d46eef1a47fb6b5

https://github.com/Microsoft/language-server-protocol/compare/<lastSha>..gh-pages
https://github.com/Microsoft/language-server-protocol/compare/a94f201e01fcdc0a308741bf3d46eef1a47fb6b5..gh-pages
37 changes: 37 additions & 0 deletions src/JsonRpc/RegistrationNameAttribute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using MediatR;

namespace OmniSharp.Extensions.JsonRpc
{
public class RegistrationNameAttribute : Attribute
{
public string Method { get; }

public RegistrationNameAttribute(string method) => Method = method;

public static RegistrationNameAttribute? From(Type? type) => AllFrom(type).FirstOrDefault();

public static IEnumerable<RegistrationNameAttribute> AllFrom(Type? type) =>
CollectMethodAttributes(type)
.Concat(
type
?.GetInterfaces()
.SelectMany(CollectMethodAttributes)
?? Enumerable.Empty<RegistrationNameAttribute>()
);

private static IEnumerable<RegistrationNameAttribute> CollectMethodAttributes(Type? type)
{
if (type == null) return Enumerable.Empty<RegistrationNameAttribute>();
if (type.IsGenericType && typeof(IRequestHandler<,>) == type.GetGenericTypeDefinition())
{
return type.GetTypeInfo().GetCustomAttributes<RegistrationNameAttribute>(true).Concat(AllFrom(type.GetGenericArguments()[0]));
}

return type.GetTypeInfo().GetCustomAttributes<RegistrationNameAttribute>(true);
}
}
}
9 changes: 9 additions & 0 deletions src/Protocol/Client/Capabilities/DocumentSymbolCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,14 @@ public class DocumentSymbolCapability : DynamicCapability, ConnectedCapability<I
[Obsolete(Constants.Proposal)]
[Optional]
public TagSupportCapabilityOptions? TagSupport { get; set; }

/// <summary>
/// The client supports an additional label presented in the UI when
/// registering a document symbol provider.
///
/// @since 3.16.0
/// </summary>
[Optional]
public bool LabelSupport { get; set; }
}
}
18 changes: 18 additions & 0 deletions src/Protocol/Client/Capabilities/PublishDiagnosticsCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,23 @@ public class PublishDiagnosticsCapability : ICapability
/// </summary>
[Optional]
public bool VersionSupport { get; set; }

/// <summary>
/// Client supports a codeDescription property
///
/// @since 3.16.0 - proposed state
/// </summary>
[Optional]
public bool CodeDescriptionSupport { get; set; }

/// <summary>
/// Whether code action supports the `data` property which is
/// preserved between a `textDocument/publishDiagnostics` and
/// `textDocument/codeAction` request.
///
/// @since 3.16.0 - proposed state
/// </summary>
[Optional]
public bool DataSupport { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;

namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
{
/// <summary>
/// Capabilities specific to the semantic token requests scoped to the
/// workspace.
///
/// @since 3.16.0 - proposed state.
/// </summary>
[Obsolete(Constants.Proposal)]
[CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(WorkspaceClientCapabilities.SemanticTokens))]
public class SemanticTokensWorkspaceCapability : ICapability
{
/// <summary>
/// Whether the client implementation supports a refresh request send from
/// the server to the client. This is useful if a server detects a project
/// wide configuration change which requires a re-calculation of all semantic
/// tokens provided by the server issuing the request.
/// </summary>
[Optional]
public bool RefreshSupport { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ public class WorkspaceClientCapabilities : CapabilitiesBase
/// </summary>
public Supports<ExecuteCommandCapability?> ExecuteCommand { get; set; }

/// <summary>
/// Capabilities specific to the semantic token requests scoped to the
/// workspace.
///
/// @since 3.16.0 - proposed state.
/// </summary>
public Supports<SemanticTokensWorkspaceCapability> SemanticTokens { get; set; }

/// <summary>
/// The client has support for workspace folders.
///
Expand Down
Loading