diff --git a/editor/editors.go b/editor/editors.go index cac87d2..a22392e 100644 --- a/editor/editors.go +++ b/editor/editors.go @@ -103,6 +103,8 @@ func AutocompleteHandler(w http.ResponseWriter, r *http.Request) { username := session.Values["username"].(string) code := args["code"].(string) + // TODO: 保存文件 + line := int(args["cursorLine"].(float64)) ch := int(args["cursorCh"].(float64)) diff --git a/editor/formatter.go b/editor/formatter.go index d42c48b..77d6e02 100644 --- a/editor/formatter.go +++ b/editor/formatter.go @@ -11,6 +11,7 @@ import ( "github.com/golang/glog" ) +// gofmt 格式化 Go 源码文件. func GoFmtHandler(w http.ResponseWriter, r *http.Request) { data := map[string]interface{}{"succ": true} defer util.RetJSON(w, r, data) @@ -71,6 +72,7 @@ func GoFmtHandler(w http.ResponseWriter, r *http.Request) { } } +// 格式化 HTML 文件. func HTMLFmtHandler(w http.ResponseWriter, r *http.Request) { data := map[string]interface{}{"succ": true} defer util.RetJSON(w, r, data) @@ -127,6 +129,7 @@ func HTMLFmtHandler(w http.ResponseWriter, r *http.Request) { } } +// 格式化 JSON 文件. func JSONFmtHandler(w http.ResponseWriter, r *http.Request) { data := map[string]interface{}{"succ": true} defer util.RetJSON(w, r, data)