File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
core/src/codewhisperer/models Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "type" : " Bug Fix" ,
3+ "description" : " Slighlty delay rendering inline completion when user is typing"
4+ }
Original file line number Diff line number Diff line change @@ -386,6 +386,20 @@ ${itemLog}
386386 return [ ]
387387 }
388388
389+ // delay the suggestion rendeing if user is actively typing
390+ // see https://github.com/aws/aws-toolkit-vscode/commit/a537602a96f498f372ed61ec9d82cf8577a9d854
391+ for ( let i = 0 ; i < 30 ; i ++ ) {
392+ const lastDocumentChange = this . documentEventListener . getLastDocumentChangeEvent ( document . uri . fsPath )
393+ if (
394+ lastDocumentChange &&
395+ performance . now ( ) - lastDocumentChange . timestamp < CodeWhispererConstants . inlineSuggestionShowDelay
396+ ) {
397+ await sleep ( CodeWhispererConstants . showRecommendationTimerPollPeriod )
398+ } else {
399+ break
400+ }
401+ }
402+
389403 // the user typed characters from invoking suggestion cursor position to receiving suggestion position
390404 const typeahead = document . getText ( new Range ( position , editor . selection . active ) )
391405
Original file line number Diff line number Diff line change @@ -184,6 +184,9 @@ export const identityPoolID = 'us-east-1:70717e99-906f-4add-908c-bd9074a2f5b9'
184184 */
185185export const inlineCompletionsDebounceDelay = 200
186186
187+ // add 200ms more delay on top of inline default 30-50ms
188+ export const inlineSuggestionShowDelay = 200
189+
187190export const referenceLog = 'Code Reference Log'
188191
189192export const suggestionDetailReferenceText = ( licenses : string ) =>
You can’t perform that action at this time.
0 commit comments