4

I'm using rust-analyzer 0.2.654 (latest) on VS Code 1.57.1 (also latest) on Windows 10.

The autocomplete displays all keywords, as shown below:

Screenshot

How can I hide the keywords, displaying only the actual struct members?

2 Answers 2

2

You can disable this in the settings UI by navigating to Text Editor > Suggestions > Show Keywords:

enter image description here

Or alternatively disable it via settings.json by including:

"editor.suggest.showKeywords": false,
Sign up to request clarification or add additional context in comments.

2 Comments

Wait, VS Code either suggests keywords in all contexts or not at all? It isn’t capable of being more contextual?
@eggyal You can configure it per-language by putting it in "[rust]": { ... }. I don't know if there's more granular control. Rust-analyzer is already pretty contextual IMO and typically doesn't suggest irrelevant keywords. I don't know why it suggests them here.
0

You also need to disable "Postfix completions" otherwise you get a load of completions like dbg, match and so on which are really automatic snippets rather than actual struct members.

postfix completions

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.