@@ -7,35 +7,35 @@ import type { Renderer } from 'react-dom'
77import { createRoot } from 'react-dom/client'
88import {
99 asyncScheduler ,
10+ BehaviorSubject ,
1011 combineLatest ,
12+ concat ,
1113 EMPTY ,
1214 from ,
15+ fromEvent ,
16+ lastValueFrom ,
1317 type Observable ,
1418 of ,
1519 Subject ,
1620 Subscription ,
17- type Unsubscribable ,
18- concat ,
19- BehaviorSubject ,
20- fromEvent ,
21- lastValueFrom ,
2221 throwError ,
22+ type Unsubscribable ,
2323} from 'rxjs'
2424import {
2525 catchError ,
2626 concatAll ,
2727 concatMap ,
28+ distinctUntilChanged ,
2829 filter ,
2930 map ,
3031 mergeMap ,
3132 observeOn ,
32- switchMap ,
33- withLatestFrom ,
34- tap ,
35- startWith ,
36- distinctUntilChanged ,
3733 retry ,
34+ startWith ,
35+ switchMap ,
3836 take ,
37+ tap ,
38+ withLatestFrom ,
3939} from 'rxjs/operators'
4040
4141import type { HoverMerged } from '@sourcegraph/client-api'
@@ -51,11 +51,11 @@ import {
5151 asError ,
5252 asObservable ,
5353 isDefined ,
54+ isExternalLink ,
5455 isInstanceOf ,
56+ type LineOrPositionOrRange ,
5557 property ,
5658 registerHighlightContributions ,
57- isExternalLink ,
58- type LineOrPositionOrRange ,
5959} from '@sourcegraph/common'
6060import type { WorkspaceRoot } from '@sourcegraph/extension-api-types'
6161import { gql , isHTTPAuthError } from '@sourcegraph/http-client'
@@ -72,18 +72,18 @@ import {
7272} from '@sourcegraph/shared/src/hover/HoverOverlay'
7373import { getModeFromPath } from '@sourcegraph/shared/src/languages'
7474import type { PlatformContext , URLToFileContext } from '@sourcegraph/shared/src/platform/context'
75- import { TelemetryV2Props } from '@sourcegraph/shared/src/telemetry'
75+ import { type TelemetryV2Props } from '@sourcegraph/shared/src/telemetry'
7676import type { TelemetryProps } from '@sourcegraph/shared/src/telemetry/telemetryService'
7777import { createURLWithUTM } from '@sourcegraph/shared/src/tracking/utm'
7878import {
7979 type FileSpec ,
80- type UIPositionSpec ,
80+ makeRepoGitURI ,
8181 type RawRepoSpec ,
8282 type RepoSpec ,
8383 type ResolvedRevisionSpec ,
8484 type RevisionSpec ,
85+ type UIPositionSpec ,
8586 type ViewStateSpec ,
86- makeRepoGitURI ,
8787} from '@sourcegraph/shared/src/util/url'
8888
8989import { background } from '../../../browser-extension/web-extension-api/runtime'
@@ -95,8 +95,8 @@ import { CodeViewToolbar, type CodeViewToolbarClassProps } from '../../component
9595import { TrackAnchorClick } from '../../components/TrackAnchorClick'
9696import { WildcardThemeProvider } from '../../components/WildcardThemeProvider'
9797import { isExtension , isInPage } from '../../context'
98- import type { SourcegraphIntegrationURLs , BrowserPlatformContext } from '../../platform/context'
99- import { resolveRevision , retryWhenCloneInProgressError , resolvePrivateRepo } from '../../repo/backend'
98+ import type { BrowserPlatformContext , SourcegraphIntegrationURLs } from '../../platform/context'
99+ import { resolvePrivateRepo , resolveRevision , retryWhenCloneInProgressError } from '../../repo/backend'
100100import { ConditionalTelemetryRecorderProvider } from '../../telemetry'
101101import { ConditionalTelemetryService , EventLogger } from '../../tracking/eventLogger'
102102import { DEFAULT_SOURCEGRAPH_URL , getPlatformName , isDefaultSourcegraphUrl } from '../../util/context'
@@ -109,16 +109,16 @@ import { type GithubCodeHost, githubCodeHost, isGithubCodeHost } from '../github
109109import { gitlabCodeHost } from '../gitlab/codeHost'
110110import { phabricatorCodeHost } from '../phabricator/codeHost'
111111
112- import { type CodeView , trackCodeViews , fetchFileContentForDiffOrFileInfo } from './codeViews'
112+ import { type CodeView , fetchFileContentForDiffOrFileInfo , trackCodeViews } from './codeViews'
113113import { NotAuthenticatedError , RepoURLParseError } from './errors'
114114import { initializeExtensions } from './extensions'
115115import { SignInButton } from './SignInButton'
116- import { resolveRepoNamesForDiffOrFileInfo , defaultRevisionToCommitID } from './util/fileInfo'
116+ import { defaultRevisionToCommitID , resolveRepoNamesForDiffOrFileInfo } from './util/fileInfo'
117117import { lprToSelectionsZeroIndexed } from './util/selections'
118118import {
119- type ViewOnSourcegraphButtonClassProps ,
120- ViewOnSourcegraphButton ,
121119 ConfigureSourcegraphButton ,
120+ ViewOnSourcegraphButton ,
121+ type ViewOnSourcegraphButtonClassProps ,
122122} from './ViewOnSourcegraphButton'
123123import { delayUntilIntersecting , trackViews , type ViewResolver } from './views'
124124
@@ -227,7 +227,6 @@ export interface CodeHost {
227227
228228 /**
229229 * Construct the URL to the specified file.
230- *
231230 * @param sourcegraphURL The URL of the Sourcegraph instance.
232231 * @param target The target to build a URL for.
233232 * @param context Context information about this invocation.
@@ -474,6 +473,7 @@ function initCodeIntelligence({
474473 < HoverOverlay
475474 { ...this . state . hoverOverlayProps }
476475 { ...codeHost . hoverOverlayClassProps }
476+ badgeClassName = { styles . badgeHidden } // hide badges in browser ext
477477 className = { classNames ( styles . hoverOverlay , codeHost . hoverOverlayClassProps ?. className ) }
478478 telemetryService = { telemetryService }
479479 telemetryRecorder = { telemetryRecorder }
@@ -748,7 +748,7 @@ export async function handleCodeHost({
748748 * active Sourcegraph URL.
749749 * 2. It is a repository not added to the Sourcegraph instance (other than Cloud).
750750 * If the current state is `true`, we can short circuit subsequent requests.
751- * * /
751+ */
752752 const repoSyncErrors = new BehaviorSubject < boolean > ( false )
753753 // Set by `ViewOnSourcegraphButton` (cleans up and sets to `false` whenever it is unmounted).
754754 const setRepoSyncError = repoSyncErrors . next . bind ( repoSyncErrors )
@@ -759,7 +759,7 @@ export async function handleCodeHost({
759759 * - repository is not added to other than Cloud Sourcegraph instance.
760760 *
761761 * (no side effects, doesn't notify `repoSyncErrors`)
762- * * /
762+ */
763763 const checkRepoSyncError = async ( error : any ) : Promise < boolean > =>
764764 isRepoNotFoundErrorLike ( error ) &&
765765 ( isDefaultSourcegraphUrl ( sourcegraphURL ) ? ! ! ( await codeHost . getContext ?.( ) ) ?. privateRepository : true )
0 commit comments