aboutsummaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
* Add quote macroEdwin Cheng2019-11-112-0/+262
|
* Add basic bultin macro infrastructureEdwin Cheng2019-11-118-29/+148
|
* Remove typed macro parsing APIAleksey Kladov2019-11-095-72/+83
| | | | | We do type-erasure on every path anyway, so it doesn't make much sense to duplicate this function for every type
* Minor cleanupAleksey Kladov2019-11-091-6/+8
|
* Merge #2169bors[bot]2019-11-098-101/+305
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 2169: MBE: Mapping spans for goto definition r=matklad a=edwin0cheng Currently, go to definition gives the wrong span in MBE. This PR implement a mapping mechanism to fix it and it could be used for future MBE hygiene implementation. The basic idea of the mapping is: 1. When expanding the macro, generated 2 `TokenMap` which maps the macro args and macro defs between tokens and input text-ranges. 2. Before converting generated `TokenTree` to `SyntaxNode`, generated a `ExpandedRangeMap` which is a mapping between token and output text-ranges. 3. Using these 3 mappings to construct an `ExpansionInfo` which can map between input text ranges and output text ranges. Co-authored-by: Edwin Cheng <[email protected]>
| * Remove map_ranges in RevTokenMapEdwin Cheng2019-11-094-66/+35
| |
| * Refactor and simpfilyEdwin Cheng2019-11-085-89/+42
| |
| * Refactor and add more commentsEdwin Cheng2019-11-082-58/+52
| |
| * Fix formattingEdwin Cheng2019-11-051-1/+1
| |
| * Refactor a bitEdwin Cheng2019-11-042-11/+7
| |
| * Use macro_rules shift to map text rangesEdwin Cheng2019-11-044-51/+26
| |
| * Use ? and destructing to simplifed long codeEdwin Cheng2019-11-041-19/+17
| |
| * Rename and fix typosEdwin Cheng2019-11-044-24/+43
| |
| * Add note for recurseive macro generated codeEdwin Cheng2019-11-041-0/+1
| |
| * Add testsEdwin Cheng2019-11-041-0/+40
| |
| * Use new expansion feature in goto_definitionEdwin Cheng2019-11-042-45/+114
| |
| * Remove dbg!Edwin Cheng2019-11-042-5/+0
| |
| * Fixed bug in ExpandedRangeMapEdwin Cheng2019-11-041-34/+16
| |
| * Add parent_expansion to HirFileIdEdwin Cheng2019-11-041-0/+19
| |
| * Add macro_expansion_info in hir_expandEdwin Cheng2019-11-045-47/+212
| |
| * Add map_id to TokenIdEdwin Cheng2019-11-042-5/+34
| |
* | Touch up nameres doc commentAleksey Kladov2019-11-081-7/+6
| |
* | Reduce visibilityAleksey Kladov2019-11-081-9/+9
| |
* | Extract path resolution submoduleAleksey Kladov2019-11-083-243/+269
| |
* | SimplifyAleksey Kladov2019-11-082-7/+5
| | | | | | | | | | There's only one call-site for the function, so it seems fine to inline
* | Reduce visibilityAleksey Kladov2019-11-081-23/+23
| |
* | Update crateskjeremy2019-11-072-3/+3
| | | | | | | | | | | | | | Removes nodrop and extra arrayvec We have an extra crossbeam-queue and crossbeam-utils left but those should drop once rayon accepts https://github.com/rayon-rs/rayon/pull/704
* | cargo xtask format with 1.39kjeremy2019-11-071-3/+3
| |
* | Merge #2179bors[bot]2019-11-065-14/+111
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2179: Use HirDatabase to compute `is_deprecated` r=matklad a=martskins This PR fixes #2167 by introducing `attributes_query` and adding `fn attrs(&self, def: crate::AttrDef) -> Option<Arc<[Attr]>>;` to the `DefDatabase` trait. I'm a little concerned about the two spots in `attributes_query` where code is repeated, but I couldn't figure out a way to avoid that, so.. I welcome suggestions :smile: Co-authored-by: Martin Asquino <[email protected]>
| * | HirDatabase stored attributesMartin Asquino2019-11-045-14/+111
| | |
* | | Cleanup complete_postfixAleksey Kladov2019-11-061-52/+57
| | |
* | | Bump psm, console, indicatifkjeremy2019-11-051-1/+1
| | |
* | | Reduce visibilityAleksey Kladov2019-11-041-2/+2
| | |
* | | Move Namespace enum closer to usageAleksey Kladov2019-11-049-26/+29
| | |
* | | Appease the linter by dummy doc commentsAleksey Kladov2019-11-042-1/+3
| | |
* | | SimplifyAleksey Kladov2019-11-041-35/+24
| | |
* | | Restore assists testsAleksey Kladov2019-11-043-4/+50
| | |
* | | Rename MockDatabase -> TestDBAleksey Kladov2019-11-046-60/+57
| | | | | | | | | | | | Actually working rename is sooo useful!
* | | remove dead codeAleksey Kladov2019-11-041-26/+7
| | |
* | | Remove more duplication in test fixturesAleksey Kladov2019-11-045-62/+18
| | |
* | | Remove some duplicated test functionsAleksey Kladov2019-11-041-81/+16
| | |
* | | Reduce visibilityAleksey Kladov2019-11-042-6/+10
| |/ |/|
* | Merge #2173bors[bot]2019-11-042-2/+70
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2173: MBE: Add TokenId shift in macro_rules r=matklad a=edwin0cheng As discussed in #2169 , for fixing duplication TokenId during expansion : > What we can do here is to re-number the tokens during expansion. Specifically: > * when we create macro_rules, we note the highest id of the token we have as shift> > * when we expand macro rules, if we need to output a token from definition, we just re-use its id > * if we need to output a token from the argument, we increase its id by shift (so it's guaranteed to not to collide with anything from the definition) > * finally, when we have a HirFileId of the expansion, we can look up the original value of shift and classify node to the arg/def by comparing it's id with shift. > This PR implement first 3 points of above solution. Co-authored-by: Edwin Cheng <[email protected]>
| * Change to add 1 if non zero shiftEdwin Cheng2019-11-041-1/+1
| |
| * Refactor and renameEdwin Cheng2019-11-041-21/+20
| |
| * Change Option<u32> to u32 for shift valueEdwin Cheng2019-11-041-8/+5
| |
| * Change to better namingEdwin Cheng2019-11-041-3/+3
| |
| * Add TokenId Shif in macro_rulesEdwin Cheng2019-11-042-2/+74
| |
* | Merge #2172bors[bot]2019-11-043-138/+25
|\ \ | | | | | | | | | | | | | | | | | | | | | 2172: Use new text DSL instead of crate_graph! macro r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | Cleanup unused marksAleksey Kladov2019-11-041-10/+0
| | |