From 6bb3add1bece6647ad3a561c70653f1d61fd52d7 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Mon, 20 Nov 2023 23:47:06 +0100 Subject: [PATCH] shorter filename --- src/extension.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index f8f9dd2..1a32283 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -175,12 +175,13 @@ export function activate(context: vscode.ExtensionContext) { // Prefix the filename in a comment let pfx: string, sfx: string; + const fname = document.fileName.split('/').at(-1); const lang = document.languageId; const prefixes = commentPrefix; pfx = (prefixes as any)[lang][0] as string; sfx = (prefixes as any)[lang][1] as string; // FIXME: is there a more efficient way? - doc_before = pfx + ' ' + document.fileName + sfx + '\n' + doc_before; + doc_before = pfx + ' ' + fname + sfx + '\n' + doc_before; // server request object const request: llamaCompletionRequest = { @@ -221,7 +222,6 @@ export function activate(context: vscode.ExtensionContext) { } data = await response.json() as llamaData; - console.log(JSON.stringify(data)); } catch (e: any) { const err = e as TypeError;