rust/crates
bors[bot] c447fe9bc0
Merge #3026
3026: ra_syntax: reshape SyntaxError for the sake of removing redundancy r=matklad a=Veetaha

Followup of #2911, also puts some crosses to the todo list of #223.

**AHTUNG!** A big part of the diff of this PR are test data files changes.

Simplified `SyntaxError` that was `SyntaxError { kind: { /* big enum */  }, location: Location }` to `SyntaxError(String, TextRange)`. I am not sure whether the tuple struct here is best fit, I am inclined to add names to the fields, because I already provide getters `SyntaxError::message()`, `SyntaxError::range()`.
I also removed `Location` altogether ...

This is currently WIP, because the following is not done:
- [ ] ~~Add tests to `test_data` dir for unescape errors *// I don't know where to put these errors in particular, because they are out of the scope of the lexer and parser. However, I have an idea in mind that we move all validators we have right now to parsing stage, but this is up to discussion...*~~ **[UPD]** I came to a conclusion that tree validation logic, which unescape errors are a part of, should be rethought of, we currently have no tests and no place to put tests for tree validations. So I'd like to extract potential redesign (maybe move of tree validation to ra_parser) and adding tests for this into a separate task.

Co-authored-by: Veetaha <gerzoh1@gmail.com>
Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-02-18 12:57:26 +00:00
..
ra_arena
ra_assists Merge #3108 2020-02-17 09:34:08 +00:00
ra_cargo_watch Update snapshot tests due to removed SuggestedFix 2020-02-03 12:24:57 +01:00
ra_cfg
ra_db Rename the binary to rust-analyzer 2020-02-18 12:33:16 +01:00
ra_fmt Refactor if-let -> match assist to use ast::make 2020-02-05 14:08:16 +01:00
ra_hir Merge #3169 2020-02-17 10:54:32 +00:00
ra_hir_def Merge #3169 2020-02-17 10:54:32 +00:00
ra_hir_expand Add couple of utility methods 2020-02-12 18:19:55 +01:00
ra_hir_ty Merge #3169 2020-02-17 10:54:32 +00:00
ra_ide ra_syntax: SyntaxError::range() now returns by value 2020-02-17 22:24:38 +02:00
ra_ide_db Rename the binary to rust-analyzer 2020-02-18 12:33:16 +01:00
ra_mbe ra_syntax: refactored the lexer design as per @matklad and @kiljacken PR review 2020-02-04 00:00:55 +02:00
ra_parser Add test for unnamed argument in function pointer 2020-02-12 22:55:37 +01:00
ra_prof Rename the binary to rust-analyzer 2020-02-18 12:33:16 +01:00
ra_project_model Simplify the command execution 2020-02-18 00:38:01 +02:00
ra_syntax Merge #3026 2020-02-18 12:57:26 +00:00
ra_text_edit Drop proptest tests 2020-02-17 16:57:06 +01:00
ra_tt Rename the binary to rust-analyzer 2020-02-18 12:33:16 +01:00
rust-analyzer Rename folder 2020-02-18 12:37:45 +01:00
test_utils Simplify fixture parsing 2020-01-30 13:17:56 +01:00