aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
Commit message (Collapse)AuthorAgeFilesLines
*-----. Merge #5089 #5161 #5184 #5185 #5186bors[bot]2020-07-024-5/+71
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5089: Disable auto-complete on comments r=matklad a=BGluth Resolves #4907 by disabling any auto-completion on comments. As flodiebold [pointed out](https://github.com/rust-analyzer/rust-analyzer/issues/4907#issuecomment-648439979), in the future we may want to support some form of auto-completion within doc comments, but for now it was suggested to just disable auto-completion on them entirely. The implementation involves adding a new field `is_comment` to `CompletionContext` and checking if the immediate token we auto-completed on is a comment. I couldn't see a case where we need to check any of the ancestors, but let me know if this is not sufficient. I also wasn't sure if it was necessary to add a new field to this struct, but I decided it's probably the best option if we want to potentially do auto-completion on doc comments in the future. Finally, the three tests I added should I think ideally not filter results by `CompletionKind::Keyword`, but if I want to get unfiltered results, I need access to a non-public function [get_all_completion_items](https://github.com/rust-analyzer/rust-analyzer/blob/9a4d02faf9c47f401b8756c3f7fcab2198f5f9cd/crates/ra_ide/src/completion/test_utils.rs#L32-L39) which I don't know if I should make public just for this. 5161: SSR: Add initial support for placeholder constraints r=matklad a=davidlattimore 5184: Always install required nightly extension if current one is not nightly r=matklad a=Veetaha This is weird, but having switched back to stable by uninstalling the extension appears that vscode doesn't destroy the `PersistentState` and thus changing to `nightly` channel doesn't work because the last check for nightly extension was less than 1 hour ago. The simple solution is to skip this check if we know that the current extension version is not nightly. 5185: Force showing extension activation error pop-up notification r=matklad a=Veetaha Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5091 5186: fix: correct pd/ppd/tfn/tmod completion doc r=matklad a=fannheyward https://github.com/rust-analyzer/rust-analyzer/blob/a33eefa3b26000b3018e6bb873f18dbe15ab4ab7/crates/ra_ide/src/completion/complete_snippet.rs#L23-L24 Co-authored-by: BGluth <[email protected]> Co-authored-by: David Lattimore <[email protected]> Co-authored-by: Veetaha <[email protected]> Co-authored-by: Heyward Fann <[email protected]>
| | | | * fix: correct pd/ppd/tfn/tmod completion docHeyward Fann2020-07-021-4/+4
| |_|_|/ |/| | | | | | | | | | | https://github.com/rust-analyzer/rust-analyzer/blob/a33eefa3b26000b3018e6bb873f18dbe15ab4ab7/crates/ra_ide/src/completion/complete_snippet.rs#L23
| | * | SSR: Add initial support for placeholder constraintsDavid Lattimore2020-07-011-0/+12
| | | |
| * | | Auto-completion no longer occurs on commentsBGluth2020-07-011-1/+5
| | | |
| * | | Added tests for no auto-completion on commentsBGluth2020-07-011-0/+50
|/ / /
* | | Merge #5174bors[bot]2020-07-014-65/+67
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5174: Colorize more test fixtures r=matklad a=lnicola Co-authored-by: Laurențiu Nicola <[email protected]>
| * | | Colorize more test fixturesLaurențiu Nicola2020-07-014-65/+67
| | | |
* | | | 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
|