@@ -51,6 +51,9 @@ import { commentThreadRangeActiveBackground, commentThreadRangeActiveBorder, com
51
51
import { ICursorSelectionChangedEvent } from 'vs/editor/common/cursorEvents' ;
52
52
import { CommentsPanel } from 'vs/workbench/contrib/comments/browser/commentsView' ;
53
53
import { withNullAsUndefined , withUndefinedAsNull } from 'vs/base/common/types' ;
54
+ import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput' ;
55
+ import { EditorInput } from 'vs/workbench/common/editor/editorInput' ;
56
+ import { URI } from 'vs/base/common/uri' ;
54
57
55
58
export const ID = 'editor.contrib.review' ;
56
59
@@ -345,7 +348,8 @@ export class CommentController implements IEditorContribution {
345
348
@IQuickInputService private readonly quickInputService : IQuickInputService ,
346
349
@IViewsService private readonly viewsService : IViewsService ,
347
350
@IConfigurationService private readonly configurationService : IConfigurationService ,
348
- @IContextKeyService readonly contextKeyService : IContextKeyService
351
+ @IContextKeyService readonly contextKeyService : IContextKeyService ,
352
+ @IEditorService private readonly editorService : IEditorService
349
353
) {
350
354
this . _commentInfos = [ ] ;
351
355
this . _commentWidgets = [ ] ;
@@ -458,6 +462,13 @@ export class CommentController implements IEditorContribution {
458
462
this . _activeCursorHasCommentingRange . set ( hasCommentingRange ) ;
459
463
}
460
464
465
+ private isEditorInlineOriginal ( editorURI : URI | undefined , activeEditor : EditorInput | undefined ) : activeEditor is DiffEditorInput {
466
+ if ( editorURI && activeEditor instanceof DiffEditorInput && ! this . configurationService . getValue ( 'diffEditor.renderSideBySide' ) ) {
467
+ return activeEditor . original . resource ?. toString ( ) === editorURI . toString ( ) ;
468
+ }
469
+ return false ;
470
+ }
471
+
461
472
private beginCompute ( ) : Promise < void > {
462
473
this . _computePromise = createCancelablePromise ( token => {
463
474
const editorURI = this . editor && this . editor . hasModel ( ) && this . editor . getModel ( ) . uri ;
@@ -723,6 +734,10 @@ export class CommentController implements IEditorContribution {
723
734
if ( ! this . editor ) {
724
735
return ;
725
736
}
737
+ const activeEditor = this . editorService . activeEditor ;
738
+ if ( this . isEditorInlineOriginal ( this . editor . getModel ( ) ?. uri , activeEditor ) ) {
739
+ return ;
740
+ }
726
741
const zoneWidget = this . instantiationService . createInstance ( ReviewZoneWidget , this . editor , owner , thread , pendingComment ) ;
727
742
zoneWidget . display ( thread . range . endLineNumber ) ;
728
743
this . _commentWidgets . push ( zoneWidget ) ;
0 commit comments