Skip to content

Commit

Permalink
Merge pull request dotnet#37 from dibarbet/add_build_action
Browse files Browse the repository at this point in the history
Add build action to ensure server builds on PRs
  • Loading branch information
dibarbet authored Oct 21, 2022
2 parents 3a7fc2c + fe296fa commit 08e2456
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: OmniSharp-VSCode CI

on:
push:
branches: [ master ]
branches: [ master, feature/** ]

pull_request:
branches: [ master ]

jobs:
build:
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/server-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Microsoft.CodeAnalysis.LanguageServer CI

on:
push:
branches: [ master, feature/** ]

pull_request:

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v2

- name: Install .NET SDK from global.json
uses: actions/setup-dotnet@v3
with:
global-json-file: server/global.json

- name: Build Microsoft.CodeAnalysis.LanguageServer
run: dotnet build ./server/Microsoft.CodeAnalysis.LanguageServer.sln -warnaserror
5 changes: 3 additions & 2 deletions server/Microsoft.CodeAnalysis.LanguageServer/JsonRpcServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 4 additions & 3 deletions server/Microsoft.CodeAnalysis.LanguageServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion server/global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "7.0.100-rc.2"
"version": "7.0.100-rc.2.22477.23"
}
}

0 comments on commit 08e2456

Please sign in to comment.