File tree Expand file tree Collapse file tree
packages/ai-native/src/browser/chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,18 +76,17 @@ const MAX_TITLE_LENGTH = 100;
7676const getFileChanges = ( codeBlocks : CodeBlockData [ ] ) =>
7777 codeBlocks
7878 . map ( ( block ) => {
79- const rangesFromDiffHunk =
80- block . applyResult ?. diff . split ( '\n' ) . reduce (
81- ( [ del , add ] , line ) => {
82- if ( line . startsWith ( '-' ) ) {
83- del += 1 ;
84- } else if ( line . startsWith ( '+' ) ) {
85- add += 1 ;
86- }
87- return [ del , add ] ;
88- } ,
89- [ 0 , 0 ] ,
90- ) || [ ] ;
79+ const rangesFromDiffHunk = block . applyResult ?. diff . split ( '\n' ) . reduce (
80+ ( [ del , add ] , line ) => {
81+ if ( line . startsWith ( '-' ) ) {
82+ del += 1 ;
83+ } else if ( line . startsWith ( '+' ) ) {
84+ add += 1 ;
85+ }
86+ return [ del , add ] ;
87+ } ,
88+ [ 0 , 0 ] ,
89+ ) || [ 0 , 0 ] ;
9190 return {
9291 path : block . relativePath ,
9392 additions : rangesFromDiffHunk [ 1 ] ,
You can’t perform that action at this time.
0 commit comments