-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: language client tests * refactor: move LanguageClientManager to serviceProvider * refactor: mock JsonRpc * fix: enable ls trust
- Loading branch information
Showing
26 changed files
with
425 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using StreamJsonRpc; | ||
|
||
namespace Snyk.VisualStudio.Extension.Language; | ||
|
||
public interface IJsonRpc | ||
{ | ||
Task<T> InvokeAsync<T>(string targetName, CancellationToken cancellationToken); | ||
Task<T> InvokeWithParameterObjectAsync<T>(string targetName, object argument, CancellationToken cancellationToken); | ||
Task NotifyWithParameterObjectAsync(string targetName, object argument); | ||
event EventHandler<JsonRpcDisconnectedEventArgs> Disconnected; | ||
bool AllowModificationWhileListening { get; set; } | ||
IActivityTracingStrategy ActivityTracingStrategy { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
Snyk.VisualStudio.Extension.2022/Language/JsonRpcWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using StreamJsonRpc; | ||
|
||
namespace Snyk.VisualStudio.Extension.Language; | ||
|
||
public class JsonRpcWrapper : IJsonRpc | ||
{ | ||
private readonly JsonRpc jsonRpc; | ||
|
||
public JsonRpcWrapper(JsonRpc jsonRpc) | ||
{ | ||
this.jsonRpc = jsonRpc; | ||
} | ||
|
||
public event EventHandler<JsonRpcDisconnectedEventArgs> Disconnected | ||
{ | ||
add => jsonRpc.Disconnected += value; | ||
remove => jsonRpc.Disconnected -= value; | ||
} | ||
|
||
public bool AllowModificationWhileListening | ||
{ | ||
get => jsonRpc.AllowModificationWhileListening; | ||
set => jsonRpc.AllowModificationWhileListening = value; | ||
} | ||
|
||
public IActivityTracingStrategy ActivityTracingStrategy | ||
{ | ||
get => jsonRpc.ActivityTracingStrategy; | ||
set => jsonRpc.ActivityTracingStrategy = value; | ||
} | ||
|
||
public Task<T> InvokeAsync<T>(string targetName, CancellationToken cancellationToken) | ||
{ | ||
return jsonRpc.InvokeAsync<T>(targetName, cancellationToken); | ||
} | ||
|
||
public Task<T> InvokeWithParameterObjectAsync<T>(string targetName, object argument, CancellationToken cancellationToken) | ||
{ | ||
return jsonRpc.InvokeWithParameterObjectAsync<T>(targetName, argument, cancellationToken); | ||
} | ||
|
||
public Task NotifyWithParameterObjectAsync(string targetName, object argument) | ||
{ | ||
return jsonRpc.NotifyWithParameterObjectAsync(targetName, argument); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
Snyk.VisualStudio.Extension.2022/Service/IFeatureFlagService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Snyk.VisualStudio.Extension.Service; | ||
|
||
public interface IFeatureFlagService | ||
{ | ||
Task RefreshAsync(CancellationToken cancellationToken); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.