rust/crates
bors[bot] 51a0058d4c
Merge #3998 #4006
3998: Make add_function generate functions in other modules via qualified path r=matklad a=TimoFreiberg

Additional feature for #3639 

- [x] Add tests for paths with more segments
- [x] Make generating the function in another file work
- [x] Add `pub` or `pub(crate)` to the generated function if it's generated in a different module
- [x] Make the assist jump to the edited file
- [x] Enable file support in the `check_assist` helper

4006: Syntax highlighting for format strings r=matklad a=ltentrup

I have an implementation for syntax highlighting for format string modifiers `{}`.
The first commit refactors the changes in #3826 into a separate struct.
The second commit implements the highlighting: first we check in a macro call whether the macro is a format macro from `std`. In this case, we remember the format string node. If we encounter this node during syntax highlighting, we check for the format modifiers `{}` using regular expressions.

There are a few places which I am not quite sure:
- Is the way I extract the macro names correct?
- Is the `HighlightTag::Attribute` suitable for highlighting the `{}`?

Let me know what you think, any feedback is welcome!

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com>
Co-authored-by: Leander Tentrup <ltentrup@users.noreply.github.com>
2020-04-24 20:10:54 +00:00
..
ra_arena Use resize_with 2020-03-31 09:02:12 -04:00
ra_assists Add pub(crate) to functions generated in other module 2020-04-21 23:04:44 +02:00
ra_cfg Update versions 2020-02-18 16:12:40 +02:00
ra_db Some clippy fixes 2020-04-19 15:15:49 -04:00
ra_flycheck insta 0.16 2020-04-14 13:57:02 -04:00
ra_fmt Provide more complete AST accessors to support usage in rustc 2020-04-09 11:50:37 +02:00
ra_hir Do not add default and closure types in 'add explicit type' assist 2020-04-21 22:56:40 +03:00
ra_hir_def Record definitions in extern blocks 2020-04-23 23:36:23 +02:00
ra_hir_expand Improve remove dervie attrs 2020-04-22 01:44:21 +08:00
ra_hir_ty Merge #4106 2020-04-23 21:58:52 +00:00
ra_ide Merge #3998 #4006 2020-04-24 20:10:54 +00:00
ra_ide_db Remove SyntaxPtr::range from more places 2020-04-23 16:33:01 +02:00
ra_mbe Convert bool to ident instead of literal in mbe 2020-04-19 03:24:17 +08:00
ra_parser Align grammar for record patterns and literals 2020-04-12 00:00:15 +02:00
ra_proc_macro proc_macro: add ability to log to stderr and view output in vscode 2020-04-23 01:57:02 +03:00
ra_proc_macro_srv Refactor a bit 2020-04-24 09:27:37 +08:00
ra_prof Move timeit to stdx 2020-04-10 20:46:42 +02:00
ra_project_model More helpful error message if toolchain is not in PATH 2020-04-24 22:01:32 +02:00
ra_syntax Merge #3998 #4006 2020-04-24 20:10:54 +00:00
ra_text_edit Remove some TextUnit->usize escapees 2020-03-12 22:33:27 -04:00
ra_tt Improve tt::Subtree debug print 2020-04-10 00:17:32 +08:00
rust-analyzer Adds attribute completions (#3941) 2020-04-24 17:54:52 +02:00
stdx Move timeit to stdx 2020-04-10 20:46:42 +02:00
test_utils Make records grammar more orthogonal 2020-04-11 19:20:41 +02:00