-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from alephium/trace_setting
Enable trace setting (VSCode)
- Loading branch information
Showing
7 changed files
with
76 additions
and
6 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
25 changes: 25 additions & 0 deletions
25
lsp-server/src/main/scala/org/alephium/ralph/lsp/server/state/Trace.scala
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,25 @@ | ||
package org.alephium.ralph.lsp.server.state | ||
|
||
import org.alephium.ralph.lsp.server.ResponseError.InvalidTraceSetting | ||
|
||
/** | ||
* @see [[org.eclipse.lsp4j.TraceValue]]. | ||
*/ | ||
sealed trait Trace | ||
object Trace { | ||
case object Off extends Trace | ||
case object Messages extends Trace | ||
case object Verbose extends Trace | ||
|
||
def apply(string: String): Either[InvalidTraceSetting, Trace] = | ||
if (string == null) | ||
Right(Trace.Off) | ||
else if (string equalsIgnoreCase Trace.Off.productPrefix) | ||
Right(Trace.Off) | ||
else if (string equalsIgnoreCase Trace.Messages.productPrefix) | ||
Right(Trace.Messages) | ||
else if (string equalsIgnoreCase Trace.Verbose.productPrefix) | ||
Right(Trace.Verbose) | ||
else | ||
Left(InvalidTraceSetting(string)) | ||
} |
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