Merge pull request #2794 from glm1024/2335-autocomplete-jsonl
1.Add a timestamp attribute to the file autocomplete.jsonl. 2.Fix the…
This commit is contained in:
commit
56b19b4344
2 changed files with 10 additions and 2 deletions
|
|
@ -89,6 +89,7 @@ export interface AutocompleteOutcome extends TabAutocompleteOptions {
|
|||
gitRepo?: string;
|
||||
completionId: string;
|
||||
uniqueId: string;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
const autocompleteCache = AutocompleteLruCache.get();
|
||||
|
|
@ -372,6 +373,12 @@ export class CompletionProvider {
|
|||
}
|
||||
}, 100);
|
||||
|
||||
// When using the JetBrains extension, Mark as displayed
|
||||
const ideType = (await this.ide.getIdeInfo()).ideType;
|
||||
if (ideType === "jetbrains") {
|
||||
this.markDisplayed(input.completionId, outcome);
|
||||
}
|
||||
|
||||
return outcome;
|
||||
} catch (e: any) {
|
||||
this.onError(e);
|
||||
|
|
@ -763,6 +770,7 @@ export class CompletionProvider {
|
|||
}
|
||||
|
||||
const time = Date.now() - startTime;
|
||||
const timestamp = Date.now();
|
||||
return {
|
||||
time,
|
||||
completion,
|
||||
|
|
@ -777,6 +785,7 @@ export class CompletionProvider {
|
|||
completionId: input.completionId,
|
||||
gitRepo: await this.ide.getRepoName(input.filepath),
|
||||
uniqueId: await this.ide.getUniqueId(),
|
||||
timestamp: timestamp,
|
||||
...options,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,10 +192,9 @@ class AutocompleteService(private val project: Project) {
|
|||
|
||||
editor.caretModel.moveToOffset(offset + text.length)
|
||||
|
||||
|
||||
project.service<ContinuePluginService>().coreMessenger?.request(
|
||||
"autocomplete/accept",
|
||||
completion.completionId,
|
||||
hashMapOf("completionId" to completion.completionId),
|
||||
null,
|
||||
({})
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue