everything seems to work ... but code is dirty
This commit is contained in:
parent
a19dbe1b34
commit
5b6bcf5ffa
10 changed files with 253 additions and 131 deletions
|
|
@ -41,7 +41,7 @@ function DeclColumns({state: {name, value, inner}, setState, suggestionPriority}
|
|||
|
||||
const valueSuggestionPriority = (suggestion: ResolvedType) => {
|
||||
const innerEnv = makeInnerEnv(env, name, suggestion);
|
||||
const resolved = evalEditorBlock(inner, innerEnv);
|
||||
const [resolved] = evalEditorBlock(inner, innerEnv);
|
||||
return scoreResolved(resolved, suggestionPriority);
|
||||
};
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ function DeclColumns({state: {name, value, inner}, setState, suggestionPriority}
|
|||
}, []);
|
||||
useEffect(() => autoInputWidth(nameRef, name, 60), [nameRef, name]);
|
||||
|
||||
const valueResolved = evalEditorBlock(value, env);
|
||||
const [valueResolved] = evalEditorBlock(value, env);
|
||||
const innerEnv = makeInnerEnv(env, name, valueResolved);
|
||||
|
||||
return <>
|
||||
|
|
@ -91,7 +91,7 @@ function InnerMost({state, setState, suggestionPriority}) {
|
|||
const env = useContext(EnvContext);
|
||||
const globalContext = useContext(GlobalContext);
|
||||
const setInner = callback => setState(state => ({...state, inner: callback(state.inner)}));
|
||||
const valueResolved = evalEditorBlock(state.value, env);
|
||||
const [valueResolved] = evalEditorBlock(state.value, env);
|
||||
const innerEnv = makeInnerEnv(env, state.name, valueResolved);
|
||||
const onCancel = () => setState(state => state.value);
|
||||
if (state.inner.kind === "let" && globalContext?.syntacticSugar) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue