shorter filename

master
Alessandro Mauri 1 year ago
parent 3b8a74a2d8
commit 6bb3add1be
  1. 4
      src/extension.ts

@ -175,12 +175,13 @@ export function activate(context: vscode.ExtensionContext) {
// Prefix the filename in a comment // Prefix the filename in a comment
let pfx: string, sfx: string; let pfx: string, sfx: string;
const fname = document.fileName.split('/').at(-1);
const lang = document.languageId; const lang = document.languageId;
const prefixes = commentPrefix; const prefixes = commentPrefix;
pfx = (prefixes as any)[lang][0] as string; pfx = (prefixes as any)[lang][0] as string;
sfx = (prefixes as any)[lang][1] as string; sfx = (prefixes as any)[lang][1] as string;
// FIXME: is there a more efficient way? // 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 // server request object
const request: llamaCompletionRequest = { const request: llamaCompletionRequest = {
@ -221,7 +222,6 @@ export function activate(context: vscode.ExtensionContext) {
} }
data = await response.json() as llamaData; data = await response.json() as llamaData;
console.log(JSON.stringify(data));
} catch (e: any) { } catch (e: any) {
const err = e as TypeError; const err = e as TypeError;

Loading…
Cancel
Save