|
@@ -10,6 +10,7 @@ import { FullSizeLoadingSpinner } from '@/shared/components/loading-spinner'
|
|
|
import SymbolPalettePane from '@/features/ide-react/components/editor/symbol-palette-pane'
|
|
import SymbolPalettePane from '@/features/ide-react/components/editor/symbol-palette-pane'
|
|
|
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
|
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
|
|
import { PythonEditorSplit } from '@/features/ide-react/components/layout/python-editor-split'
|
|
import { PythonEditorSplit } from '@/features/ide-react/components/layout/python-editor-split'
|
|
|
|
|
+import { isInExperiment } from '@/utils/labs-utils'
|
|
|
|
|
|
|
|
export const Editor = () => {
|
|
export const Editor = () => {
|
|
|
const { opening, errorState, showSymbolPalette } =
|
|
const { opening, errorState, showSymbolPalette } =
|
|
@@ -19,6 +20,7 @@ export const Editor = () => {
|
|
|
const isPythonDocument =
|
|
const isPythonDocument =
|
|
|
openEntity?.type === 'doc' &&
|
|
openEntity?.type === 'doc' &&
|
|
|
openEntity.entity.name.toLowerCase().endsWith('.py')
|
|
openEntity.entity.name.toLowerCase().endsWith('.py')
|
|
|
|
|
+ const pythonExecutionEnabled = isInExperiment('overleaf-code')
|
|
|
|
|
|
|
|
if (!currentDocumentId) {
|
|
if (!currentDocumentId) {
|
|
|
return null
|
|
return null
|
|
@@ -43,7 +45,11 @@ export const Editor = () => {
|
|
|
order={1}
|
|
order={1}
|
|
|
className="ide-redesign-editor-panel"
|
|
className="ide-redesign-editor-panel"
|
|
|
>
|
|
>
|
|
|
- {isPythonDocument ? <PythonEditorSplit /> : <SourceEditor />}
|
|
|
|
|
|
|
+ {isPythonDocument && pythonExecutionEnabled ? (
|
|
|
|
|
+ <PythonEditorSplit />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <SourceEditor />
|
|
|
|
|
+ )}
|
|
|
{isLoading && <EditorLoadingPane />}
|
|
{isLoading && <EditorLoadingPane />}
|
|
|
</Panel>
|
|
</Panel>
|
|
|
{showSymbolPalette && (
|
|
{showSymbolPalette && (
|