Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion client/web/src/codeintel/ReferencesPanel.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ export const defaultProps: ReferencesPanelProps = {
telemetryService: NOOP_TELEMETRY_SERVICE,
settingsCascade: {
subjects: null,
final: null,
final: {
// TODO: we won't need to set experimental features explicitly once we cover CodeMirror side blob view with tests:
// https://github.com/sourcegraph/sourcegraph/issues/48049
experimentalFeatures: {
enableCodeMirrorFileView: false,
},
},
},
platformContext: NOOP_PLATFORM_CONTEXT as any,
isLightTheme: false,
Expand Down
6 changes: 6 additions & 0 deletions client/web/src/codeintel/ReferencesPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ import { MockedTestProvider, waitForNextApolloResponse } from '@sourcegraph/shar
import '@sourcegraph/shared/dev/mockReactVisibilitySensor'
import { renderWithBrandedContext } from '@sourcegraph/wildcard/src/testing'

import { setExperimentalFeaturesFromSettings } from '../stores'

import { ReferencesPanel } from './ReferencesPanel'
import { buildReferencePanelMocks, defaultProps } from './ReferencesPanel.mocks'

describe('ReferencesPanel', () => {
async function renderReferencesPanel() {
const { url, requestMocks } = buildReferencePanelMocks()

// TODO: we won't need to set experimental features explicitly once we cover CodeMirror side blob view with tests:
// https://github.com/sourcegraph/sourcegraph/issues/48049
setExperimentalFeaturesFromSettings(defaultProps.settingsCascade)

const result = renderWithBrandedContext(
<MockedTestProvider mocks={requestMocks}>
<ReferencesPanel {...defaultProps} />
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/codeintel/ReferencesPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ function parseSideBlobProps(
}

const SideBlob: React.FunctionComponent<React.PropsWithChildren<SideBlobProps>> = props => {
const useCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? false)
const useCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? true)
const BlobComponent = useCodeMirror ? CodeMirrorBlob : LegacyBlob

const highlightFormat = useCodeMirror ? HighlightResponseFormat.JSON_SCIP : HighlightResponseFormat.HTML_HIGHLIGHT
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/repo/blob/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const fetchBlob = memoizeObservable((options: FetchBlobOptions): Observab
* Note: This format should match the format used when the blob is 'normally' fetched. E.g. in `BlobPage.tsx`.
*/
export const usePrefetchBlobFormat = (): HighlightResponseFormat => {
const enableCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? false)
const enableCodeMirror = useExperimentalFeatures(features => features.enableCodeMirrorFileView ?? true)
const enableLazyHighlighting = useExperimentalFeatures(
features => features.enableLazyBlobSyntaxHighlighting ?? false
)
Expand Down