File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import {
3434 vsCodeState ,
3535 inlineCompletionsDebounceDelay ,
3636 noInlineSuggestionsMsg ,
37+ referenceAcceptedMsg ,
3738} from 'aws-core-vscode/codewhisperer'
3839import { InlineGeneratingMessage } from './inlineGeneratingMessage'
3940import { LineTracker } from './stateTracker/lineTracker'
@@ -87,6 +88,17 @@ export class InlineCompletionManager implements Disposable {
8788 }
8889 }
8990
91+ private showReferenceMessage ( ) {
92+ void messageUtils . showMessage ( 'info' , referenceAcceptedMsg , [ 'Open Code Reference Log' ] ) . then ( ( ) =>
93+ commands . executeCommand ( 'aws.amazonq.openReferencePanel' ) . then (
94+ ( ) => { } ,
95+ ( ) => {
96+ getLogger ( ) . warn ( 'Failed to open code reference log' )
97+ }
98+ )
99+ )
100+ }
101+
90102 public registerInlineCompletion ( ) {
91103 const onInlineAcceptance = async (
92104 sessionId : string ,
@@ -123,6 +135,7 @@ export class InlineCompletionManager implements Disposable {
123135 )
124136 ReferenceLogViewProvider . instance . addReferenceLog ( referenceLog )
125137 ReferenceHoverProvider . instance . addCodeReferences ( item . insertText as string , item . references )
138+ this . showReferenceMessage ( )
126139 }
127140 if ( item . mostRelevantMissingImports ?. length ) {
128141 await ImportAdderProvider . instance . onAcceptRecommendation ( editor , item , startLine )
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export const showReferenceLog = Commands.declare(
145145 if ( _ !== placeholder ) {
146146 source = 'ellipsesMenu'
147147 }
148- await vscode . commands . executeCommand ( 'workbench.view.extension.aws-codewhisperer-reference-log' )
148+ await vscode . commands . executeCommand ( ` ${ ReferenceLogViewProvider . viewType } .focus` )
149149 }
150150)
151151
Original file line number Diff line number Diff line change @@ -157,6 +157,9 @@ export const runningFileScan = 'Reviewing current file for code issues...'
157157
158158export const noInlineSuggestionsMsg = 'No suggestions from Amazon Q'
159159
160+ export const referenceAcceptedMsg =
161+ 'Amazon Q accepted a suggestion with a reference, see Code Reference Log for more info.'
162+
160163export const licenseFilter = 'Amazon Q suggestions were filtered due to reference settings'
161164
162165/**
You can’t perform that action at this time.
0 commit comments