From 21bacce8dbba3837a363aeb47ba8aefd262295a4 Mon Sep 17 00:00:00 2001 From: axetroy Date: Thu, 6 Feb 2020 18:45:56 +0800 Subject: [PATCH] fix: create a local module if is not relative or absolute path --- client/src/extension.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/src/extension.ts b/client/src/extension.ts index 393b950..17ba7ad 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -625,6 +625,15 @@ Executable ${this.denoInfo.executablePath}`; return; } + if (text.indexOf(".") !== 0 || text.indexOf("/") !== 0) { + this.output.appendLine( + `Cannot create module \`${text + }\`. Module is not relative or absolute` + ); + this.output.show(); + return; + } + let defaultTextContent = ""; switch (extName) {