Commit Graph

157 Commits

Author SHA1 Message Date
Zac Pullar-Strecker
d2c68809ea Changes from review 2020-10-08 15:05:24 +13:00
Zac Pullar-Strecker
e4a787fcbc Remove outdated part of doc_links module docs 2020-10-08 15:05:23 +13:00
Zac Pullar-Strecker
f6759ba3bb Add ignored test to demonstrate ImportMap bug 2020-10-08 15:05:23 +13:00
Zac Pullar-Strecker
6cae6b8f3c Fix namespace detection & function test 2020-10-08 15:04:57 +13:00
Zac Pullar-Strecker
37a4d060a7 Add tests 2020-10-08 15:04:57 +13:00
Zac Pullar-Strecker
26086faab2 Change Option::Some bug to a fixme note
IMO this is too much work to be worth fixing at the moment.
2020-10-08 15:04:57 +13:00
Zac Pullar-Strecker
c648884397 Differentiate method/tymethod by determining 'defaultness'
Currently a method only has defaultness if it is a provided trait
method, but this will change when specialisation is available and may
need to become a concept known to hir.

I opted to go for a 'fewest changes' approach given specialisation is
still under development.
2020-10-08 15:04:21 +13:00
Zac Pullar-Strecker
974518fde7 Code reorganisation and field support 2020-10-08 15:04:20 +13:00
Zac Pullar-Strecker
a14194b428 Changes from review 2020-10-08 15:01:30 +13:00
Zac Pullar-Strecker
8c32bdea36 Rename ide::link_rewrite -> ide::doc_links & tidy imports 2020-10-08 15:01:30 +13:00
Zac Pullar-Strecker
a06d736b77 Add support for struct & trait methods 2020-10-08 14:59:31 +13:00
Zac Pullar-Strecker
bfda0d2583 WIP: Command to open docs under cursor 2020-10-08 14:59:31 +13:00
bors[bot]
83a651b123
Merge #6154
6154: Shorten type hints for std::iter Iterators r=SomeoneToIgnore a=Veykril

Fixes #3750.

This re-exports the `hir_expand::name::known` module to be able to fetch the `Iterator` and `iter` names.
I'm not sure if there is anything to do with `Solution::Ambig` in `normalize_trait_assoc_type` or whether discarding those results is always wanted.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-07 11:52:05 +00:00
Lukas Wirth
783af171f7 Clean up inlay_hints 2020-10-07 13:18:12 +02:00
Lukas Wirth
e106857e80 Shorten iterator hints for std::iter iterators behind references 2020-10-07 12:14:08 +02:00
Lukas Wirth
209e9b9926 Shorten iterator chain hints 2020-10-07 11:30:42 +02:00
Lukas Wirth
c133651e0a Move IntoIterator into FamousDefs 2020-10-07 10:14:42 +02:00
Lukas Wirth
c6f1de6ac5 Use FamousDefs for shorten_iterator hint 2020-10-06 21:25:39 +02:00
bors[bot]
bf1043cac2
Merge #6128
6128: Trim all trailing whitespace in onEnter r=matklad a=repnop

Fixes #5848

Co-authored-by: Wesley Norris <repnop@outlook.com>
2020-10-06 18:17:49 +00:00
bors[bot]
57735f2a32
Merge #6140
6140: honour hover.content_format client capability r=lnicola a=robinvd

This removes all markdown when the client does not support the markdown MarkupKind.

Otherwise the output on the editor will have some markdown boilerplate, making it less readable.

For example kak_lsp does not currently support markdown.
![image](https://user-images.githubusercontent.com/22073483/95112949-ef0ff080-0741-11eb-82a7-0594fa2cd736.png)

after:
![image](https://user-images.githubusercontent.com/22073483/95113089-2bdbe780-0742-11eb-94fa-bcfec6d7347a.png)



Co-authored-by: Robin van Dijk <robin@robinjint.nl>
2020-10-06 17:51:20 +00:00
Lukas Wirth
aaa3905fdd Shorten type hints for std::iter Iterators 2020-10-06 19:20:42 +02:00
Robin van Dijk
bd7bf4a276 add break after codeblocks 2020-10-06 16:34:38 +02:00
Robin van Dijk
bc890ed5b0 add doc describing limited capabilities 2020-10-06 16:34:26 +02:00
bors[bot]
8bf13292f0
Merge #6148
6148: Fix trait object hir formatting behind pointer and references r=matklad a=Veykril

Fixes #6064

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2020-10-06 13:28:03 +00:00
Lukas Wirth
643bbf15a2 Fix trait object hir formatting behind pointer and references 2020-10-06 14:40:27 +02:00
bors[bot]
87cb840a4e
Merge #6124
6124: Better normalized crate name usage r=jonas-schievink a=SomeoneToIgnore

Closes https://github.com/rust-analyzer/rust-analyzer/issues/5343 
Closes https://github.com/rust-analyzer/rust-analyzer/issues/5932

Uses normalized name for code snippets (to be able to test the fix), hover messages and documentation rewrite links (are there any tests for those?).
Also renamed the field to better resemble the semantics.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-10-06 11:51:15 +00:00
bors[bot]
44587d1bfc
Merge #6127
6127: Correctly complete items with leading underscore r=SomeoneToIgnore a=fmease

Fixes #6091. Let me know if the test is placed into the right file or if it is even desired.

Co-authored-by: León Orell Valerian Liehr <liehr.exchange@gmx.net>
2020-10-05 21:27:18 +00:00
Aleksey Kladov
bff812ddfe Fix feature name 2020-10-05 20:25:11 +02:00
Robin van Dijk
81f61afa9f add docstring 2020-10-05 20:06:25 +02:00
Robin van Dijk
c3cc361294 honor content_format clientcap
This removes all markdown when the client does not support the markdown MarkupKind

Otherwise the output on the editor will have some markdown boilerplate, making it less readable
2020-10-05 19:27:29 +02:00
Wesley Norris
adb3c56ff0 Trim all trailing whitespace in onEnter
Fixes #5848
2020-10-03 14:17:21 -04:00
Igor Aleksanov
3cadba4956 Improve readability in inlay_hints.rs 2020-10-03 13:44:43 +03:00
Igor Aleksanov
91a09f50f4 Remove 'for_expr' test from inlay_hints.rs 2020-10-03 08:58:17 +03:00
Igor Aleksanov
a58441ad1b Make the tests for complete/incomplete for inlay hints work 2020-10-03 08:37:58 +03:00
Igor Aleksanov
8ca214fbfb Better inlay hints in 'for' loops 2020-10-03 08:30:25 +03:00
León Orell Valerian Liehr
32864e3b49 Correctly complete items with leading underscore 2020-10-03 03:00:09 +02:00
Kirill Bulatov
9d19e5b962 Properly name the field 2020-10-02 21:38:22 +03:00
Kirill Bulatov
cae2e859ff Add a dash test 2020-10-02 20:59:32 +03:00
Aleksey Kladov
b06259673f rename mock_analysis -> fixture 2020-10-02 17:49:44 +02:00
Aleksey Kladov
09348b2474 Get rid of MockAnalysis 2020-10-02 17:31:20 +02:00
Aleksey Kladov
8716c4cec3 Move ide::AnalysisChange -> base_db::Change
This seems like a better factoring logically; ideally, clients shouldn't touch
`set_` methods of the database directly. Additionally, I think this
should remove the unfortunate duplication in fixture code.
2020-10-02 16:45:08 +02:00
Aleksey Kladov
700c9bc019 Expectify find_references tests 2020-10-02 16:42:48 +02:00
Aleksey Kladov
763b13a74e Reduce visibiity 2020-10-02 14:26:40 +02:00
Igor Aleksanov
97f2905dec Use expect_test to make format_str_parser test more data-driven 2020-10-02 14:51:20 +03:00
Igor Aleksanov
76d0546ac7 Use lookup table instead of enum for postfix completion kinds 2020-10-02 13:33:27 +03:00
Igor Aleksanov
b7ac540f15 Use ast::String for extracting string literal contents 2020-10-02 13:23:49 +03:00
Igor Aleksanov
2557cb8518 Improve format-like completions code appearance 2020-10-02 12:49:33 +03:00
Igor Aleksanov
777ccb58f0 Add missing entry to doc-comment 2020-10-02 12:42:39 +03:00
Igor Aleksanov
cd3d654f60 Simplify is_string_literal function 2020-10-02 12:42:39 +03:00
Igor Aleksanov
e447b3a4a2 Improve checks for postfix suggestions 2020-10-02 12:42:39 +03:00