|
|
@ -1,6 +1,18 @@ |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
function goplsfix(path) { |
|
|
|
|
|
|
|
axios.post(url, { |
|
|
|
path: path, |
|
|
|
}).then(res => { |
|
|
|
}).catch(error => { |
|
|
|
console.log("fix:", error); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const url = vscode.workspace.getConfiguration().get('go-vscode-config.url'); |
|
|
|
|
|
|
|
console.log("start") |
|
|
|
const vscode = require("vscode") |
|
|
|
const fs = require("fs") |
|
|
@ -148,29 +160,17 @@ try { |
|
|
|
let httpFileName = path.join(fileDir, `auto_generated_http_crud_${underscore_naming}_${struct}_${fileBaseName}`) |
|
|
|
|
|
|
|
fs.writeFile(crudFileName, `${package_src}\n\n${tmp[2]}`, function () { |
|
|
|
setTimeout(function () { |
|
|
|
goplsfix(crudFileName); |
|
|
|
|
|
|
|
cp.exec(`gopls fix -a -w ${crudFileName}`, function (a, b, c) { |
|
|
|
console.log("exec:", a, b, c) |
|
|
|
}) |
|
|
|
}, 1000) |
|
|
|
}) |
|
|
|
|
|
|
|
fs.writeFile(httpFileName, `${package_src}\n\n${tmp[3]}`, function () { |
|
|
|
setTimeout(function () { |
|
|
|
cp.exec(`gopls fix -a -w ${httpFileName}`, function (a, b, c) { |
|
|
|
console.log("exec:", a, b, c) |
|
|
|
}) |
|
|
|
}, 1000) |
|
|
|
}) |
|
|
|
|
|
|
|
goplsfix(httpFileName); |
|
|
|
}) |
|
|
|
|
|
|
|
setTimeout(function () { |
|
|
|
cp.exec(`gopls fix -a -w ${fileName}`, function (a, b, c) { |
|
|
|
console.log("exec:", a, b, c) |
|
|
|
}) |
|
|
|
|
|
|
|
}, 1000) |
|
|
|
goplsfix(fileName); |
|
|
|
|
|
|
|
// vscode.window.showErrorMessage(res)
|
|
|
|
}).catch(error => { |
|
|
|