Skip to content

Update with the 3.17 spec changes #1019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 15, 2023
Merged
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .build/.build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.ReSharper.CommandLineTools" ExcludeAssets="All" />
<PackageReference Include="GitVersion.Tool" ExcludeAssets="All" />
<PackageReference Include="ReportGenerator" ExcludeAssets="All" />
<PackageReference Include="Rocket.Surgery.Nuke" />
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/[email protected]
with:
clean: 'false'
fetch-depth: '0'
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
run: |
dotnet nuke Pack --skip
- name: 🐿 Publish Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v4.0.0-beta.2
with:
name: 'actions-${{ matrix.os }}'
- name: 🏺 Publish logs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/[email protected]
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/[email protected]
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/[email protected]

- name: Run Labeler
if: success()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
uses: actions/[email protected]
with:
ref: ${{ github.sha }}
fetch-depth: 0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ coverage.info
/codealike.json
.tmp/
.nuke/temp/
**/*.received.cs
1 change: 1 addition & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
Expand Down
4 changes: 3 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@
<PackageVersion Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="11.0.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="xunit" Version="2.4.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Verify.Xunit" Version="16.8.1" />
<PackageVersion Include="Verify.SourceGenerators" Version="1.5.0-beta.1" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageVersion Include="Serilog.Sinks.Observable" Version="2.0.2" />
Expand Down
72 changes: 69 additions & 3 deletions LSP.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D764E024-3D3
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
src\Directory.Build.targets = src\Directory.Build.targets
src\.editorconfig = src\.editorconfig
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}"
Expand Down Expand Up @@ -38,6 +39,8 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleServer", "sample\SampleServer\SampleServer.csproj", "{F2067F5F-FA4E-4990-B301-E7898FC4C45F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{A316FCEC-81AD-45FB-93EE-C62CA09300DC}"
ProjectSection(SolutionItems) = preProject
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "src\Client\Client.csproj", "{417E95B2-5AB9-49D5-B7CD-12255472E2E7}"
EndProject
Expand All @@ -53,8 +56,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dap.Server", "src\Dap.Serve
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = ".build", ".build\.build.csproj", "{28B13787-A442-4D28-BF9A-3D65BF13AAEC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{26522B49-0743-4CBE-BA67-6D17FF65CAB9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "src\Shared\Shared.csproj", "{18FB2302-023B-4F6F-9F6D-099B47B69D9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dap.Tests", "test\Dap.Tests\Dap.Tests.csproj", "{6D9E5BF4-4666-476B-AC88-D108A80567F6}"
Expand All @@ -81,6 +82,67 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Protocol.Proposals", "src\P
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lsp.Integration.Tests", "test\Lsp.Integration.Tests\Lsp.Integration.Tests.csproj", "{72A74595-A278-46F0-9C8B-3151C9681B91}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{93A0F406-2CEB-491E-9F40-6DA1BA67DD7C}"
ProjectSection(SolutionItems) = preProject
.config\dotnet-tools.json = .config\dotnet-tools.json
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
Directory.Packages.supports.props = Directory.Packages.supports.props
Directory.Build.targets = Directory.Build.targets
.editorconfig = .editorconfig
build.cmd = build.cmd
build.sh = build.sh
build.ps1 = build.ps1
GitReleaseManager.yaml = GitReleaseManager.yaml
.codecov.yml = .codecov.yml
.azure-pipelines.yml = .azure-pipelines.yml
.appveyor.yml = .appveyor.yml
azure-pipelines.nuke.yml = azure-pipelines.nuke.yml
GitVersion.yml = GitVersion.yml
.travis.yml = .travis.yml
LICENSE = LICENSE
README.md = README.md
.gitignore = .gitignore
.gitattributes = .gitattributes
.prettierignore = .prettierignore
.prettierrc = .prettierrc
.lintstagedrc.js = .lintstagedrc.js
NuGet.config = NuGet.config
package.json = package.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{19909559-F753-4337-952B-A8B5B5889959}"
ProjectSection(SolutionItems) = preProject
.github\labels.yml = .github\labels.yml
.github\renovate.json = .github\renovate.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{97924298-E17E-46E6-83CC-D9CD3B9F5E6F}"
ProjectSection(SolutionItems) = preProject
.github\workflows\ci-ignore.yml = .github\workflows\ci-ignore.yml
.github\workflows\draft-release.yml = .github\workflows\draft-release.yml
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
.github\workflows\dependabot-merge.yml = .github\workflows\dependabot-merge.yml
.github\workflows\sync-labels.yml = .github\workflows\sync-labels.yml
.github\workflows\close-milestone.yml = .github\workflows\close-milestone.yml
.github\workflows\update-milestone.yml = .github\workflows\update-milestone.yml
.github\workflows\ci.yml = .github\workflows\ci.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".husky", ".husky", "{BED6765C-97D8-406D-B782-3307132D16F0}"
ProjectSection(SolutionItems) = preProject
.husky\pre-commit = .husky\pre-commit
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".vscode", ".vscode", "{09BE8ED9-1986-40F3-A9A6-D826A7413581}"
ProjectSection(SolutionItems) = preProject
.vscode\settings.json = .vscode\settings.json
.vscode\csharp.code-snippets = .vscode\csharp.code-snippets
.vscode\launch.json = .vscode\launch.json
.vscode\tasks.json.old = .vscode\tasks.json.old
.vscode\tasks.json = .vscode\tasks.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -388,7 +450,7 @@ Global
{E540868F-438E-4F7F-BBB7-010D6CB18A57} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{F2C9D555-118E-442B-A953-9A7B58A53F33} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{E1A9123B-A236-4240-8C82-A61BD85C3BF4} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{28B13787-A442-4D28-BF9A-3D65BF13AAEC} = {26522B49-0743-4CBE-BA67-6D17FF65CAB9}
{28B13787-A442-4D28-BF9A-3D65BF13AAEC} = {93A0F406-2CEB-491E-9F40-6DA1BA67DD7C}
{18FB2302-023B-4F6F-9F6D-099B47B69D9F} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{6D9E5BF4-4666-476B-AC88-D108A80567F6} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
{678A4DD2-A656-4DCC-AE78-F9940C82A6E6} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
Expand All @@ -402,6 +464,10 @@ Global
{D43637CC-94E6-4ED4-BAA3-E5D1AD3285F5} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{201B1CA7-AB12-41AD-9246-BC30F2EBE2DF} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{72A74595-A278-46F0-9C8B-3151C9681B91} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
{19909559-F753-4337-952B-A8B5B5889959} = {93A0F406-2CEB-491E-9F40-6DA1BA67DD7C}
{97924298-E17E-46E6-83CC-D9CD3B9F5E6F} = {19909559-F753-4337-952B-A8B5B5889959}
{BED6765C-97D8-406D-B782-3307132D16F0} = {93A0F406-2CEB-491E-9F40-6DA1BA67DD7C}
{09BE8ED9-1986-40F3-A9A6-D826A7413581} = {93A0F406-2CEB-491E-9F40-6DA1BA67DD7C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D38DD0EC-D095-4BCD-B8AF-2D788AF3B9AE}
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"version": "6.0.414",
"rollForward": "latestMinor"
}
}
}
5 changes: 3 additions & 2 deletions language-server-protocol.sha.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- This is the last commit we caught up with https://github.com/Microsoft/language-server-protocol/commits/gh-pages
lastSha: bdcc0f2
lastSha: 5fc92456c046ed980646bb95c1d2e390d5b3ef9d

https://github.com/Microsoft/language-server-protocol/compare/5fc92456c046ed980646bb95c1d2e390d5b3ef9d..gh-pages

https://github.com/Microsoft/language-server-protocol/compare/bdcc0f2..gh-pages
4 changes: 2 additions & 2 deletions sample/SampleServer/FoldingRangeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class FoldingRangeHandler : IFoldingRangeHandler
{
public FoldingRangeRegistrationOptions GetRegistrationOptions() =>
new FoldingRangeRegistrationOptions {
DocumentSelector = DocumentSelector.ForLanguage("csharp")
DocumentSelector = TextDocumentSelector.ForLanguage("csharp")
};

public Task<Container<FoldingRange>?> Handle(
Expand All @@ -30,7 +30,7 @@ CancellationToken cancellationToken
);

public FoldingRangeRegistrationOptions GetRegistrationOptions(FoldingRangeCapability capability, ClientCapabilities clientCapabilities) => new FoldingRangeRegistrationOptions {
DocumentSelector = DocumentSelector.ForLanguage("csharp")
DocumentSelector = TextDocumentSelector.ForLanguage("csharp")
};
}
}
14 changes: 4 additions & 10 deletions sample/SampleServer/SampleServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@

<ItemGroup>
<ProjectReference Include="../../src/Server/Server.csproj" />
<PackageReference Include="Microsoft.Extensions.Logging" VersionOverride="6.0.0" />
<PackageReference Include="Serilog.Extensions.Logging" VersionOverride="3.1.0" />
<PackageReference Include="Serilog.Sinks.File" VersionOverride="5.0.0" />
<PackageReference Include="Serilog.Sinks.Debug" VersionOverride="2.0.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" VersionOverride="4.3.0" />
<PackageReference Include="System.IO" VersionOverride="4.3.0" />
<PackageReference Include="System.Runtime.Handles" VersionOverride="4.3.0" />
<PackageReference Include="System.Text.Encoding" VersionOverride="4.3.0" />
<PackageReference Include="System.Text.Encoding.Extensions" VersionOverride="4.3.0" />
<PackageReference Include="System.Threading.Tasks" VersionOverride="4.3.0" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Serilog.Extensions.Logging" />
<PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Serilog.Sinks.Debug" />
<PackageReference Include="Nerdbank.Streams" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion sample/SampleServer/SemanticTokensHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected override SemanticTokensRegistrationOptions CreateRegistrationOptions(
{
return new SemanticTokensRegistrationOptions
{
DocumentSelector = DocumentSelector.ForLanguage("csharp"),
DocumentSelector = TextDocumentSelector.ForLanguage("csharp"),
Legend = new SemanticTokensLegend
{
TokenModifiers = capability.TokenModifiers,
Expand Down
20 changes: 9 additions & 11 deletions sample/SampleServer/TextDocumentHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ internal class TextDocumentHandler : TextDocumentSyncHandlerBase
private readonly ILogger<TextDocumentHandler> _logger;
private readonly ILanguageServerConfiguration _configuration;

private readonly DocumentSelector _documentSelector = new DocumentSelector(
new DocumentFilter {
private readonly TextDocumentSelector _textDocumentSelector = new TextDocumentSelector(
new TextDocumentFilter {
Pattern = "**/*.cs"
}
);
Expand Down Expand Up @@ -69,8 +69,8 @@ public override Task<Unit> Handle(DidCloseTextDocumentParams notification, Cance

public override Task<Unit> Handle(DidSaveTextDocumentParams notification, CancellationToken token) => Unit.Task;

protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions(SynchronizationCapability capability, ClientCapabilities clientCapabilities) => new TextDocumentSyncRegistrationOptions() {
DocumentSelector = _documentSelector,
protected override TextDocumentSyncRegistrationOptions CreateRegistrationOptions(TextSynchronizationCapability capability, ClientCapabilities clientCapabilities) => new TextDocumentSyncRegistrationOptions() {
DocumentSelector = _textDocumentSelector,
Change = Change,
Save = new SaveOptions() { IncludeText = true }
};
Expand Down Expand Up @@ -129,7 +129,7 @@ CancellationToken cancellationToken
}

public DocumentSymbolRegistrationOptions GetRegistrationOptions(DocumentSymbolCapability capability, ClientCapabilities clientCapabilities) => new DocumentSymbolRegistrationOptions {
DocumentSelector = DocumentSelector.ForLanguage("csharp")
DocumentSelector = TextDocumentSelector.ForLanguage("csharp")
};
}

Expand All @@ -146,7 +146,7 @@ public MyWorkspaceSymbolsHandler(IServerWorkDoneManager serverWorkDoneManager, I
_logger = logger;
}

public async Task<Container<SymbolInformation>> Handle(
public async Task<Container<WorkspaceSymbol>> Handle(
WorkspaceSymbolParams request,
CancellationToken cancellationToken
)
Expand Down Expand Up @@ -190,9 +190,8 @@ CancellationToken cancellationToken

partialResults.OnNext(
new[] {
new SymbolInformation {
new WorkspaceSymbol {
ContainerName = "Partial Container",
Deprecated = true,
Kind = SymbolKind.Constant,
Location = new Location {
Range = new Range(
Expand Down Expand Up @@ -221,15 +220,14 @@ CancellationToken cancellationToken
);

partialResults.OnCompleted();
return new SymbolInformation[] { };
return new WorkspaceSymbol[] { };
}

try
{
return new[] {
new SymbolInformation {
new WorkspaceSymbol {
ContainerName = "Container",
Deprecated = true,
Kind = SymbolKind.Constant,
Location = new Location {
Range = new Range(
Expand Down
4 changes: 4 additions & 0 deletions src/Client/DefaultLanguageClientFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace OmniSharp.Extensions.LanguageServer.Client
internal class DefaultLanguageClientFacade : LanguageProtocolProxy, ILanguageClientFacade, IOnLanguageClientStarted
{
private readonly Lazy<ITextDocumentLanguageClient> _textDocument;
private readonly Lazy<INotebookDocumentLanguageClient> _notebookDocument;
private readonly Lazy<IClientLanguageClient> _client;
private readonly Lazy<IGeneralLanguageClient> _general;
private readonly Lazy<IWindowLanguageClient> _window;
Expand All @@ -28,6 +29,7 @@ public DefaultLanguageClientFacade(
IProgressManager progressManager,
ILanguageProtocolSettings languageProtocolSettings,
Lazy<ITextDocumentLanguageClient> textDocument,
Lazy<INotebookDocumentLanguageClient> notebookDocument,
Lazy<IClientLanguageClient> client,
Lazy<IGeneralLanguageClient> general,
Lazy<IWindowLanguageClient> window,
Expand All @@ -38,6 +40,7 @@ IInsanceHasStarted instanceHasStarted
) : base(requestRouter, resolverContext, progressManager, languageProtocolSettings)
{
_textDocument = textDocument;
_notebookDocument = notebookDocument;
_client = client;
_general = general;
_window = window;
Expand All @@ -48,6 +51,7 @@ IInsanceHasStarted instanceHasStarted
}

public ITextDocumentLanguageClient TextDocument => _textDocument.Value;
public INotebookDocumentLanguageClient NotebookDocument => _notebookDocument.Value;
public IClientLanguageClient Client => _client.Value;
public IGeneralLanguageClient General => _general.Value;
public IWindowLanguageClient Window => _window.Value;
Expand Down
3 changes: 3 additions & 0 deletions src/Client/LanguageClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ internal LanguageClient(
IEnumerable<OnLanguageClientStartedDelegate> startedDelegates,
IEnumerable<IOnLanguageClientStarted> startedHandlers,
ITextDocumentLanguageClient textDocumentLanguageClient,
INotebookDocumentLanguageClient notebookDocumentLanguageClient,
IClientLanguageClient clientLanguageClient,
IGeneralLanguageClient generalLanguageClient,
IWindowLanguageClient windowLanguageClient,
Expand Down Expand Up @@ -228,13 +229,15 @@ IScheduler scheduler

// We need to at least create Window here in case any handler does loggin in their constructor
TextDocument = textDocumentLanguageClient;
NotebookDocument = notebookDocumentLanguageClient;
Client = clientLanguageClient;
General = generalLanguageClient;
Window = windowLanguageClient;
Workspace = workspaceLanguageClient;
}

public ITextDocumentLanguageClient TextDocument { get; }
public INotebookDocumentLanguageClient NotebookDocument { get; }
public IClientLanguageClient Client { get; }
public IGeneralLanguageClient General { get; }
public IWindowLanguageClient Window { get; }
Expand Down
Loading