From 9d76c3e44340260ae3d9ed05860c087c2e1d9b15 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:21:14 -0700 Subject: [PATCH 1/8] Small feedback from last PR --- .../Microsoft.CodeAnalysis.LanguageServer/JsonRpcServer.cs | 5 +++-- server/Microsoft.CodeAnalysis.LanguageServer/Program.cs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/Microsoft.CodeAnalysis.LanguageServer/JsonRpcServer.cs b/server/Microsoft.CodeAnalysis.LanguageServer/JsonRpcServer.cs index 2d57e6b8f..8bd26f197 100644 --- a/server/Microsoft.CodeAnalysis.LanguageServer/JsonRpcServer.cs +++ b/server/Microsoft.CodeAnalysis.LanguageServer/JsonRpcServer.cs @@ -7,12 +7,13 @@ using StreamJsonRpc; namespace Microsoft.CodeAnalysis.LanguageServer; -internal sealed class JsonRpcServer : IDisposable + +internal sealed class RoslynLanguageServer : IDisposable { private readonly JsonRpc _jsonRpc; private readonly ILogger _logger; - public JsonRpcServer(Stream inputStream, Stream outputStream, ILogger logger) + public RoslynLanguageServer(Stream inputStream, Stream outputStream, ILogger logger) { _logger = logger; diff --git a/server/Microsoft.CodeAnalysis.LanguageServer/Program.cs b/server/Microsoft.CodeAnalysis.LanguageServer/Program.cs index edce26cf8..7c2146228 100644 --- a/server/Microsoft.CodeAnalysis.LanguageServer/Program.cs +++ b/server/Microsoft.CodeAnalysis.LanguageServer/Program.cs @@ -2,11 +2,10 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Diagnostics; using Microsoft.CodeAnalysis.LanguageServer; using Microsoft.Extensions.Logging; -using System.Diagnostics; - Console.Title = "Microsoft.CodeAnalysis.LanguageServer"; // TODO - Decide how and where we're logging. For now just logging stderr (vscode reads stdout for LSP messages). @@ -19,10 +18,12 @@ LaunchDebuggerIfEnabled(args); -var jsonRpc = new JsonRpcServer(Console.OpenStandardInput(), Console.OpenStandardOutput(), logger); +var jsonRpc = new RoslynLanguageServer(Console.OpenStandardInput(), Console.OpenStandardOutput(), logger); await jsonRpc.StartAsync(); +return; + void LaunchDebuggerIfEnabled(string[] args) { if (args.Contains("--debug") && !Debugger.IsAttached) From 7d1daa4d6b1b6aea8f0a38f976c00f4dbd6d868c Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:21:41 -0700 Subject: [PATCH 2/8] Add build action to ensure the server builds on PRs --- .github/workflows/server-ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/server-ci.yml diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml new file mode 100644 index 000000000..335991a1e --- /dev/null +++ b/.github/workflows/server-ci.yml @@ -0,0 +1,24 @@ +name: Microsoft.CodeAnalysis.LanguageServer CI + +on: + push: + branches: [ master ] + + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - uses: actions/checkout@v2 + + - name: Install .NET Core SDK from global.json + uses: actions/setup-dotnet@v1.7.2 + with: + global-json-file: server/global.json + + - name: Build Microsoft.CodeAnalysis.LanguageServer + run: dotnet build .\server\Microsoft.CodeAnalysis.LanguageServer.sln -warnaserror From faf7a9689c59e843ee751cc3415692147760e7b9 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:23:56 -0700 Subject: [PATCH 3/8] Fix build action branches --- .github/workflows/server-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 335991a1e..f3bde2f85 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -2,10 +2,9 @@ name: Microsoft.CodeAnalysis.LanguageServer CI on: push: - branches: [ master ] + branches: [ master, feature/** ] pull_request: - branches: [ master ] jobs: build: From cd7abd61af21cd59db6154b491a748454dc0e9ee Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:25:20 -0700 Subject: [PATCH 4/8] Include additional branches in other CI --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45d45ac41..cfcad3d57 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,9 @@ name: OmniSharp-VSCode CI on: push: - branches: [ master ] + branches: [ master, feature/** ] pull_request: - branches: [ master ] jobs: build: From 850df68f27be9f6bea924fb7bcca6b3ca1d2160a Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:27:14 -0700 Subject: [PATCH 5/8] Use new version of setup-dotnet --- .github/workflows/server-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index f3bde2f85..91a82cde2 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v2 - name: Install .NET Core SDK from global.json - uses: actions/setup-dotnet@v1.7.2 + uses: actions/setup-dotnet@v3 with: global-json-file: server/global.json From d1714eed29ed494d66cf5ccf37c958a73c14b21a Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:33:00 -0700 Subject: [PATCH 6/8] Specify full version number --- server/global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/global.json b/server/global.json index ac9ad9e7a..52534e2d8 100644 --- a/server/global.json +++ b/server/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.100-rc.2" + "version": "7.0.100-rc.2.22477.23" } } \ No newline at end of file From 24364961c1d77af93955d56a7dd2324995db2bde Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:35:20 -0700 Subject: [PATCH 7/8] use unix path separator --- .github/workflows/server-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 91a82cde2..79a7a7507 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -20,4 +20,4 @@ jobs: global-json-file: server/global.json - name: Build Microsoft.CodeAnalysis.LanguageServer - run: dotnet build .\server\Microsoft.CodeAnalysis.LanguageServer.sln -warnaserror + run: dotnet build ./server/Microsoft.CodeAnalysis.LanguageServer.sln -warnaserror From fe296fab4bb70ba6c4ab83530a25f3221ba4c48a Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 20 Oct 2022 17:37:09 -0700 Subject: [PATCH 8/8] Update .github/workflows/server-ci.yml Co-authored-by: Joey Robichaud --- .github/workflows/server-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/server-ci.yml b/.github/workflows/server-ci.yml index 79a7a7507..d6ab324bd 100644 --- a/.github/workflows/server-ci.yml +++ b/.github/workflows/server-ci.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install .NET Core SDK from global.json + - name: Install .NET SDK from global.json uses: actions/setup-dotnet@v3 with: global-json-file: server/global.json