From d7a1560940e5759fd3f5395425e332b76ed00aa1 Mon Sep 17 00:00:00 2001 From: public_host Date: Mon, 19 Apr 2021 18:58:45 +0800 Subject: [PATCH] fix --- hasaki-gen-crud.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/hasaki-gen-crud.js b/hasaki-gen-crud.js index 3937438..6c55860 100644 --- a/hasaki-gen-crud.js +++ b/hasaki-gen-crud.js @@ -1,13 +1,20 @@ -const vscode = require("vscode") -const fs = require("fs") -let start = vscode.window.activeTextEditor.document.lineCount -let fileName = vscode.window.activeTextEditor.document.fileName +try { -console.log(start) -console.log(fileName) -var context = fs.readFileSync(fileName) + const vscode = require("vscode") + const fs = require("fs") -var context_arr = context.split("\n") -console.log(context) -console.log(context_arr[start]) \ No newline at end of file + let start = vscode.window.activeTextEditor.document.lineCount + let fileName = vscode.window.activeTextEditor.document.fileName + + console.log(start) + console.log(fileName) + var context = fs.readFileSync(fileName) + + var context_arr = context.split("\n") + console.log(context) + console.log(context_arr[start]) +} catch (error) { + + console.log(error) +} \ No newline at end of file