Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Register Autocompletes #32

Open
WillLillis opened this issue Nov 25, 2023 · 0 comments
Open

Correct Register Autocompletes #32

WillLillis opened this issue Nov 25, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@WillLillis
Copy link
Collaborator

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.
@WillLillis WillLillis added enhancement New feature or request help wanted Extra attention is needed labels Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant