shorter filename
This commit is contained in:
parent
3b8a74a2d8
commit
6bb3add1be
@ -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…
Reference in New Issue
Block a user