@@ -118,13 +118,14 @@ interface GoalProps {
|
||||
goal: InteractiveGoal
|
||||
filter: GoalFilterState
|
||||
showHints?: boolean
|
||||
commandLine: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the hypotheses, target type and optional case label of a goal according to the
|
||||
* provided `filter`. */
|
||||
export const Goal = React.memo((props: GoalProps) => {
|
||||
const { goal, filter, showHints } = props
|
||||
const { goal, filter, showHints, commandLine } = props
|
||||
|
||||
const filteredList = getFilteredHypotheses(goal.hyps, filter);
|
||||
const hyps = filter.reverse ? filteredList.slice().reverse() : filteredList;
|
||||
@@ -159,7 +160,7 @@ export const Goal = React.memo((props: GoalProps) => {
|
||||
{ assumptionHyps.length > 0 &&
|
||||
<div className="hyp-group"><div className="hyp-group-title">Assumptions:</div>
|
||||
{assumptionHyps.map((h, i) => <Hyp hyp={h} mvarId={goal.mvarId} key={i} />)}</div> }
|
||||
{commandLineMode && <CommandLine />}
|
||||
{commandLine && commandLineMode && <CommandLine />}
|
||||
{!filter.reverse && goalLi}
|
||||
{showHints && hints}
|
||||
</div>
|
||||
@@ -175,7 +176,7 @@ export function Goals({ goals, filter }: GoalsProps) {
|
||||
return <>No goals</>
|
||||
} else {
|
||||
return <>
|
||||
{goals.goals.map((g, i) => <Goal key={i} goal={g} filter={filter} />)}
|
||||
{goals.goals.map((g, i) => <Goal commandLine={false} key={i} goal={g} filter={filter} />)}
|
||||
</>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import { PanelWidgetDisplay } from '../../../../node_modules/lean4-infoview/src/
|
||||
import { RpcContext, useRpcSessionAtPos } from '../../../../node_modules/lean4-infoview/src/infoview/rpcSessions';
|
||||
import { GoalsLocation, Locations, LocationsContext } from '../../../../node_modules/lean4-infoview/src/infoview/goalLocation';
|
||||
import { InteractiveCode } from '../../../../node_modules/lean4-infoview/src/infoview/interactiveCode'
|
||||
import { Troubleshoot } from '@mui/icons-material';
|
||||
|
||||
type InfoStatus = 'updating' | 'error' | 'ready';
|
||||
type InfoKind = 'cursor' | 'pin';
|
||||
@@ -123,7 +124,7 @@ const InfoDisplayContent = React.memo((props: InfoDisplayContentProps) => {
|
||||
<div className="goals-section">
|
||||
{ goals && goals.goals.length > 0
|
||||
? <><div className="goals-section-title">Main Goal</div>
|
||||
<Goal filter={goalFilter} key='mainGoal' goal={goals.goals[0]} showHints={true} /></>
|
||||
<Goal commandLine={true} filter={goalFilter} key='mainGoal' goal={goals.goals[0]} showHints={true} /></>
|
||||
: <div className="goals-section-title">No Goals</div> }
|
||||
</div>
|
||||
</LocationsContext.Provider>
|
||||
@@ -149,7 +150,7 @@ const InfoDisplayContent = React.memo((props: InfoDisplayContentProps) => {
|
||||
<div className="goals-section-title">Other Goals</div>
|
||||
|
||||
{goals.goals.slice(1).map((goal, i) =>
|
||||
<details key={i}><summary><InteractiveCode fmt={goal.type} /></summary> <Goal filter={goalFilter} goal={goal} /></details>)}
|
||||
<details key={i}><summary><InteractiveCode fmt={goal.type} /></summary> <Goal commandLine={false} filter={goalFilter} goal={goal} /></details>)}
|
||||
</div>}
|
||||
</LocationsContext.Provider>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user