fix suggestion order
This commit is contained in:
parent
46baad7cf4
commit
1ff4b181ff
8 changed files with 91 additions and 168 deletions
|
|
@ -1,13 +1,14 @@
|
|||
import { useContext, useEffect, useRef } from "react";
|
||||
|
||||
import { growEnv } from "dope2";
|
||||
|
||||
import { Editor, type EditorState, type State2Props } from "./Editor";
|
||||
import type { SuggestionType } from "./InputBlock";
|
||||
import { EnvContext } from "./EnvContext";
|
||||
import { growEnv, TYPE_VARS } from "dope2";
|
||||
import { getUnusedTypeVar } from "./eval";
|
||||
import { autoInputWidth } from "./util/dom_trickery";
|
||||
|
||||
import "./LambdaBlock.css";
|
||||
import { getUnusedTypeVar } from "./eval";
|
||||
|
||||
|
||||
|
||||
export interface LambdaBlockState {
|
||||
|
|
@ -19,9 +20,7 @@ export interface LambdaBlockState {
|
|||
interface LambdaBlockProps<
|
||||
FnState=EditorState,
|
||||
InputState=EditorState,
|
||||
> extends State2Props<LambdaBlockState,EditorState> {
|
||||
suggestionPriority: (suggestion: SuggestionType) => number;
|
||||
}
|
||||
> extends State2Props<LambdaBlockState,EditorState> {}
|
||||
|
||||
|
||||
export function LambdaBlock({state, setState, suggestionPriority}: LambdaBlockProps) {
|
||||
|
|
@ -78,9 +77,7 @@ export function LambdaBlock({state, setState, suggestionPriority}: LambdaBlockPr
|
|||
state={state.expr}
|
||||
setState={setExpr}
|
||||
onCancel={() => setState(state => state.expr)}
|
||||
suggestionPriority={(suggestion: SuggestionType) => {
|
||||
return suggestionPriority(suggestion);
|
||||
}}
|
||||
suggestionPriority={suggestionPriority}
|
||||
/>
|
||||
</EnvContext>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue