chore: remove console logs and add timer
This commit is contained in:
parent
007f40948e
commit
4f7ec0dc13
3 changed files with 16 additions and 17 deletions
|
|
@ -103,7 +103,7 @@ export class NextEditProvider {
|
|||
if (!other) return undefined;
|
||||
// render prompt
|
||||
// TODO: this has to set the editable region properly.
|
||||
console.log("fetchfunction - previousData:", previousData?.completion);
|
||||
// console.log("fetchfunction - previousData:", previousData?.completion);
|
||||
const promptMetadata = renderPrompt(
|
||||
other.helper,
|
||||
other.diffContext,
|
||||
|
|
|
|||
|
|
@ -89,15 +89,15 @@ export function renderPrompt(
|
|||
// TODO: apply prevOutcome to existing content. we will need the line range.
|
||||
// Also display the diff between existing content and applied content.
|
||||
if (prevOutcome) {
|
||||
console.log(
|
||||
"beforeInsert:",
|
||||
helper.fileLines.slice(0, prevOutcome?.editableRegionStartLine),
|
||||
);
|
||||
console.log("toInsert: ", prevOutcome?.completion.split("\n"));
|
||||
console.log(
|
||||
"afterInsert:",
|
||||
helper.fileLines.slice(prevOutcome?.editableRegionEndLine),
|
||||
);
|
||||
// console.log(
|
||||
// "beforeInsert:",
|
||||
// helper.fileLines.slice(0, prevOutcome?.editableRegionStartLine),
|
||||
// );
|
||||
// console.log("toInsert: ", prevOutcome?.completion.split("\n"));
|
||||
// console.log(
|
||||
// "afterInsert:",
|
||||
// helper.fileLines.slice(prevOutcome?.editableRegionEndLine),
|
||||
// );
|
||||
let appliedContent = [
|
||||
...helper.fileLines.slice(0, prevOutcome?.editableRegionStartLine),
|
||||
...(prevOutcome?.completion.split("\n") ?? []),
|
||||
|
|
@ -106,7 +106,7 @@ export function renderPrompt(
|
|||
// console.log("helper.fileContents:", helper.fileContents);
|
||||
// TODO: I'm not sure, but <|user_cursor_is_here|> is somehow being added to appliedContent.
|
||||
// The individual parts don't contain this.
|
||||
console.log("appliedContent:", appliedContent);
|
||||
// console.log("appliedContent:", appliedContent);
|
||||
appliedContent = appliedContent.filter(
|
||||
(line) => !line.includes(USER_CURSOR_IS_HERE_TOKEN),
|
||||
);
|
||||
|
|
@ -117,7 +117,7 @@ export function renderPrompt(
|
|||
appliedContent,
|
||||
prevOutcome.finalCursorPosition,
|
||||
);
|
||||
console.log("new editedCodeWithTokens:", editedCodeWithTokens);
|
||||
// console.log("new editedCodeWithTokens:", editedCodeWithTokens);
|
||||
userEdits = createDiff({
|
||||
beforeContent: helper.fileContents,
|
||||
afterContent: appliedContent.join("\n"),
|
||||
|
|
@ -126,7 +126,7 @@ export function renderPrompt(
|
|||
contextLines: 3,
|
||||
});
|
||||
userEdits = userEdits.replace(USER_CURSOR_IS_HERE_TOKEN, "");
|
||||
console.log("new userDiff:", userEdits);
|
||||
// console.log("new userDiff:", userEdits);
|
||||
} else {
|
||||
editedCodeWithTokens = insertTokens(
|
||||
helper.fileContents.split("\n"),
|
||||
|
|
|
|||
|
|
@ -241,10 +241,13 @@ export class ContinueCompletionProvider
|
|||
|
||||
// Check if editChainId exists or needs to be refreshed.
|
||||
if (this.isNextEditActive) {
|
||||
const st = performance.now();
|
||||
outcome = await this.nextEditProvider.provideNextEditPrediction(
|
||||
input,
|
||||
signal,
|
||||
);
|
||||
console.log(performance.now() - st);
|
||||
console.log(outcome?.elapsed);
|
||||
} else {
|
||||
outcome = await this.completionProvider.provideInlineCompletionItems(
|
||||
input,
|
||||
|
|
@ -270,10 +273,6 @@ export class ContinueCompletionProvider
|
|||
return null;
|
||||
}
|
||||
|
||||
console.log("======");
|
||||
console.log(outcome.completion);
|
||||
console.log("======");
|
||||
|
||||
// VS Code displays dependent on selectedCompletionInfo (their docstring below)
|
||||
// We should first always make sure we have a valid completion, but if it goes wrong we
|
||||
// want telemetry to be correct
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue