aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src
Commit message (Collapse)AuthorAgeFilesLines
* Minor clippy perf fixesLaurențiu Nicola2021-06-181-2/+2
|
* Nest all the or-patterns!Lukas Wirth2021-06-172-8/+10
|
* Merge #9260bors[bot]2021-06-142-2/+2
|\ | | | | | | | | | | | | | | 9260: tree-wide: make rustdoc links spiky so they are clickable r=matklad a=lf- Rustdoc was complaining about these while I was running with --document-private-items and I figure they should be fixed. Co-authored-by: Jade <[email protected]>
| * tree-wide: make rustdoc links spiky so they are clickableJade2021-06-142-2/+2
| |
* | cargo fmtMaan20032021-06-131-6/+5
| |
* | clippy::useless_returnMaan20032021-06-131-1/+1
| |
* | clippy::clone_on_copyMaan20032021-06-131-1/+0
| |
* | clippy::useless_conversionMaan20032021-06-134-11/+9
| |
* | clippy::redudant_borrowMaan20032021-06-133-5/+5
|/
* Remove unnecessary duplicationLukas Wirth2021-06-091-56/+8
|
* Implement dummy expansions for builtin attributesLukas Wirth2021-06-096-4/+140
|
* Fix typophynalle2021-06-081-1/+1
|
* Replace attribute with equivalent whitespaceJonas Schievink2021-06-061-2/+4
| | | | | This is needed to that the `TokenMap` we create contains offsets that match the source.
* Expand procedural attribute macrosJonas Schievink2021-06-034-7/+54
|
* Fall back to legacy preludeJonas Schievink2021-06-011-0/+1
|
* Implement per-edition preludesJonas Schievink2021-06-011-0/+4
|
* Thread proc-macro types through the HIRJonas Schievink2021-05-291-2/+3
|
* Remove fragment kind knowledge from builtin macrosJonas Schievink2021-05-292-23/+17
|
* Merge #9007bors[bot]2021-05-261-1/+1
|\ | | | | | | | | | | | | | | 9007: Internal: `clippy::redundant_clone` fixes r=lnicola a=lnicola bors r+ Co-authored-by: Laurențiu Nicola <[email protected]>
| * clippy::redundant_clone fixesLaurențiu Nicola2021-05-261-1/+1
| |
* | internal: move diagnostics to hirAleksey Kladov2021-05-253-115/+4
|/ | | | | | | | | | | | | | | | | | | | | | | The idea here is to eventually get rid of `dyn Diagnostic` and `DiagnosticSink` infrastructure altogether, and just have a `enum hir::Diagnostic` instead. The problem with `dyn Diagnostic` is that it is defined in the lowest level of the stack (hir_expand), but is used by the highest level (ide). As a first step, we free hir_expand and hir_def from `dyn Diagnostic` and kick the can up to `hir_ty`, as an intermediate state. The plan is then to move DiagnosticSink similarly to the hir crate, and, as final third step, remove its usage from the ide. One currently unsolved problem is testing. You can notice that the test which checks precise diagnostic ranges, unresolved_import_in_use_tree, was moved to the ide layer. Logically, only IDE should have the infra to render a specific range. At the same time, the range is determined with the data produced in hir_def and hir crates, so this layering is rather unfortunate. Working on hir_def shouldn't require compiling `ide` for testing.
* Merge #8977bors[bot]2021-05-243-4/+4
|\ | | | | | | | | | | | | | | 8977: internal: minor `TokenMap` cleanups r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]>
| * Make `TokenTextRange` privateJonas Schievink2021-05-243-4/+4
| |
* | internal: rename hypothetical -> speculativeAleksey Kladov2021-05-241-7/+7
|/ | | | | Lets steal this good naming from Roslyn before I forget about it yet again.
* Add even more docsAleksey Kladov2021-05-221-1/+1
|
* Support `#[register_attr]` and `#[register_tool]`Jonas Schievink2021-05-201-0/+2
|
* Track in-scope derive helpers during nameresJonas Schievink2021-05-191-1/+1
|
* Clarify field nameJonas Schievink2021-05-194-6/+6
|
* Simplify eager macro representationJonas Schievink2021-05-197-264/+156
|
* Implement `concat_idents`Edwin Cheng2021-05-132-0/+36
|
* Remove delimiters from proc macro inputJonas Schievink2021-05-122-1/+14
|
* Revert "Strip delimiter from fn-like proc macro input"Jonas Schievink2021-05-112-33/+2
| | | | This reverts commit bda68e23328ca62a71da348a13c4d13cc8f991f3.
* Strip delimiter from fn-like proc macro inputJonas Schievink2021-05-112-2/+33
|
* Rewrite `#[derive]` removal to be based on ASTJonas Schievink2021-05-104-107/+112
|
* Move `AttrId` back into `hir_def`Jonas Schievink2021-05-102-6/+3
|
* Merge #8776bors[bot]2021-05-094-63/+84
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8776: fix: fix unnecessary recomputations due to macros r=jonas-schievink a=jonas-schievink This computes a macro's fragment kind eagerly (when the calling file is still available in parsed form) and stores it in the `MacroCallLoc`. This means that during expansion we no longer have to reparse the file containing the macro call, avoiding the unnecessary salsa dependencies (https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-834776349). Marking as draft until I manage to find a test for this problem, since for some reason `typing_inside_a_function_should_not_invalidate_expansions` does not catch this (which might indicate that I misunderstand the problem). I've manually confirmed that this fixes the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-834776349: ``` 7ms - parse_query @ FileId(179) 12ms - SourceBinder::to_module_def 12ms - crate_def_map:wait 5ms - item_tree_query (1 calls) 7ms - ??? ``` Co-authored-by: Jonas Schievink <[email protected]>
| * Precompute macro fragment kindJonas Schievink2021-05-094-63/+84
| |
* | Escape characters in builtin macros correctlyEdwin Cheng2021-05-092-4/+4
|/
* Merge #8280bors[bot]2021-05-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 8280: Borrow text of immutable syntax node r=iDawer a=iDawer In https://github.com/rust-analyzer/rowan/pull/101 `rowan::SyntaxNode::green` returns `Cow<'_, GreenNodeData>`. It returns borrow of green node of immutable syntax tree node. Using this we can return borrowed text from `ast::Name::text`. ~~However now it allocates in case of mutable syntax trees.~~ (see next comment) The idea comes from https://github.com/rust-analyzer/rowan/pull/100#issuecomment-809330325 Co-authored-by: Dawer <[email protected]>
| * Fix buildDawer2021-05-061-1/+1
| |
* | Don't store call-site text offsets in hygiene infoJonas Schievink2021-05-061-22/+35
|/
* Document expansion queriesAleksey Kladov2021-05-041-0/+21
|
* simplify macro expansion codeAleksey Kladov2021-05-041-27/+17
| | | | | Using `Option` arguments such that you always pass `None` or `Some` at the call site is a code smell.
* make illegal states unrepresentableAleksey Kladov2021-05-043-49/+48
| | | | only declarative macros have def-site token map
* CleanupsAleksey Kladov2021-05-041-139/+134
|
* Merge #8727bors[bot]2021-05-041-11/+11
|\ | | | | | | | | | | | | | | | | 8727: minor: use standard import style r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * minor: use standard import styleAleksey Kladov2021-05-041-11/+11
| |
* | Merge #8726bors[bot]2021-05-041-3/+3
|\| | | | | | | | | | | | | | | | | 8726: internal: reduce visibility r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * internal: reduce visibilityAleksey Kladov2021-05-041-3/+3
| |
* | minor: unconfuse myself about macro def vs macro rulesAleksey Kladov2021-05-041-0/+5
|/