aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge #5175bors[bot]2020-07-011-0/+4
|\ | | | | | | | | | | | | | | 5175: More memory-efficient impl collection r=matklad a=jonas-schievink This saves roughly 90 MB in `ImplsFromDepsQuery`, which used to copy the list of all impls from libcore into *every* crate in the graph. It also stops collecting inherent impls from dependencies entirely, as those can only be located within the crate defining the self type. Co-authored-by: Jonas Schievink <[email protected]>
| * Split `CrateImplDefs` in inherent and trait implsJonas Schievink2020-07-011-0/+4
| | | | | | | | | | | | This makes the intention of inherent vs. trait impls somewhat more clear and also fixes (?) an issue where trait impls with an unresolved trait were added as inherent impls instead (hence the test changes).
* | Merge #5178bors[bot]2020-07-012-293/+296
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5178: Fold multiline calls r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Fold multiline callsAleksey Kladov2020-07-011-80/+81
| | |
| * | Update file structure testsAleksey Kladov2020-07-011-213/+215
| | |
* | | Update expand macro testsAleksey Kladov2020-07-011-126/+115
|/ /
* / Reuse Semantics instancesLaurențiu Nicola2020-07-014-29/+33
|/
* Use the selection range when resolving call hierarchy itemsJeremy Kolb2020-07-011-0/+37
| | | | | | Add a test in call_hierarchy that already passed Fixes #5103
* Move test data to test_data directoryAleksey Kladov2020-07-017-467/+6
|
* Add file support to expectAleksey Kladov2020-07-011-12/+10
|
* Merge #5158bors[bot]2020-07-011-1/+1
|\ | | | | | | | | | | | | | | | | 5158: Use CrateName correctly r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * Use Strings for display namesAleksey Kladov2020-07-011-1/+1
| |
* | Make SemanticsScope non-genericLaurențiu Nicola2020-07-011-1/+1
|/
* Switch to expect for the rest of inlay testsAleksey Kladov2020-06-301-74/+100
|
* Simplify most of the inlay hints testsAleksey Kladov2020-06-301-623/+177
|
* Refactor runnable testsAleksey Kladov2020-06-301-525/+511
|
* Remove confusing APIAleksey Kladov2020-06-302-23/+15
|
* Rewrite goto implementation testsAleksey Kladov2020-06-303-104/+119
|
* Rewrite goto definition testsAleksey Kladov2020-06-303-613/+483
|
* Merge #5132bors[bot]2020-06-301-1/+1
|\ | | | | | | | | | | | | | | 5132: Fix some typos r=matklad a=davidlattimore Co-authored-by: David Lattimore <[email protected]>
| * Fix some typosDavid Lattimore2020-06-301-1/+1
| |
* | Merge #5101bors[bot]2020-06-301-8/+33
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5101: Add expect -- a light-weight alternative to insta r=matklad a=matklad This PR implements a small snapshot-testing library. Snapshot updating is done by setting an env var, or by using editor feature (which runs a test with env-var set). Here's workflow for updating a failing test: ![expect](https://user-images.githubusercontent.com/1711539/85926956-28afa080-b8a3-11ea-9260-c6d0d8914d0b.gif) Here's workflow for adding a new test: ![expect-fresh](https://user-images.githubusercontent.com/1711539/85926961-306f4500-b8a3-11ea-9369-f2373e327a3f.gif) Note that colorized diffs are not implemented in this PR, but should be easy to add (we already use them in test_utils). Main differences from insta (which is essential for rust-analyzer development, thanks @mitsuhiko!): * self-updating tests, no need for a separate tool * fewer features (only inline snapshots, no redactions) * fewer deps (no yaml, no persistence) * tighter integration with editor * first-class snapshot object, which can be used to write test functions (as opposed to testing macros) * trivial to tweak for rust-analyzer needs, by virtue of being a workspace member. I think eventually we should converge to a single snapshot testing library, but I am not sure that `expect` is exactly right, so I suggest rolling with both insta and expect for some time (if folks agree that expect might be better in the first place!). # Editor Integration Implementation The thing I am most excited about is the ability to update a specific snapshot from the editor. I want this to be available to other snapshot-testing libraries (cc @mitsuhiko, @aaronabramov), so I want to document how this works. The ideal UI here would be a code action (:bulb:). Unfortunately, it seems like it is impossible to implement without some kind of persistence (if you save test failures into some kind of a database, like insta does, than you can read the database from the editor plugin). Note that it is possible to highlight error by outputing error message in rustc's format. Unfortunately, one can't use the same trick to implement a quick fix. For this reason, expect makes use of another rust-analyzer feature -- ability to run a single test at the cursor position. This does need some expect-specific code in rust-analyzer unfortunately. Specifically, if rust-analyzer notices that the cursor is on `expect!` macro, it adds a special flag to runnable's JSON. However, given #5017 it is possible to approximate this well-enough without rust-analyzer integration. Specifically, an extension can register a special runner which checks (using regexes) if rust-anlyzer runnable covers text with specific macro invocation and do special magic in that case. closes #3835 Co-authored-by: Aleksey Kladov <[email protected]>
| * Add example expect test for goto definitionAleksey Kladov2020-06-271-8/+33
| |
* | Merge #5105bors[bot]2020-06-282-8/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | 5105: Simlify with matches!() r=matklad a=Veetaha Co-authored-by: Veetaha <[email protected]>
| * | Simlify with matches!()Veetaha2020-06-282-8/+3
| | |
* | | Don't show ra_fixture param hintsAleksey Kladov2020-06-281-1/+2
|/ /
* | Remove unneeded code, filename from tests, fix rebasing issuesPaul Daniel Faria2020-06-278-13/+72
| |
* | Revert ide highlighting changes (addressing on another branch)Paul Daniel Faria2020-06-279-100/+10
| |
* | Add HighlightTag::Operator, use it for unsafe deref. Move unsafe validation ↵Paul Daniel Faria2020-06-276-7/+7
| | | | | | | | to its own file
* | Account for deref token in syntax highlighting of unsafe, add test for that casePaul Daniel Faria2020-06-271-0/+1
| |
* | Fix typo in testPaul Daniel Faria2020-06-271-1/+1
| |
* | Move diagnostics back into expr, add tests for diagnostics, fix logic to ↵Paul Daniel Faria2020-06-271-0/+2
| | | | | | | | account for derefs of raw ptrs
* | Add unsafe diagnostics and unsafe highlightingPaul Daniel Faria2020-06-271-0/+28
|/
* Add `::` to label for `crate::` completionAleksey Kladov2020-06-271-7/+7
|
* cleanupAleksey Kladov2020-06-271-13/+10
|
* Fix matchig brace for pipesAleksey Kladov2020-06-251-1/+5
|
* matching brace works for | in lambdasAleksey Kladov2020-06-251-5/+22
|
* SimplifyAleksey Kladov2020-06-242-67/+18
|
* SimplifyAleksey Kladov2020-06-244-47/+38
|
* SimplifyAleksey Kladov2020-06-241-6/+3
|
* SimplifyAleksey Kladov2020-06-242-14/+3
|
* SimplifyAleksey Kladov2020-06-241-10/+6
|
* Remove duplicationAleksey Kladov2020-06-248-41/+34
|
* More consistent usage of fixturesAleksey Kladov2020-06-2416-1061/+1070
|
* Use fixtures moreAleksey Kladov2020-06-246-133/+135
|
* Merge #4940bors[bot]2020-06-2410-37/+86
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 4940: Add support for marking doctest items as distinct from normal code r=ltentrup a=Nashenas88 This adds `HighlightTag::Generic | HighlightModifier::Injected` as the default highlight for all elements within a doctest. Please feel free to suggest that a new tag be created or a different one used. ![Screenshot from 2020-06-23 09-18-13](https://user-images.githubusercontent.com/1673130/85408493-9752ce00-b532-11ea-94fe-197353ccc778.png) Fixes #4929 Fixes #4939 Co-authored-by: Paul Daniel Faria <[email protected]> Co-authored-by: Paul Daniel Faria <[email protected]>
| * Improve readability be replacing hard-to-read if-else branches with a matchPaul Daniel Faria2020-06-241-16/+20
| |
| * Remove unrelated changePaul Daniel Faria2020-06-231-4/+2
| |
| * Update comment for pop_and_injectPaul Daniel Faria2020-06-231-2/+2
| | | | | | Co-authored-by: Leander Tentrup <[email protected]>
| * Update injection mechanism and stop injecting through highlight element, ↵Paul Daniel Faria2020-06-2312-216/+237
| | | | | | | | switch to more general new highlight tag, generic