Skip to content
Open
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
2 changes: 1 addition & 1 deletion lean4-infoview/src/infoview/goals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ interface GoalSettingsState {
showLetValue: boolean
}

function goalSettingsStateOfConfig(config: InfoviewConfig): GoalSettingsState {
export function goalSettingsStateOfConfig(config: InfoviewConfig): GoalSettingsState {
return {
reverse: config.reverseTacticState,
hideGoalNames: !config.showGoalNames,
Expand Down
20 changes: 4 additions & 16 deletions lean4-infoview/src/infoview/traceExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

import { HighlightedMsgEmbed, HighlightedTraceEmbed, lazyTraceChildrenToInteractive } from '@leanprover/infoview-api'
import * as React from 'react'
import { Goal } from './goals'
import { ConfigContext } from './contexts'
import { Goal, goalSettingsStateOfConfig } from './goals'
import {
InteractiveCode,
InteractiveTaggedText,
Expand Down Expand Up @@ -117,26 +118,13 @@ function Trace(traceEmbed: HighlightedTraceEmbed) {
function InteractiveMessageTag({
tag: embed,
}: InteractiveTagProps<HighlightedMsgEmbed, HighlightedMsgEmbed>): JSX.Element {
const config = React.useContext(ConfigContext)
if (embed === 'highlighted') {
return <span className="highlighted-text"></span>
}
if ('expr' in embed) return <InteractiveCode fmt={embed.expr} />
else if ('goal' in embed)
return (
<Goal
goal={embed.goal}
settings={{
reverse: false,
hideGoalNames: false,
emphasizeFirstGoal: false,
showType: true,
showInstance: true,
showHiddenAssumption: true,
showLetValue: true,
}}
additionalClassNames=""
/>
)
return <Goal goal={embed.goal} settings={goalSettingsStateOfConfig(config)} additionalClassNames="" />
else if ('widget' in embed)
return <DynamicComponent hash={embed.widget.wi.javascriptHash} props={embed.widget.wi.props} />
else if ('trace' in embed) return <Trace {...embed.trace} />
Expand Down