Correct Register Autocompletes #32
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
unplanned
No definite timeline yet
Currently when an completion request is received for a register, a list is sent with all available register names. Some simple translation code could filter this list to only suggest registers that match the type required for the given instruction. This can probably be done in the following manner:
get_comp_resp
, when atree_sitter::Query
matches, we get the instruction name by calling.utf8_text()
on the@instr_name
capture. We could then issue a lookup into theNamesToInstructions
map, and iterate through the instruction forms to find valid operand types (This would require a translation between theOperandType
andRegisterWidth
enums). A quick filter on the vector of register completions so that only registers that match this criteria could then be done.The text was updated successfully, but these errors were encountered: