@@ -1850,9 +1850,25 @@ ${contents}
18501850 const commentThread = isThread ? comment : comment . parent ;
18511851 const firstComment = isThread ? comment . comments [ 0 ] : comment ;
18521852 commentThread . collapsibleState = vscode . CommentThreadCollapsibleState . Collapsed ;
1853- const message = firstComment instanceof GHPRComment ? firstComment . rawComment . body
1853+ const commentBody = firstComment instanceof GHPRComment ? firstComment . rawComment . body
18541854 : ( firstComment . body instanceof vscode . MarkdownString ? firstComment . body . value : firstComment . body ) ;
18551855
1856+ const filePath = firstComment instanceof GHPRComment ? firstComment . rawComment . path : undefined ;
1857+ const range = commentThread . range ;
1858+ let message : string ;
1859+ if ( filePath && range ) {
1860+ const startLine = range . start . line + 1 ;
1861+ const endLine = range . end . line + 1 ;
1862+ const lineRef = startLine === endLine
1863+ ? vscode . l10n . t ( 'line {0}' , startLine )
1864+ : vscode . l10n . t ( 'lines {0}-{1}' , startLine , endLine ) ;
1865+ message = vscode . l10n . t ( 'There is a code review comment for file {0} at {1}:\n{2}' , filePath , lineRef , commentBody ) ;
1866+ } else if ( filePath ) {
1867+ message = vscode . l10n . t ( 'There is a code review comment for file {0}:\n{1}' , filePath , commentBody ) ;
1868+ } else {
1869+ message = commentBody ;
1870+ }
1871+
18561872 if ( isThread ) {
18571873 // For threads, open the Chat view instead of inline chat
18581874 await vscode . commands . executeCommand ( commands . NEW_CHAT , { inputValue : message , isPartialQuery : true , agentMode : true } ) ;
0 commit comments