more improvements
This commit is contained in:
parent
d877b42a12
commit
ec2944cdb7
5 changed files with 63 additions and 214 deletions
|
|
@ -53,7 +53,7 @@ const computeSuggestions = (text, env, suggestionPriority: (s: ResolvedType) =>
|
|||
kind: type.kind || "value",
|
||||
}]),
|
||||
]
|
||||
return []; // <-- uncomment to disable suggestions (useful for debugging)
|
||||
// return []; // <-- uncomment to disable suggestions (useful for debugging)
|
||||
return ls
|
||||
.map(suggestion => [suggestionPriority(suggestion[2]), ...suggestion] as PrioritizedSuggestionType)
|
||||
.sort(([priorityA], [priorityB]) => priorityB - priorityA)
|
||||
|
|
@ -88,7 +88,12 @@ export function InputBlock({ state, setState, suggestionPriority, onCancel }: In
|
|||
}
|
||||
|
||||
const onTextChange = newText => {
|
||||
setState(state => ({...state, text: newText}));
|
||||
setState(state => ({...state,
|
||||
text: newText,
|
||||
value: (trie.get(env.names)(newText) ? {
|
||||
kind: "name",
|
||||
} : state.value),
|
||||
}));
|
||||
}
|
||||
|
||||
// fired before onInput
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue