rust/crates/ra_ide/src
bors[bot] 59adc7bfb6
Merge #4596
4596: Strip leading underscores of argument names in function/method r=matklad a=kuy

Closes #4510 

### Goal

When I select a function/method from completions, I get a snippet that doesn't contain leading underscores of argument names.

### Solution

- Option 1: All signatures don't contain underscores
- Option 2: Keep same signature, but inserted snippet doesn't contain underscores

I choose Option 2 because I think that leading underscores is a part of "signature". Users should get correct signatures. On the other hand, trimming underscores is an assist by IDE.

### Other impls.

rls: Complete argument names with underscores (same as actual ra)
IntelliJ Rust: Doesn't complete argument names
VSCode (TypeScript): Doesn't complete argument names

### Working example

![Screen Shot 2020-05-25 at 0 03 21](https://user-images.githubusercontent.com/151614/82757771-a05e5b80-9e1d-11ea-9dbc-1263c960e2ae.png)


Co-authored-by: Yuki Kodama <endflow.net@gmail.com>
2020-05-27 12:41:38 +00:00
..
completion Merge #4596 2020-05-27 12:41:38 +00:00
display Trim at presentation layer 2020-05-26 01:06:25 +09:00
references KISS SourceChange 2020-05-22 18:04:26 +02:00
snapshots Add self keyword semantic token type 2020-05-25 12:08:58 +03:00
syntax_highlighting Add self keyword semantic token type 2020-05-25 12:08:58 +03:00
typing Less rust-analyzer specific onEnter 2020-05-25 14:28:47 +02:00
call_hierarchy.rs Propogate fixture meta to AnalysisHost 2020-05-16 15:23:43 +03:00
call_info.rs Switch to new magic marks 2020-05-20 13:02:53 +02:00
completion.rs Add AssistConfig 2020-05-19 20:28:27 +02:00
diagnostics.rs KISS SourceChange 2020-05-22 18:04:26 +02:00
display.rs Hover tooltip module name is monospace once again 2020-05-25 23:18:45 -04:00
expand_macro.rs Generalise syntax rewriting infrastructure to allow removal of nodes 2020-03-24 17:14:33 +01:00
extend_selection.rs Convert tests to text-size 2020-04-25 11:59:18 +02:00
folding_ranges.rs Introduce EffectExpr 2020-05-02 11:21:39 +02:00
goto_definition.rs Remove cross-crate marks 2020-05-20 13:00:50 +02:00
goto_type_definition.rs Convert tests to text-size 2020-04-25 11:59:18 +02:00
hover.rs Hover tooltip module name is monospace once again 2020-05-25 23:18:45 -04:00
impls.rs Convert tests to text-size 2020-04-25 11:59:18 +02:00
inlay_hints.rs Code review fixes 2020-05-04 11:04:02 +03:00
join_lines.rs Cleanup 2020-05-21 16:11:37 +02:00
lib.rs Less rust-analyzer specific onEnter 2020-05-25 14:28:47 +02:00
matching_brace.rs Convert code to text-size 2020-04-25 11:59:18 +02:00
mock_analysis.rs Propogate fixture meta to AnalysisHost 2020-05-16 15:23:43 +03:00
parent_module.rs Switch to new magic marks 2020-05-20 13:02:53 +02:00
prime_caches.rs main: eagerly prime goto-definition caches 2020-04-25 09:28:34 -04:00
references.rs Remove cross-crate marks 2020-05-20 13:00:50 +02:00
runnables.rs Fix tests 2020-05-24 15:47:05 +02:00
ssr.rs Fix some clippy perf warnings 2020-05-25 13:35:52 -04:00
status.rs
syntax_highlighting.rs Add self keyword semantic token type 2020-05-25 12:08:58 +03:00
syntax_tree.rs Introduce EffectExpr 2020-05-02 11:21:39 +02:00
typing.rs KISS SourceChange 2020-05-22 18:04:26 +02:00