5089: Disable auto-complete on comments r=matklad a=BGluth Resolves #4907 by disabling any auto-completion on comments. As flodiebold [pointed out](https://github.com/rust-analyzer/rust-analyzer/issues/4907#issuecomment-648439979), in the future we may want to support some form of auto-completion within doc comments, but for now it was suggested to just disable auto-completion on them entirely. The implementation involves adding a new field `is_comment` to `CompletionContext` and checking if the immediate token we auto-completed on is a comment. I couldn't see a case where we need to check any of the ancestors, but let me know if this is not sufficient. I also wasn't sure if it was necessary to add a new field to this struct, but I decided it's probably the best option if we want to potentially do auto-completion on doc comments in the future. Finally, the three tests I added should I think ideally not filter results by `CompletionKind::Keyword`, but if I want to get unfiltered results, I need access to a non-public function [get_all_completion_items]( |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| .eslintrc.js | ||
| .gitignore | ||
| .vscodeignore | ||
| icon.png | ||
| package-lock.json | ||
| package.json | ||
| ra_syntax_tree.tmGrammar.json | ||
| README.md | ||
| rollup.config.js | ||
| rust.tmGrammar.json | ||
| tsconfig.json | ||
rust-analyzer
Provides support for rust-analyzer: novel LSP server for the Rust programming language.
See https://rust-analyzer.github.io/ for more information.