aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db
Commit message (Collapse)AuthorAgeFilesLines
...
* Handle self/super/crate in PathSegment as NameRefLukas Wirth2021-01-153-21/+36
|
* Phase out SourceFileEdits in favour of a plain HashMapLukas Wirth2021-01-141-25/+25
|
* Group file source edits by FileIdLukas Wirth2021-01-141-12/+42
|
* Merge #7260bors[bot]2021-01-142-88/+121
|\ | | | | | | | | | | | | | | | | | | | | 7260: Render Fn* trait objects and impl types as rust does r=matklad a=Veykril Also fixes raw ptr impl types being rendered ambiguously with multiple predicates. This moves out the `FamousDefs::Fixture` into its own file as well, cause I figured it is big enough to get its own file at this point + we also get highlighting this way when editing it. Fixes #3012 Co-authored-by: Lukas Wirth <[email protected]>
| * Render Fn* trait objects and impl types as rust doesLukas Wirth2021-01-131-0/+1
| |
| * Move FamousDefs fixture out into its own fileLukas Wirth2021-01-122-88/+120
| |
* | Rename FileReferences -> UsageSearchResultLukas Wirth2021-01-121-6/+5
| |
* | Ensure uniqueness of file ids in reference search via hashmapLukas Wirth2021-01-121-19/+29
| |
* | Group references by FileIdLukas Wirth2021-01-121-37/+64
|/
* Merge #7218bors[bot]2021-01-101-1/+1
|\ | | | | | | | | | | | | | | 7218: Fix typos r=Veykril a=regexident Apart from the very last commit on this PR (which fixes a public type's name) all changes are non-breaking. Co-authored-by: Vincent Esche <[email protected]>
| * Fixed typos in code commentsVincent Esche2021-01-091-1/+1
| |
* | Use hir::GenericParam in ide_db::Definition instead of relisting all 3Lukas Wirth2021-01-102-22/+16
|/
* Merge #7145bors[bot]2021-01-081-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7145: Proper handling $crate Take 2 [DO NOT MERGE] r=edwin0cheng a=edwin0cheng Similar to previous PR (#7133) , but improved the following things : 1. Instead of storing the whole `ExpansionInfo`, we store a similar but stripped version `HygieneInfo`. 2. Instread of storing the `SyntaxNode` (because every token we are interested are IDENT), we store the `TextRange` only. 3. Because of 2, we now can put it in Salsa. 4. And most important improvement: Instead of computing the whole frames every single time, we compute it recursively through salsa: (Such that in the best scenario, we only need to compute the first layer of frame) ```rust let def_site = db.hygiene_frame(info.def.file_id); let call_site = db.hygiene_frame(info.arg.file_id); HygieneFrame { expansion: Some(info), local_inner, krate, call_site, def_site } ``` The overall speed compared to previous PR is much faster (65s vs 45s) : ``` [WITH old PR] Database loaded 644.86ms, 284mi Crates in this dir: 36 Total modules found: 576 Total declarations: 11153 Total functions: 8715 Item Collection: 15.78s, 91562mi Total expressions: 240721 Expressions of unknown type: 2635 (1%) Expressions of partially unknown type: 2064 (0%) Type mismatches: 865 Inference: 49.84s, 250747mi Total: 65.62s, 342310mi rust-analyzer -q analysis-stats . 66.72s user 0.57s system 99% cpu 1:07.40 total [WITH this PR] Database loaded 665.83ms, 284mi Crates in this dir: 36 Total modules found: 577 Total declarations: 11188 Total functions: 8743 Item Collection: 15.28s, 84919mi Total expressions: 241229 Expressions of unknown type: 2637 (1%) Expressions of partially unknown type: 2064 (0%) Type mismatches: 868 Inference: 30.15s, 135293mi Total: 45.43s, 220213mi rust-analyzer -q analysis-stats . 46.26s user 0.74s system 99% cpu 47.294 total ``` *HOWEVER*, it is still a perf regression (35s vs 45s): ``` [WITHOUT this PR] Database loaded 657.42ms, 284mi Crates in this dir: 36 Total modules found: 577 Total declarations: 11177 Total functions: 8735 Item Collection: 12.87s, 72407mi Total expressions: 239380 Expressions of unknown type: 2643 (1%) Expressions of partially unknown type: 2064 (0%) Type mismatches: 868 Inference: 22.88s, 97889mi Total: 35.74s, 170297mi rust-analyzer -q analysis-stats . 36.71s user 0.63s system 99% cpu 37.498 total ``` Co-authored-by: Edwin Cheng <[email protected]>
| * Proper handling $crate Take 2Edwin Cheng2021-01-071-0/+1
| |
* | Change <|> to $0 - RebaseKevaundray Wedderburn2021-01-073-37/+37
| |
* | Remove some stale deprecationsAleksey Kladov2021-01-071-1/+0
| |
* | Align config's API with usageAleksey Kladov2021-01-061-2/+18
| | | | | | | | The config now is mostly immutable, optimize for that.
* | Code review fixesKirill Bulatov2021-01-041-3/+18
| |
* | Upgrade expect-test to 1.1Jesse Bakker2021-01-031-1/+1
|/
* Fix type error with .and_thenNick Spain2021-01-021-15/+14
|
* Handle not finding range in Definition::search_scopeNick Spain2021-01-021-12/+36
| | | | | | The `LifetimeParam` and `Local` variants use `source()` to find their range. Now that `source()` returns an `Option` we need to handle the `None` case.
* Mark HasSource::source_old as deprecated but allow at all call sitesNick Spain2021-01-021-0/+2
|
* HasSource::source -> HasSource::source_oldNick Spain2021-01-021-12/+12
| | | | To start migrating HasSource::source to return an Option.
* Merge #7080bors[bot]2021-01-011-2/+11
|\ | | | | | | | | | | | | | | 7080: Implement ConstParams for HIR r=Veykril a=Veykril r? @flodiebold Co-authored-by: Lukas Wirth <[email protected]>
| * Add ConstParams to the ide layerLukas Wirth2021-01-011-2/+11
| |
* | Update crateskjeremy2020-12-301-1/+1
| |
* | Avoid a couple of allocationsLaurențiu Nicola2020-12-291-6/+6
| |
* | Add docs and optimisationsKirill Bulatov2020-12-281-3/+3
| |
* | Better query api and fuzzy searchKirill Bulatov2020-12-281-7/+6
| |
* | Draft the module exclusion in modulesKirill Bulatov2020-12-281-2/+8
|/
* Support labels in reference searchLukas Wirth2020-12-241-5/+13
|
* Add initial_contents field for CreateFileDaiki Ihara2020-12-211-1/+1
|
* Align code_model name with ungrammarAleksey Kladov2020-12-202-3/+3
|
* Don't expose SyntaxKind from IDE APIAleksey Kladov2020-12-181-8/+40
| | | | | | SyntaxKind is somewhat of an internal type, but IDE is using it to basically specify an icon. Let's have a dedicated entity for this instead.
* Do not merge imports with different attributesJesse Bakker2020-12-182-1/+28
|
* Rename ImplDef -> ImplAleksey Kladov2020-12-172-3/+3
| | | | | | We used to have `Def` suffix for all symbols, but we moved off from that. `FunctionDef` isn't better than `Function`. Looks like we've forgot to change `Impl` though!
* Merge #6907bors[bot]2020-12-173-18/+107
|\ | | | | | | | | | | | | | | | | | | 6907: Lifetime reference search r=matklad a=Veykril PR #6787 but rewritten to make use of the HIR now. This only applies to Lifetimes, not labels. Also Higher-Ranked Trait Bounds aren't supported yet, but I feel like this PR is big enough as is which is why I left them out after noticing I forgot about them. Supporting renaming required slight changes in the renaming module as lifetime names aren't allowed for anything but lifetimes(and labels) and vice versa for normal names. Co-authored-by: Lukas Wirth <[email protected]>
| * Lifetime reference searchLukas Wirth2020-12-163-18/+107
| |
* | Remove `module_lang_items`Jonas Schievink2020-12-161-1/+0
|/ | | | | It isn't used anywhere except in `crate_lang_items`. Remove it to slightly reduce memory usage and simplify the code.
* Move to upstream `macro_rules!` modelJonas Schievink2020-12-152-8/+2
|
* Add find usages for enum constructorsDaiki Ihara2020-12-141-0/+15
|
* Normalize spelling to American EnglishAleksey Kladov2020-12-102-18/+18
|
* Introduce anchored_pathAleksey Kladov2020-12-092-7/+7
| | | | | They allow to represent paths like `#[path = "C:\path.rs"] mod foo;` in a lossless cross-platform & network-transparent way.
* Merge #6750bors[bot]2020-12-081-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | 6750: Remove documentation query, move doc handling to attributes r=matklad a=Veykril Fixes #3182 Removes the documentation query in favor of `Attrs::docs`. Attrs already handlded doc comments partially but the alloc saving check was wrong so it only worked when other attributes existed as well. Unfortunately the `new` constructor has to do an intermediate allocation now because we need to keep the order of mixed doc attributes and doc comments. I've also partially adjusted the `hover` module to have its tests check the changes, it still has some `HasSource` trait usage due to the `ShortLabel` trait usage, as that is only implemented on the Ast parts and not the Hir, should this ideally be implemented for the Hir types as well?(would be a follow up PR of course) Co-authored-by: Lukas Wirth <[email protected]>
| * Remove documentation queryLukas Wirth2020-12-071-1/+0
| |
* | Tweak the search query params for better lookup speedKirill Bulatov2020-12-081-1/+9
| |
* | Disable the completion for no corresponding client resolve capabilitiesKirill Bulatov2020-12-071-12/+2
| |
* | Remove the stateKirill Bulatov2020-12-071-31/+1
| |
* | Make completion resolve asyncKirill Bulatov2020-12-071-1/+31
|/
* Add slightly more profiling detailsJonas Schievink2020-12-041-1/+1
|