Skip to content

Commit

Permalink
feat(audoedit): rename logSummary to contextSummary to match the …
Browse files Browse the repository at this point in the history
…type name
  • Loading branch information
valerybugakov committed Jan 6, 2025
1 parent 4eecd1c commit d10b9ae
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions vscode/src/completions/context/context-mixer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ describe('ContextMixer', () => {
strategyFactory: createMockStrategy([]),
contextRankingStrategy: ContextRankingStrategy.Default,
})
const { context, logSummary } = await mixer.getContext(defaultOptions)
const { context, contextSummary } = await mixer.getContext(defaultOptions)

expect(normalize(context)).toEqual([])
expect(logSummary).toEqual({
expect(contextSummary).toEqual({
duration: 0,
retrieverStats: {},
strategy: 'none',
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('ContextMixer', () => {
]),
contextRankingStrategy: ContextRankingStrategy.Default,
})
const { context, logSummary } = await mixer.getContext(defaultOptions)
const { context, contextSummary } = await mixer.getContext(defaultOptions)
expect(normalize(context)).toEqual([
{
fileName: 'foo.ts',
Expand All @@ -134,7 +134,7 @@ describe('ContextMixer', () => {
type: 'file',
},
])
expect(logSummary).toEqual({
expect(contextSummary).toEqual({
duration: expect.any(Number),
retrieverStats: {
'jaccard-similarity': {
Expand Down Expand Up @@ -205,7 +205,7 @@ describe('ContextMixer', () => {
]),
contextRankingStrategy: ContextRankingStrategy.Default,
})
const { context, logSummary } = await mixer.getContext(defaultOptions)
const { context, contextSummary } = await mixer.getContext(defaultOptions)

// The results have overlaps in `foo.ts` and `bar.ts`. `foo.ts` is ranked higher in both
// result sets, thus we expect the overlapping `foo.ts` ranges to appear first.
Expand Down Expand Up @@ -256,7 +256,7 @@ describe('ContextMixer', () => {
},
]
`)
expect(logSummary).toEqual({
expect(contextSummary).toEqual({
duration: expect.any(Number),
retrieverStats: {
retriever1: {
Expand Down Expand Up @@ -422,7 +422,7 @@ describe('ContextMixer', () => {
]

setupTest(primaryRetrievers, loggingRetrievers)
const { context, logSummary, contextLoggingSnippets } =
const { context, contextSummary, contextLoggingSnippets } =
await mixer.getContext(defaultOptions)

expect(normalize(context)).toEqual([
Expand All @@ -441,7 +441,7 @@ describe('ContextMixer', () => {
endLine: 0,
},
])
expect(logSummary).toEqual({
expect(contextSummary).toEqual({
duration: expect.any(Number),
retrieverStats: {
retriever1: {
Expand Down
10 changes: 5 additions & 5 deletions vscode/src/completions/context/context-mixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export interface ContextSummary {

export interface GetContextResult {
context: AutocompleteContextSnippet[]
logSummary: ContextSummary
contextSummary: ContextSummary
contextLoggingSnippets: AutocompleteContextSnippet[]
}

Expand Down Expand Up @@ -114,7 +114,7 @@ export class ContextMixer implements vscode.Disposable {
if (retrieversWithDataLogging.length === 0) {
return {
context: [],
logSummary: {
contextSummary: {
strategy: 'none',
totalChars: options.docContext.prefix.length + options.docContext.suffix.length,
prefixChars: options.docContext.prefix.length,
Expand Down Expand Up @@ -165,7 +165,7 @@ export class ContextMixer implements vscode.Disposable {
if (results.length === 0) {
return {
context: [],
logSummary: {
contextSummary: {
strategy: 'none',
totalChars: options.docContext.prefix.length + options.docContext.suffix.length,
prefixChars: options.docContext.prefix.length,
Expand Down Expand Up @@ -225,7 +225,7 @@ export class ContextMixer implements vscode.Disposable {
position++
}

const logSummary: ContextSummary = {
const contextSummary: ContextSummary = {
strategy,
duration: performance.now() - start,
totalChars,
Expand All @@ -236,7 +236,7 @@ export class ContextMixer implements vscode.Disposable {

return {
context: mixedContext,
logSummary,
contextSummary,
contextLoggingSnippets,
}
}
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/completions/get-inline-completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ async function doGetInlineCompletions(
],
})

CompletionAnalyticsLogger.networkRequestStarted(logId, contextResult?.logSummary)
CompletionAnalyticsLogger.networkRequestStarted(logId, contextResult?.contextSummary)
stageRecorder.record('preNetworkRequest')

// Get the processed completions from providers
Expand Down
2 changes: 1 addition & 1 deletion vscode/src/completions/tracer/traceView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ ${markdownList({ ...otherOptions, completionIntent: completionIntent || 'unknown
: `
## Context
${data.context ? markdownList(data.context.logSummary) : ''}
${data.context ? markdownList(data.context.contextSummary) : ''}
${
data.context === null || data.context.context.length === 0
Expand Down

0 comments on commit d10b9ae

Please sign in to comment.