This commit is contained in:
parent
373f3071cb
commit
cef9652fae
|
@ -211,6 +211,9 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
glog.Warning(string(out))
|
glog.Warning(string(out))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
} else { // 构建失败
|
||||||
|
// 解析错误信息,返回给编辑器 gutter lint
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
channelRet := map[string]interface{}{}
|
channelRet := map[string]interface{}{}
|
||||||
|
|
|
@ -177,7 +177,7 @@ var editors = {
|
||||||
|
|
||||||
editor.setOption("gutters", ["CodeMirror-lint-markers", "CodeMirror-foldgutter"]);
|
editor.setOption("gutters", ["CodeMirror-lint-markers", "CodeMirror-foldgutter"]);
|
||||||
|
|
||||||
if ("application/json" === data.mode) {
|
if ("text/x-go" === data.mode || "application/json" === data.mode) {
|
||||||
editor.setOption("lint", true);
|
editor.setOption("lint", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
(function(mod) {
|
||||||
|
mod(CodeMirror);
|
||||||
|
})(function(CodeMirror) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
CodeMirror.registerHelper("lint", "go", function(text) {
|
||||||
|
var found = [];
|
||||||
|
|
||||||
|
found.push({from: CodeMirror.Pos(1, 1),
|
||||||
|
to: CodeMirror.Pos(1, 10),
|
||||||
|
message: "test commpile err"});
|
||||||
|
|
||||||
|
return found;
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
|
@ -123,6 +123,7 @@
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/sql/sql.js"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lib/codemirror-4.5/mode/sql/sql.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lint/json-lint.js?{{.Wide.StaticResourceVersion}}"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lint/json-lint.js?{{.Wide.StaticResourceVersion}}"></script>
|
||||||
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/lint/go-lint.js?{{.Wide.StaticResourceVersion}}"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/tabs.js?{{.Wide.StaticResourceVersion}}"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/tabs.js?{{.Wide.StaticResourceVersion}}"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/editor.js?{{.Wide.StaticResourceVersion}}"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/editor.js?{{.Wide.StaticResourceVersion}}"></script>
|
||||||
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/tree.js?{{.Wide.StaticResourceVersion}}"></script>
|
<script type="text/javascript" src="{{.Wide.StaticServer}}/static/js/tree.js?{{.Wide.StaticResourceVersion}}"></script>
|
||||||
|
|
Loading…
Reference in New Issue