-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'anytext' into LSP-folding-ranges
- Loading branch information
Showing
11 changed files
with
138 additions
and
26 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using LspTypes; | ||
using Newtonsoft.Json.Linq; | ||
using System.Diagnostics; | ||
|
||
namespace NMF.AnyText | ||
{ | ||
public partial class LspServer | ||
{ | ||
/// <inheritdoc cref="ILspServer.SetTrace"/> | ||
public void SetTrace(JToken arg) | ||
{ | ||
var setTraceParams = arg.ToObject<SetTraceParams>(); | ||
|
||
UpdateTraceSource(setTraceParams.Value); | ||
SendLogMessage(MessageType.Info, $"Trace level updated to: {setTraceParams.Value}"); | ||
} | ||
|
||
private void UpdateTraceSource(TraceValue traceValue) | ||
{ | ||
_rpc.TraceSource = | ||
AnyTextJsonRpcServerUtil.CreateTraceSource(MapTraceValueToSourceLevels(traceValue)); | ||
} | ||
private static SourceLevels MapTraceValueToSourceLevels(TraceValue traceValue) | ||
{ | ||
return traceValue switch | ||
{ | ||
TraceValue.Off => SourceLevels.Off, | ||
TraceValue.Messages => SourceLevels.Information, | ||
TraceValue.Verbose => SourceLevels.Verbose, | ||
_ => SourceLevels.All | ||
}; | ||
} | ||
} | ||
} |
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