@@ -114,22 +114,23 @@ export class RecommendationService {
114
114
)
115
115
116
116
const isInlineEdit = result . items . some ( ( item ) => item . isInlineEdit )
117
- if ( ! isInlineEdit ) {
118
- // If the suggestion is COMPLETIONS and there are more results to fetch, handle them in the background
119
- getLogger ( ) . info (
120
- 'Suggestion type is COMPLETIONS. Start fetching for more items if partialResultToken exists.'
121
- )
122
- if ( result . partialResultToken ) {
117
+
118
+ if ( result . partialResultToken ) {
119
+ if ( ! isInlineEdit ) {
120
+ // If the suggestion is COMPLETIONS and there are more results to fetch, handle them in the background
121
+ getLogger ( ) . info (
122
+ 'Suggestion type is COMPLETIONS. Start fetching for more items if partialResultToken exists.'
123
+ )
123
124
this . processRemainingRequests ( languageClient , request , result , token ) . catch ( ( error ) => {
124
125
languageClient . warn ( `Error when getting suggestions: ${ error } ` )
125
126
} )
127
+ } else {
128
+ // Skip fetching for more items if the suggesion is EDITS. If it is EDITS suggestion, only fetching for more
129
+ // suggestions when the user start to accept a suggesion.
130
+ // Save editsStreakPartialResultToken for the next EDITS suggestion trigger if user accepts.
131
+ getLogger ( ) . info ( 'Suggestion type is EDITS. Skip fetching for more items.' )
132
+ this . sessionManager . updateActiveEditsStreakToken ( result . partialResultToken )
126
133
}
127
- } else {
128
- // Skip fetching for more items if the suggesion is EDITS. If it is EDITS suggestion, only fetching for more
129
- // suggestions when the user start to accept a suggesion.
130
- // Save editsStreakPartialResultToken for the next EDITS suggestion trigger if user accepts.
131
- getLogger ( ) . info ( 'Suggestion type is EDITS. Skip fetching for more items.' )
132
- this . sessionManager . updateActiveEditsStreakToken ( result . partialResultToken )
133
134
}
134
135
} catch ( error : any ) {
135
136
getLogger ( ) . error ( 'Error getting recommendations: %O' , error )
0 commit comments