Skip to content

Commit 8595f08

Browse files
Merge remote-tracking branch 'origin/master' into feature/source-generators
2 parents 2c196d3 + 508e3ac commit 8595f08

37 files changed

+381
-36
lines changed

.azure-pipelines.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ jobs:
7575
- template: support/install-dotnet.yml@rsg
7676
parameters:
7777
DotNetSdk:
78-
- '2.x'
79-
- '3.x'
80-
- '5.0.100-rc.2.20479.15'
78+
- '2.1.x'
79+
- '3.1.x'
80+
- '5.0.x'
8181

8282
- task: DotNetCoreCLI@2
8383
displayName: 'dotnet tool restore'

.build/.build.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net5.0</TargetFramework>
66
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
77
<RootNamespace></RootNamespace>
88
<IsPackable>False</IsPackable>

.build/Solution.cs

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public static RocketSurgeonGitHubActionsConfiguration Middleware(RocketSurgeonGi
6767
new SetupDotNetStep("Use .NET Core 3.1 SDK") {
6868
DotNetVersion = "3.1.x"
6969
},
70+
new SetupDotNetStep("Use .NET Core 5.0 SDK") {
71+
DotNetVersion = "5.0.x"
72+
},
7073
}
7174
);
7275

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: 🔨 Use .NET Core 5.0 SDK
5656
uses: actions/[email protected]
5757
with:
58-
dotnet-version: '5.0.100-rc.2.20479.15'
58+
dotnet-version: '5.0.x'
5959
- name: 🎁 dotnet tool restore
6060
run: |
6161
dotnet tool restore

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"coverage-gutters.lcovname": "*.info",
33
"coverage-gutters.showGutterCoverage": true,
4+
"omnisharp.enableLspDriver": true,
45
"cSpell.words": [
56
"Unregisterations",
67
"Unregistration",
78
"Unregistrations",
89
"deresult",
910
"reciever"
1011
]
11-
}
12+
}

Directory.Build.targets

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
<Project>
33
<ItemGroup>
44
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
5-
<PackageReference Include="Rocket.Surgery.MSBuild.CI" Version="1.0.0" PrivateAssets="All" />
6-
<PackageReference Include="Rocket.Surgery.MSBuild.Metadata" Version="1.0.0" PrivateAssets="All" />
7-
<PackageReference Include="Rocket.Surgery.MSBuild.SourceLink" Version="1.0.0" PrivateAssets="All" />
5+
<PackageReference Include="Rocket.Surgery.MSBuild.CI" Version="1.1.0" PrivateAssets="All" />
6+
<PackageReference Include="Rocket.Surgery.MSBuild.Metadata" Version="1.1.0" PrivateAssets="All" />
7+
<PackageReference Include="Rocket.Surgery.MSBuild.SourceLink" Version="1.1.0" PrivateAssets="All" />
88
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
99
</ItemGroup>
1010
<ItemGroup>
11-
<PackageReference Update="GitVersion.Tool" Version="5.5.0" />
11+
<PackageReference Update="GitVersion.Tool" Version="5.5.1" />
1212
<PackageReference Update="JetBrains.ReSharper.CommandLineTools" Version="2020.2.4" />
1313
<PackageReference Update="ReportGenerator" Version="4.8.0" />
14-
<PackageReference Update="Rocket.Surgery.Nuke" Version="0.14.0-beta.10" />
14+
<PackageReference Update="Rocket.Surgery.Nuke" Version="0.14.2" />
1515
</ItemGroup>
1616
<ItemGroup>
1717
<PackageReference Update="Microsoft.Extensions.Logging" Version="2.0.0" />

LSP.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2F323ED5-E
1414
EndProjectSection
1515
EndProject
1616
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{AE4D7807-6F78-428C-A0D9-914BA583A104}"
17-
ProjectSection(SolutionItems) = preProject
17+
ProjectSection(SolutionItems) = prePrlaoject
1818
.appveyor.yml = .appveyor.yml
1919
.editorconfig = .editorconfig
2020
.gitattributes = .gitattributes

language-server-protocol.sha.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
-- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol/commits/gh-pages
2-
lastSha: 558f1e114a3dc53da7c3686a657ebef070275d63
2+
lastSha: 0e116448e3b3f4ce0b983768c045dba0a41b6a72
33

4-
https://github.com/Microsoft/language-server-protocol/compare/558f1e114a3dc53da7c3686a657ebef070275d63..gh-pages
4+
https://github.com/Microsoft/language-server-protocol/compare/0e116448e3b3f4ce0b983768c045dba0a41b6a72..gh-pages

sample/SampleServer/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private static async Task MainAsync(string[] args)
3030

3131
Log.Logger.Information("This only goes file...");
3232

33-
IObserver<WorkDoneProgressReport> workDone = null;
33+
IObserver<WorkDoneProgressReport> workDone = null!;
3434

3535
var server = await LanguageServer.From(
3636
options =>

sample/SampleServer/SemanticTokensHandler.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ public SemanticTokensHandler(ILogger<SemanticTokensHandler> logger) : base(
3030
) =>
3131
_logger = logger;
3232

33-
public override async Task<SemanticTokens> Handle(
33+
public override async Task<SemanticTokens?> Handle(
3434
SemanticTokensParams request, CancellationToken cancellationToken
3535
)
3636
{
3737
var result = await base.Handle(request, cancellationToken);
3838
return result;
3939
}
4040

41-
public override async Task<SemanticTokens> Handle(
41+
public override async Task<SemanticTokens?> Handle(
4242
SemanticTokensRangeParams request, CancellationToken cancellationToken
4343
)
4444
{
@@ -66,7 +66,7 @@ CancellationToken cancellationToken
6666
var content = await File.ReadAllTextAsync(DocumentUri.GetFileSystemPath(identifier), cancellationToken);
6767
await Task.Yield();
6868

69-
foreach (var (line, text) in content.Split('\n').Select((text, line) => ( line, text )))
69+
foreach (var (line, text) in content.Split('\n').Select((text, line) => (line, text)))
7070
{
7171
var parts = text.TrimEnd().Split(';', ' ', '.', '"', '(', ')');
7272
var index = 0;

sample/SampleServer/TextDocumentHandler.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public MyWorkspaceSymbolsHandler(IServerWorkDoneManager serverWorkDoneManager, I
164164
{
165165
_serverWorkDoneManager = serverWorkDoneManager;
166166
_progressManager = progressManager;
167-
this._logger = logger;
167+
_logger = logger;
168168
}
169169

170170
public override async Task<Container<SymbolInformation>> Handle(

src/Dap.Client/Configuration/ChainedConfigurationProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void Dispose()
8787
{
8888
if (_shouldDisposeConfig)
8989
{
90-
(_config as IDisposable)?.Dispose();
90+
( _config as IDisposable )?.Dispose();
9191
}
9292
}
9393
}

src/Protocol/Client/Capabilities/ClientCapabilities.cs

+39
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,48 @@ public class ClientCapabilities : CapabilitiesBase
2424
[Optional]
2525
public WindowClientCapabilities? Window { get; set; }
2626

27+
/// <summary>
28+
/// General client capabilities.
29+
/// </summary>
30+
[Optional]
31+
public GeneralClientCapabilities? General { get; set; }
32+
2733
/// <summary>
2834
/// Experimental client capabilities.
2935
/// </summary>
3036
public IDictionary<string, JToken> Experimental { get; set; } = new Dictionary<string, JToken>();
3137
}
38+
39+
/// <summary>
40+
/// General client capabilities.
41+
/// </summary>
42+
public class GeneralClientCapabilities
43+
{
44+
/// <summary>
45+
/// Client capabilities specific to regular expressions.
46+
///
47+
/// @since 3.16.0 - proposed state
48+
/// </summary>
49+
[Optional]
50+
public RegularExpressionsClientCapabilities? RegularExpressions { get; set; }
51+
}
52+
53+
/// <summary>
54+
/// Client capabilities specific to regular expressions.
55+
///
56+
/// @since 3.16.0 - proposed state
57+
/// </summary>
58+
public class RegularExpressionsClientCapabilities
59+
{
60+
/// <summary>
61+
/// The engine's name.
62+
/// </summary>
63+
public string Engine { get; set; } = null!;
64+
65+
/// <summary>
66+
/// The engine's version.
67+
/// </summary>
68+
[Optional]
69+
public string? Version { get; set; }
70+
}
3271
}

src/Protocol/Client/Capabilities/CompletionItemCapabilityOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class CompletionItemCapabilityOptions
9393

9494
public class CompletionItemInsertTextModeSupportCapabilityOptions
9595
{
96-
public Container<InsertTextMode> ValueSet { get; set; }
96+
public Container<InsertTextMode> ValueSet { get; set; } = null!;
9797
}
9898

9999
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using OmniSharp.Extensions.LanguageServer.Protocol.Document;
2+
3+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
4+
{
5+
[CapabilityKey(nameof(ClientCapabilities.TextDocument), nameof(TextDocumentClientCapabilities.OnTypeRename))]
6+
public class OnTypeRenameClientCapabilities : DynamicCapability, ConnectedCapability<IOnTypeRenameHandler>
7+
{
8+
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
3+
4+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities
5+
{
6+
/// <summary>
7+
/// Capabilities specific to the showDocument request
8+
///
9+
/// @since 3.16.0 - proposed state
10+
/// </summary>
11+
[Obsolete(Constants.Proposal)]
12+
[CapabilityKey(nameof(ClientCapabilities.Window), nameof(WindowClientCapabilities.ShowDocument))]
13+
public class ShowDocumentClientCapabilities
14+
{
15+
/// <summary>
16+
/// Capabilities specific to the `MessageActionItem` type.
17+
/// </summary>
18+
[Optional]
19+
public bool Support { get; set; }
20+
}
21+
}

src/Protocol/Client/Capabilities/TextDocumentClientCapabilities.cs

+7
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ public class TextDocumentClientCapabilities : CapabilitiesBase
116116
/// </summary>
117117
public Supports<SelectionRangeCapability?> SelectionRange { get; set; }
118118

119+
/// <summary>
120+
/// Capabilities specific to the `textDocument/onTypeRename` request.
121+
///
122+
/// Since 3.16.0
123+
/// </summary>
124+
public Supports<OnTypeRenameClientCapabilities?> OnTypeRename { get; set; }
125+
119126
/// <summary>
120127
/// Capabilities specific to `textDocument/publishDiagnostics`.
121128
/// </summary>

src/Protocol/Client/Capabilities/WindowClientCapabilities.cs

+7
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,12 @@ public class WindowClientCapabilities : CapabilitiesBase
1616
/// @since 3.16.0 - proposed state
1717
/// </summary>
1818
public Supports<ShowMessageRequestClientCapabilities> ShowMessage { get; set; }
19+
20+
/// <summary>
21+
/// Client capabilities for the show document request.
22+
///
23+
/// @since 3.16.0 - proposed state
24+
/// </summary>
25+
public Supports<ShowDocumentClientCapabilities> ShowDocument { get; set; }
1926
}
2027
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using System.Threading;
3+
using System.Threading.Tasks;
4+
using OmniSharp.Extensions.JsonRpc;
5+
using OmniSharp.Extensions.JsonRpc.Generation;
6+
using OmniSharp.Extensions.LanguageServer.Protocol.Client;
7+
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
8+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
9+
10+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Document
11+
{
12+
[Parallel]
13+
[Obsolete(Constants.Proposal)]
14+
[Method(TextDocumentNames.OnTypeRename, Direction.ClientToServer)]
15+
[GenerateHandlerMethods]
16+
[GenerateRequestMethods(typeof(ITextDocumentLanguageClient), typeof(ILanguageClient))]
17+
public interface IOnTypeRenameHandler : IJsonRpcRequestHandler<OnTypeRenameParams, OnTypeRenameRanges?>, IRegistration<OnTypeRenameRegistrationOptions>, ICapability<OnTypeRenameClientCapabilities>
18+
{
19+
}
20+
21+
public abstract class OnTypeRenameHandler : IOnTypeRenameHandler
22+
{
23+
private readonly OnTypeRenameRegistrationOptions _options;
24+
public OnTypeRenameHandler(OnTypeRenameRegistrationOptions registrationOptions) => _options = registrationOptions;
25+
26+
public OnTypeRenameRegistrationOptions GetRegistrationOptions() => _options;
27+
public abstract Task<OnTypeRenameRanges?> Handle(OnTypeRenameParams request, CancellationToken cancellationToken);
28+
public virtual void SetCapability(OnTypeRenameClientCapabilities capability) => Capability = capability;
29+
protected OnTypeRenameClientCapabilities Capability { get; private set; } = null!;
30+
}
31+
}

src/Protocol/Models/ApplyWorkspaceEditResponse.cs

+9
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,14 @@ public class ApplyWorkspaceEditResponse
1717
/// </summary>
1818
[Optional]
1919
public string? FailureReason { get; set; }
20+
21+
/// <summary>
22+
/// Depending on the client's failure handling strategy `failedChange`
23+
/// might contain the index of the change that failed. This property is
24+
/// only available if the client signals a `failureHandlingStrategy`
25+
/// in its client capabilities.
26+
/// </summary>
27+
[Optional]
28+
public int? FailedChange { get; set; }
2029
}
2130
}

src/Protocol/Models/DidSaveTextDocumentParams.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ public class DidSaveTextDocumentParams : ITextDocumentIdentifierParams, IRequest
1010
/// <summary>
1111
/// The document that was saved.
1212
/// </summary>
13+
/// <remarks>
14+
/// TODO: Change to RequiredVersionedTextDocumentIdentifier (or in the future will be VersionedTextDocumentIdentifier)
15+
/// </remarks>
1316
public TextDocumentIdentifier TextDocument { get; set; } = null!;
1417

1518
/// <summary>
1619
/// Optional the content when saved. Depends on the includeText value
17-
/// when the save notifcation was requested.
20+
/// when the save notification was requested.
1821
/// </summary>
1922
[Optional]
2023
public string? Text { get; set; }

src/Protocol/Models/FoldingRangeRegistrationOptions.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ class FoldingRangeRegistrationOptionsConverter : RegistrationOptionsConverterBas
1313
public FoldingRangeRegistrationOptionsConverter() : base(nameof(ServerCapabilities.FoldingRangeProvider))
1414
{
1515
}
16-
public override StaticOptions Convert(FoldingRangeRegistrationOptions source) => new StaticOptions { WorkDoneProgress = source.WorkDoneProgress };
16+
17+
public override StaticOptions Convert(FoldingRangeRegistrationOptions source) => new StaticOptions {
18+
WorkDoneProgress = source.WorkDoneProgress,
19+
DocumentSelector = source.DocumentSelector
20+
};
1721
}
1822
}
1923
}

src/Protocol/Models/InsertReplaceEdit.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ public class InsertReplaceEdit
1313
/// <summary>
1414
/// The string to be inserted.
1515
/// </summary>
16-
public string NewText { get; set; }
16+
public string NewText { get; set; } = null!;
1717

1818
/// <summary>
1919
/// The range if the insert is requested
2020
/// </summary>
21-
public Range Insert { get; set; }
21+
public Range Insert { get; set; } = null!;
2222

2323
/// <summary>
2424
/// The range if the replace is requested.
2525
/// </summary>
26-
public Range Replace { get; set; }
26+
public Range Replace { get; set; } = null!;
2727

2828
private string DebuggerDisplay => $"{Insert} / {Replace} {( string.IsNullOrWhiteSpace(NewText) ? string.Empty : NewText.Length > 30 ? NewText.Substring(0, 30) : NewText )}";
2929

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using MediatR;
2+
using OmniSharp.Extensions.JsonRpc;
3+
4+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
5+
{
6+
[Parallel]
7+
[Method(TextDocumentNames.OnTypeRename, Direction.ClientToServer)]
8+
public class OnTypeRenameParams : WorkDoneTextDocumentPositionParams, IRequest<OnTypeRenameRanges>
9+
{
10+
}
11+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using OmniSharp.Extensions.LanguageServer.Protocol.Serialization;
2+
3+
namespace OmniSharp.Extensions.LanguageServer.Protocol.Models
4+
{
5+
public class OnTypeRenameRanges
6+
{
7+
/// <summary>
8+
/// A list of ranges that can be renamed together. The ranges must have
9+
/// identical length and contain identical text content. The ranges cannot overlap.
10+
/// </summary>
11+
public Container<Range> Ranges { get; set; } = null!;
12+
13+
/// <summary>
14+
/// An optional word pattern (regular expression) that describes valid contents for
15+
/// the given ranges. If no pattern is provided, the client configuration's word
16+
/// pattern will be used.
17+
/// </summary>
18+
[Optional]
19+
public string? WordPattern { get; set; }
20+
}
21+
}

0 commit comments

Comments
 (0)