You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Inside get_comp_resp, when a tree_sitter::Query matches, we get the instruction name by calling .utf8_text() on the @instr_name capture. We could then issue a lookup into the NamesToInstructions map, and iterate through the instruction forms to find valid operand types (This would require a translation between the OperandType and RegisterWidth 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:
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: