Merge pull request #552 from devchat-ai/update_code_completion_event
Refactor subproject commit in gui and add IDE and language information to log event requests
This commit is contained in:
commit
58e6bc5a4f
2
gui
2
gui
@ -1 +1 @@
|
|||||||
Subproject commit 808bf945e263cebfdcbbd60696bae84f2a6d594d
|
Subproject commit a01e04ad8186404ec05a5ebe7cb20786364341a7
|
@ -1,4 +1,5 @@
|
|||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
import { logger } from '../../util/logger';
|
import { logger } from '../../util/logger';
|
||||||
import Debouncer from './debouncer';
|
import Debouncer from './debouncer';
|
||||||
@ -45,6 +46,8 @@ interface LogEventRequest {
|
|||||||
type: string; // "view", "select"
|
type: string; // "view", "select"
|
||||||
lines: number;
|
lines: number;
|
||||||
length: number; // length of code completed
|
length: number; // length of code completed
|
||||||
|
ide: string;
|
||||||
|
language: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class InlineCompletionProvider implements vscode.InlineCompletionItemProvider {
|
export class InlineCompletionProvider implements vscode.InlineCompletionItemProvider {
|
||||||
@ -245,7 +248,9 @@ export class InlineCompletionProvider implements vscode.InlineCompletionItemProv
|
|||||||
completion_id: response.id,
|
completion_id: response.id,
|
||||||
type: "view",
|
type: "view",
|
||||||
lines: response.code.split('\n').length,
|
lines: response.code.split('\n').length,
|
||||||
length: response.code.length
|
length: response.code.length,
|
||||||
|
ide: "vscode",
|
||||||
|
language: path.extname(document.uri.fsPath).toLowerCase().slice(1)
|
||||||
});
|
});
|
||||||
// log to server
|
// log to server
|
||||||
|
|
||||||
@ -266,7 +271,9 @@ export class InlineCompletionProvider implements vscode.InlineCompletionItemProv
|
|||||||
completion_id: response!.id,
|
completion_id: response!.id,
|
||||||
type: "select",
|
type: "select",
|
||||||
lines: response!.code.split('\n').length,
|
lines: response!.code.split('\n').length,
|
||||||
length: response!.code.length
|
length: response!.code.length,
|
||||||
|
ide: "vscode",
|
||||||
|
language: path.extname(document.uri.fsPath).toLowerCase().slice(1)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user