@@ -3,7 +3,7 @@ import React, { useCallback, useMemo, useState, useEffect } from 'react'
3
3
import classNames from 'classnames'
4
4
import * as H from 'history'
5
5
import { combineLatest , from , NEVER , Observable , of , ReplaySubject , Subscription } from 'rxjs'
6
- import { distinctUntilKeyChanged , filter , first , map , switchMap , tap } from 'rxjs/operators'
6
+ import { filter , first , map , switchMap , tap } from 'rxjs/operators'
7
7
import { useDeepCompareEffectNoCheck } from 'use-deep-compare-effect'
8
8
9
9
import { findPositionsFromEvents } from '@sourcegraph/codeintellify'
@@ -15,7 +15,6 @@ import { ThemeProps } from '@sourcegraph/shared/src/theme'
15
15
import { toURIWithPath } from '@sourcegraph/shared/src/util/url'
16
16
import { useObservable } from '@sourcegraph/wildcard'
17
17
18
- import { StatusBar } from '../../extensions/components/StatusBar'
19
18
import { FileDiffFields } from '../../graphql-operations'
20
19
import { DiffMode } from '../../repo/commit/RepositoryCommitPage'
21
20
import { diffDomFunctions } from '../../repo/compare/dom-functions'
@@ -53,7 +52,6 @@ export interface FileHunksProps extends ThemeProps {
53
52
lineNumbers : boolean
54
53
55
54
className : string
56
- location : H . Location
57
55
history : H . History
58
56
/** Reflect selected line in url */
59
57
persistLines ?: boolean
@@ -67,7 +65,6 @@ export const FileDiffHunks: React.FunctionComponent<React.PropsWithChildren<File
67
65
hunks,
68
66
isLightTheme,
69
67
lineNumbers,
70
- location,
71
68
extensionInfo,
72
69
persistLines,
73
70
diffMode,
@@ -140,30 +137,6 @@ export const FileDiffHunks: React.FunctionComponent<React.PropsWithChildren<File
140
137
[ extensionInfoChanges ]
141
138
)
142
139
143
- const getHeadStatusBarItems = useCallback (
144
- ( ) =>
145
- baseAndHeadViewerIds . pipe (
146
- distinctUntilKeyChanged ( 'headViewerId' ) ,
147
- switchMap ( ( { headViewerId, extensionHostAPI } ) =>
148
- headViewerId ? wrapRemoteObservable ( extensionHostAPI . getStatusBarItems ( headViewerId ) ) : of ( null )
149
- ) ,
150
- map ( statusBarItems => statusBarItems || [ ] )
151
- ) ,
152
- [ baseAndHeadViewerIds ]
153
- )
154
-
155
- const getBaseStatusBarItems = useCallback (
156
- ( ) =>
157
- baseAndHeadViewerIds . pipe (
158
- distinctUntilKeyChanged ( 'baseViewerId' ) ,
159
- switchMap ( ( { baseViewerId, extensionHostAPI } ) =>
160
- baseViewerId ? wrapRemoteObservable ( extensionHostAPI . getStatusBarItems ( baseViewerId ) ) : of ( null )
161
- ) ,
162
- map ( statusBarItems => statusBarItems || [ ] )
163
- ) ,
164
- [ baseAndHeadViewerIds ]
165
- )
166
-
167
140
// Listen for line decorations from extensions
168
141
useObservable (
169
142
useMemo (
@@ -227,41 +200,6 @@ export const FileDiffHunks: React.FunctionComponent<React.PropsWithChildren<File
227
200
228
201
return (
229
202
< div className = { styles . body } >
230
- { extensionInfo && (
231
- < div className = { classNames ( 'w-100' , isSplitMode && 'd-flex ' ) } >
232
- { /* Always render base status bar even though it isn't displayed in unified mode
233
- in order to prevent overloading the extension host with messages (`api.getStatusBarItems`) on
234
- mode switch, which noticeably decreases status bar performance. */ }
235
- { extensionInfo . extensionsController !== null && window . context . enableLegacyExtensions ? (
236
- < >
237
- < StatusBar
238
- getStatusBarItems = { getBaseStatusBarItems }
239
- className = { classNames (
240
- isSplitMode && 'flex-1 w-50' ,
241
- 'border-bottom border-top-0' ,
242
- styles . statusBar
243
- ) }
244
- statusBarItemClassName = "mx-0"
245
- extensionsController = { extensionInfo . extensionsController }
246
- location = { location }
247
- badgeText = "BASE"
248
- />
249
- < StatusBar
250
- getStatusBarItems = { getHeadStatusBarItems }
251
- className = { classNames (
252
- isSplitMode && 'w-50' ,
253
- 'flex-1 border-bottom border-top-0' ,
254
- styles . statusBar
255
- ) }
256
- statusBarItemClassName = "mx-0"
257
- extensionsController = { extensionInfo . extensionsController }
258
- location = { location }
259
- badgeText = "HEAD"
260
- />
261
- </ >
262
- ) : null }
263
- </ div >
264
- ) }
265
203
< div className = { classNames ( styles . fileDiffHunks , className ) } ref = { nextBlobElement } >
266
204
{ hunks . length === 0 ? (
267
205
< div className = "text-muted m-2" > No changes</ div >
0 commit comments