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: 0e116448e3b3f4ce0b983768c045dba0a41b6a72
lastSha: ed36538a180f15d33ffb03365fba4ace47b42d68

https://github.com/Microsoft/language-server-protocol/compare/0e116448e3b3f4ce0b983768c045dba0a41b6a72..gh-pages
https://github.com/Microsoft/language-server-protocol/compare/ed36538a180f15d33ffb03365fba4ace47b42d68..gh-pages
2 changes: 1 addition & 1 deletion src/Client/LanguageClientServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ internal static IContainer AddLanguageClientInternals(this IContainer container,
var providedConfiguration = options.Services.FirstOrDefault(z => z.ServiceType == typeof(IConfiguration) && z.ImplementationInstance is IConfiguration);
container.RegisterDelegate<IConfiguration>(
_ => {
var builder = new ConfigurationBuilder();
var builder = options.ConfigurationBuilder;
var outerConfiguration = outerServiceProvider?.GetService<IConfiguration>();
if (outerConfiguration != null)
{
Expand Down
1 change: 1 addition & 0 deletions src/Dap.Protocol/Serialization/DapContractResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ protected override JsonProperty CreateProperty(MemberInfo member, MemberSerializ
)
{
property.NullValueHandling = NullValueHandling.Ignore;
property.DefaultValueHandling = DefaultValueHandling.Ignore;
}

return property;
Expand Down
10 changes: 5 additions & 5 deletions src/JsonRpc.Generators/Contexts/JsonRpcAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ HashSet<string> additionalUsings
var attribute = interfaceType.GetAttributes().First(z => z.AttributeClass?.Name == "MethodAttribute");
if (attribute.ConstructorArguments.Length < 2)
{
cacheDiagnostic( static c => Diagnostic.Create(GeneratorDiagnostics.MissingDirection, c.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation()));
cacheDiagnostic(static c => Diagnostic.Create(GeneratorDiagnostics.MissingDirection, c.AttributeLists.GetAttribute("GenerateHandlerMethods")?.GetLocation()));
yield break;
}

Expand Down Expand Up @@ -344,10 +344,10 @@ public static string GetRequestMethodName(TypeDeclarationSyntax syntax, INamedTy
if (
name.StartsWith("Run")
|| name.StartsWith("Execute")
// TODO: Change this next breaking change
// || name.StartsWith("Set")
// || name.StartsWith("Attach")
// || name.StartsWith("Read")
|| name.StartsWith("Set")
|| name.StartsWith("Attach")
|| name.StartsWith("Launch")
|| name.StartsWith("Read")
|| name.StartsWith("Did")
|| name.StartsWith("Log")
|| name.StartsWith("Show")
Expand Down
1 change: 0 additions & 1 deletion src/JsonRpc.Generators/RegistrationOptionsGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ ReportCacheDiagnostic<TypeDeclarationSyntax> cacheDiagnostic
var textDocumentRegistrationOptionsInterfaceSymbol =
compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.ITextDocumentRegistrationOptions")!;
var workDoneProgressOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IWorkDoneProgressOptions")!;
// TODO:
var staticRegistrationOptionsInterfaceSymbol = compilation.GetTypeByMetadataName("OmniSharp.Extensions.LanguageServer.Protocol.Models.IStaticRegistrationOptions")!;

foreach (var registrationOptions in syntaxReceiver.RegistrationOptions)
Expand Down
20 changes: 4 additions & 16 deletions src/Protocol/Client/Capabilities/ClientCapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,12 @@ public class GeneralClientCapabilities
/// </summary>
[Optional]
public RegularExpressionsClientCapabilities? RegularExpressions { get; set; }
}

/// <summary>
/// Client capabilities specific to regular expressions.
///
/// @since 3.16.0 - proposed state
/// </summary>
public class RegularExpressionsClientCapabilities
{
/// <summary>
/// The engine's name.
/// </summary>
public string Engine { get; set; } = null!;

/// <summary>
/// The engine's version.
/// Client capabilities specific to the client's markdown parser.
///
/// @since 3.16.0 - proposed state
/// </summary>
[Optional]
public string? Version { get; set; }
[Optional] public MarkdownClientCapabilities? Markdown { get; set; }
}
}
23 changes: 23 additions & 0 deletions src/Protocol/Client/Capabilities/MarkdownClientCapabilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;

namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
{
/// <summary>
/// Client capabilities specific to the used markdown parser.
///
/// @since 3.16.0 - proposed state
/// </summary>
public record MarkdownClientCapabilities
{
/// <summary>
/// The name of the parser.
/// </summary>
public string Parser { get; set; }

/// <summary>
/// The version of the parser.
/// </summary>
[Optional]
public string? Version { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;

namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
{
/// <summary>
/// Client capabilities specific to regular expressions.
///
/// @since 3.16.0 - proposed state
/// </summary>
public class RegularExpressionsClientCapabilities
{
/// <summary>
/// The engine's name.
/// </summary>
public string Engine { get; set; } = null!;

/// <summary>
/// The engine's version.
/// </summary>
[Optional]
public string? Version { get; set; }
}
}
9 changes: 9 additions & 0 deletions src/Protocol/Client/Capabilities/WorkspaceEditCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,14 @@ public class WorkspaceEditCapability : ICapability
/// </summary>
[Optional]
public bool NormalizesLineEndings { get; set; }

/// <summary>
/// Whether the client in general supports change annotations on text edits,
/// create file, rename file and delete file changes.
///
/// @since 3.16.0 - proposed state
/// </summary>
[Optional]
public bool ChangeAnnotationSupport { get; set; }
}
}
189 changes: 101 additions & 88 deletions src/Protocol/Features/Document/CodeActionFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ public partial class CodeActionRegistrationOptions : IWorkDoneProgressOptions, I
///
/// @since 3.16.0
/// </summary>
[Optional]
public bool ResolveProvider { get; set; }

class CodeActionRegistrationOptionsConverter : RegistrationOptionsConverterBase<CodeActionRegistrationOptions, StaticOptions>
Expand All @@ -324,113 +325,113 @@ public override StaticOptions Convert(CodeActionRegistrationOptions source)
}
}

/// <summary>
/// A set of predefined code action kinds
/// </summary>
[DebuggerDisplay("{" + nameof(_value) + "}")]
[JsonConverter(typeof(EnumLikeStringConverter))]
public readonly struct CodeActionKind : IEquatable<CodeActionKind>, IEnumLikeString
{
private static readonly Lazy<IReadOnlyList<CodeActionKind>> _defaults =
new Lazy<IReadOnlyList<CodeActionKind>>(
() => {
return typeof(CodeActionKind)
.GetFields(BindingFlags.Static | BindingFlags.Public)
.Select(z => z.GetValue(null))
.Cast<CodeActionKind>()
.ToArray();
}
);

public static IEnumerable<CodeActionKind> Defaults => _defaults.Value;

/// <summary>
/// Base kind for quickfix actions: ''
/// A set of predefined code action kinds
/// </summary>
public static readonly CodeActionKind Empty = new CodeActionKind("");
[DebuggerDisplay("{" + nameof(_value) + "}")]
[JsonConverter(typeof(EnumLikeStringConverter))]
public readonly struct CodeActionKind : IEquatable<CodeActionKind>, IEnumLikeString
{
private static readonly Lazy<IReadOnlyList<CodeActionKind>> _defaults =
new Lazy<IReadOnlyList<CodeActionKind>>(
() => {
return typeof(CodeActionKind)
.GetFields(BindingFlags.Static | BindingFlags.Public)
.Select(z => z.GetValue(null))
.Cast<CodeActionKind>()
.ToArray();
}
);

public static IEnumerable<CodeActionKind> Defaults => _defaults.Value;

/// <summary>
/// Base kind for quickfix actions: 'quickfix'
/// </summary>
public static readonly CodeActionKind QuickFix = new CodeActionKind("quickfix");
/// <summary>
/// Base kind for quickfix actions: ''
/// </summary>
public static readonly CodeActionKind Empty = new CodeActionKind("");

/// <summary>
/// Base kind for refactoring actions: 'refactor'
/// </summary>
public static readonly CodeActionKind Refactor = new CodeActionKind("refactor");
/// <summary>
/// Base kind for quickfix actions: 'quickfix'
/// </summary>
public static readonly CodeActionKind QuickFix = new CodeActionKind("quickfix");

/// <summary>
/// Base kind for refactoring extraction actions: 'refactor.extract'
///
/// Example extract actions:
///
/// - Extract method
/// - Extract function
/// - Extract variable
/// - Extract interface from class
/// - ...
/// </summary>
public static readonly CodeActionKind RefactorExtract = new CodeActionKind("refactor.extract");
/// <summary>
/// Base kind for refactoring actions: 'refactor'
/// </summary>
public static readonly CodeActionKind Refactor = new CodeActionKind("refactor");

/// <summary>
/// Base kind for refactoring inline actions: 'refactor.inline'
///
/// Example inline actions:
///
/// - Inline function
/// - Inline variable
/// - Inline constant
/// - ...
/// </summary>
public static readonly CodeActionKind RefactorInline = new CodeActionKind("refactor.inline");
/// <summary>
/// Base kind for refactoring extraction actions: 'refactor.extract'
///
/// Example extract actions:
///
/// - Extract method
/// - Extract function
/// - Extract variable
/// - Extract interface from class
/// - ...
/// </summary>
public static readonly CodeActionKind RefactorExtract = new CodeActionKind("refactor.extract");

/// <summary>
/// Base kind for refactoring rewrite actions: 'refactor.rewrite'
///
/// Example rewrite actions:
///
/// - Convert JavaScript function to class
/// - Add or remove parameter
/// - Encapsulate field
/// - Make method static
/// - Move method to base class
/// - ...
/// </summary>
public static readonly CodeActionKind RefactorRewrite = new CodeActionKind("refactor.rewrite");
/// <summary>
/// Base kind for refactoring inline actions: 'refactor.inline'
///
/// Example inline actions:
///
/// - Inline function
/// - Inline variable
/// - Inline constant
/// - ...
/// </summary>
public static readonly CodeActionKind RefactorInline = new CodeActionKind("refactor.inline");

/// <summary>
/// Base kind for source actions: `source`
///
/// Source code actions apply to the entire file.
/// </summary>
public static readonly CodeActionKind Source = new CodeActionKind("source");
/// <summary>
/// Base kind for refactoring rewrite actions: 'refactor.rewrite'
///
/// Example rewrite actions:
///
/// - Convert JavaScript function to class
/// - Add or remove parameter
/// - Encapsulate field
/// - Make method static
/// - Move method to base class
/// - ...
/// </summary>
public static readonly CodeActionKind RefactorRewrite = new CodeActionKind("refactor.rewrite");

/// <summary>
/// Base kind for an organize imports source action: `source.organizeImports`
/// </summary>
public static readonly CodeActionKind SourceOrganizeImports = new CodeActionKind("source.organizeImports");
/// <summary>
/// Base kind for source actions: `source`
///
/// Source code actions apply to the entire file.
/// </summary>
public static readonly CodeActionKind Source = new CodeActionKind("source");

/// <summary>
/// Base kind for an organize imports source action: `source.organizeImports`
/// </summary>
public static readonly CodeActionKind SourceOrganizeImports = new CodeActionKind("source.organizeImports");

private readonly string? _value;
private readonly string? _value;

public CodeActionKind(string kind) => _value = kind;
public CodeActionKind(string kind) => _value = kind;

public static implicit operator CodeActionKind(string kind) => new CodeActionKind(kind);
public static implicit operator CodeActionKind(string kind) => new CodeActionKind(kind);

public static implicit operator string(CodeActionKind kind) => kind._value ?? string.Empty;
public static implicit operator string(CodeActionKind kind) => kind._value ?? string.Empty;

/// <inheritdoc />
public override string ToString() => _value ?? string.Empty;
/// <inheritdoc />
public override string ToString() => _value ?? string.Empty;

public bool Equals(CodeActionKind other) => _value == other._value;
public bool Equals(CodeActionKind other) => _value == other._value;

public override bool Equals(object obj) => obj is CodeActionKind other && Equals(other);
public override bool Equals(object obj) => obj is CodeActionKind other && Equals(other);

public override int GetHashCode() => _value != null ? _value.GetHashCode() : 0;
public override int GetHashCode() => _value != null ? _value.GetHashCode() : 0;

public static bool operator ==(CodeActionKind left, CodeActionKind right) => left.Equals(right);
public static bool operator ==(CodeActionKind left, CodeActionKind right) => left.Equals(right);

public static bool operator !=(CodeActionKind left, CodeActionKind right) => !left.Equals(right);
}
public static bool operator !=(CodeActionKind left, CodeActionKind right) => !left.Equals(right);
}
}

namespace Client.Capabilities
Expand Down Expand Up @@ -479,6 +480,18 @@ public partial class CodeActionCapability : DynamicCapability, ConnectedCapabili
/// </summary>
[Optional]
public CodeActionCapabilityResolveSupportOptions? ResolveSupport { get; set; }

/// <summary>
/// Whether th client honors the change annotations in
/// text edits and resource operations returned via the
/// `CodeAction#edit` property by for example presenting
/// the workspace edit in the user interface and asking
/// for confirmation.
///
/// @since 3.16.0 - proposed state
/// </summary>
[Optional]
public bool HonorsChangeAnnotations { get; set; }
}

public class CodeActionLiteralSupportOptions
Expand Down
5 changes: 1 addition & 4 deletions src/Protocol/Features/Document/CompletionFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,8 @@ public partial record CompletionItem : ICanBeResolved, IRequest<CompletionItem>
///
/// @since 3.16.0 additional type `InsertReplaceEdit` - proposed state
/// </summary>
/// <remarks>
/// TODO: Update this to union <see cref="TextEdit"/> <see cref="InsertReplaceEdit"/>
/// </remarks>
[Optional]
public TextEdit? TextEdit { get; init; }
public TextEditOrInsertReplaceEdit? TextEdit { get; init; }

/// <summary>
/// An optional array of additional text edits that are applied when
Expand Down
Loading