|
|
@ -4,7 +4,8 @@ try { |
|
|
|
console.log("start") |
|
|
|
const vscode = require("vscode") |
|
|
|
const fs = require("fs") |
|
|
|
var path = require('path'); |
|
|
|
const path = require('path'); |
|
|
|
const cp = require("child_process"); |
|
|
|
|
|
|
|
let start = vscode.window.activeTextEditor.selection.start.line |
|
|
|
let fileName = vscode.window.activeTextEditor.document.fileName |
|
|
@ -144,16 +145,20 @@ try { |
|
|
|
|
|
|
|
let crudFileName = path.join(fileDir, `auto_generated_crud_${struct}_${fileBaseName}`) |
|
|
|
|
|
|
|
let httpFileName = path.join(fileDir, `auto_generated_http_${underscore_naming}_${struct}_${fileBaseName}`) |
|
|
|
let httpFileName = path.join(fileDir, `auto_generated_http_crud_${underscore_naming}_${struct}_${fileBaseName}`) |
|
|
|
|
|
|
|
fs.writeFile(crudFileName, `${package_src}\n\n${tmp[2]}`, function () { |
|
|
|
|
|
|
|
cp.exec(`gopls fix -a -w ${crudFileName}`, function () { }) |
|
|
|
}) |
|
|
|
|
|
|
|
fs.writeFile(httpFileName, `${package_src}\n\n${tmp[3]}`, function () { |
|
|
|
|
|
|
|
cp.exec(`gopls fix -a -w ${httpFileName}`, function () { }) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
cp.exec(`gopls fix -a -w ${fileName}`, function () { }) |
|
|
|
|
|
|
|
|
|
|
|
// vscode.window.showErrorMessage(res)
|
|
|
|
}).catch(error => { |
|
|
|
|
|
|
|