rust/crates/ra_syntax/src
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
..
ast Merge #3998 #4006 2020-04-24 20:10:54 +00:00
parsing Rename some tokens 2020-04-10 17:07:09 +02:00
validation ra_syntax: reshape SyntaxError for the sake of removing redundancy 2020-02-17 22:24:33 +02:00
algo.rs Fix panic in split_imports assist 2020-04-20 16:34:01 +02:00
ast.rs Align grammar for record patterns and literals 2020-04-12 00:00:15 +02:00
fuzz.rs Added test for check doc strings in crates. 2019-09-30 11:58:53 +03:00
lib.rs Remove dead code 2020-04-11 19:36:31 +02:00
parsing.rs ra_syntax: refactored the lexer design as per @matklad and @kiljacken PR review 2020-02-04 00:00:55 +02:00
ptr.rs minor 2020-04-23 23:18:18 +02:00
syntax_error.rs ra_syntax: remove message() method and use only Display trait in SyntaxError as per matklad 2020-02-17 23:13:38 +02:00
syntax_node.rs ra_syntax: moved reexport declaration after imports as per matklad 2020-02-17 22:24:38 +02:00
tests.rs Migrate tests .txt -> .rast 2020-04-06 14:04:26 +03:00
validation.rs Fix unnecessary braces warnings 2020-04-06 17:21:33 +03:00