xP: implement tab completion

Currently it only goes for the longest common prefix.

Refactor WebSocket handling into an abstraction for our protocol.

The Go code generater finally needed fixing.
This commit is contained in:
2022-09-06 17:17:32 +02:00
parent 2d30b6d115
commit 8cd94b30f6
3 changed files with 218 additions and 80 deletions

View File

@@ -382,7 +382,8 @@ function codegen_union(name, cg, gotype, tagfield, tagvar) {
print "}"
print ""
print "func (u *" gotype ") MarshalJSON() ([]byte, error) {"
# This cannot be a pointer method, it wouldn't work recursively.
print "func (u " gotype ") MarshalJSON() ([]byte, error) {"
print "\treturn json.Marshal(u.Interface)"
print "}"
print ""