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
using System; | |
using Mirage; | |
using NetworkCore; | |
using Unity.VisualScripting; | |
using UnityEditor; | |
using UnityEditor.Rendering; | |
using UnityEditor.UIElements; | |
using UnityEngine; | |
using UnityEngine.UIElements; |
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
using System; | |
using System.Collections.Generic; | |
using System.Threading; | |
using Cysharp.Threading.Tasks; | |
using Cysharp.Threading.Tasks.Linq; | |
using Mirage; | |
using Mirage.Collections; | |
using Mirage.Serialization; | |
namespace NetworkCore |
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
public class SyncLink<T> : AsyncReactiveProperty<T>, ISyncObject where T : NetworkBehaviour | |
{ | |
private uint _netId; | |
private CancellationTokenSource _ct; | |
private static readonly EqualityComparer<T> Comparer = EqualityComparer<T>.Default; | |
public bool HasValue => !Comparer.Equals(Value, null); | |
public SyncLink() : this(default) | |
{ | |
_netId = 0; |
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
[error] (run-main-0) org.scalameta.invariants.InvariantFailedException: invariant failed: | |
[error] when verifying ScalametaTokenizer.this.input.chars.apply(curr.endOffset.+(1)).==('\"') | |
[error] found that ScalametaTokenizer.this.input.chars.apply(curr.endOffset.+(1)) is not equal to '\"' | |
[error] where ScalametaTokenizer = scala.meta.internal.tokenizers.ScalametaTokenizer@4ec60877 | |
org.scalameta.invariants.InvariantFailedException: invariant failed: | |
when verifying ScalametaTokenizer.this.input.chars.apply(curr.endOffset.+(1)).==('\"') | |
found that ScalametaTokenizer.this.input.chars.apply(curr.endOffset.+(1)) is not equal to '\"' | |
where ScalametaTokenizer = scala.meta.internal.tokenizers.ScalametaTokenizer@4ec60877 | |
at org.scalameta.invariants.InvariantFailedException$.raise(Exceptions.scala:15) | |
at scala.meta.internal.tokenizers.ScalametaTokenizer.emitContents$1(ScalametaTokenizer.scala:223) |
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
def isCaseClass(tree: Tree): Boolean = { | |
tree.is[Defn.Class] && tree.children.exists(_.is[Mod.Case]) || | |
tree.parent.exists(_.is[Defn.Class]) && tree.parent.exists(_.children.exists(_.is[Mod.Case])) | |
} | |
def isCaseObject(tree: Tree): Boolean = { | |
tree.is[Defn.Object] && tree.children.exists(_.is[Mod.Case]) || | |
tree.parent.exists(_.is[Defn.Object]) && tree.parent.exists(_.children.exists(_.is[Mod.Case])) | |
} |
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
val template = s""" | |
|trait RouteTrait extends ExtendedController with SimpleRouter with OptionalAuthElement with AuthConfigImpl with Circe { | |
| def routes: Router.Routes = { | |
| | |
| case GET(p"/pets" ? q_o"tags=$$tags" ? q_o"limit=$$limit") => AsyncStack { implicit request => | |
| constructResult(findPets(tags, limit)) | |
| } | |
| | |
| case POST(p"/pets") => AsyncStack(circe.json) { implicit request => | |
| constructResult(addPet()) |
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
val root = "/pets" | |
val template = s""" | |
|object Bug { | |
| | |
| def router = { | |
| case GET(p"$root" ? q_o"tags=$$tags" ? q_o"limit=$$limit") | |
| } | |
|} | |
| |
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
package components | |
import japgolly.scalajs.react._ | |
import japgolly.scalajs.react.vdom.prefix_<^._ | |
import scala.collection.mutable.ListBuffer | |
import scalacss.Defaults._ | |
import scalacss.ScalaCssReact._ | |
import scalacss.mutable.StyleSheet |