Commit Graph

22650 Commits

Author SHA1 Message Date
Ryo Yoshida
393a18b8ce
fix: escape receiver texts in format string completion 2022-06-27 23:20:23 +09:00
Ryo Yoshida
491e6eaf9e
fix: escape ${receiver} when completing with custom snippets 2022-06-27 23:20:17 +09:00
bors
9eaf96c9ea Auto merge of #12643 - Veykril:macro-compl, r=Veykril
fix: Fix completions for locals not working properly inside macro calls
2022-06-27 12:40:46 +00:00
Lukas Wirth
bdbffdd463 fix: Fix completions for locals not working properly inside macro calls 2022-06-27 14:39:44 +02:00
bors
4c3954682d Auto merge of #12635 - antogilbert:tgt_feat, r=Veykril
Correct target_feature completion

I changed the `target_feature` to match the description given in #12616.
2022-06-27 12:28:36 +00:00
bors
f6c0bf8f09 Auto merge of #12642 - weirdsmiley:master, r=Veykril
fix: deduplicate cfg completions

cfg completions are duplicated if they are set with multiple values.
This patch deduplicates them.

fixes: [#12623](https://github.com/rust-lang/rust-analyzer/issues/12623)
2022-06-27 12:16:06 +00:00
Manas
7f1fac7c26 fix: deduplicate cfg completions
cfg completions are duplicated if they are set with multiple values.
This patch deduplicates them.
2022-06-27 16:17:06 +05:30
Antonello Palazzi
bef89e95e7 Udate unit tests 2022-06-27 09:04:42 +01:00
bitgaoshu
dcb4837b2d WellFormed -> Holds 2022-06-26 23:09:06 +08:00
bitgaoshu
408fa148b9 add test for item same name 2022-06-26 22:48:26 +08:00
bors
b74e96f509 Auto merge of #12638 - buffet:fix-typo, r=flodiebold
Fix typo in build.rs
2022-06-26 10:43:30 +00:00
buffet
45b896002a Fix typo in build.rs 2022-06-26 10:09:45 +00:00
Hongxu Xu
f536766efb complete raw identifier with "r#" prefix 2022-06-26 14:45:30 +08:00
Antonello Palazzi
e4e2a46773 Correct target_feature completion 2022-06-26 00:50:41 +01:00
iDawer
fb6278e750 Reduce intermediate allocations while printing witnesses 2022-06-25 20:08:00 +05:00
bitgaoshu
0dbc091fee add test for suggest_name 2022-06-25 17:33:27 +08:00
bitgaoshu
82c1b313bc restore sth 2022-06-25 10:25:56 +08:00
bors
5bb123d970 Auto merge of #12520 - Veykril:flycheck-cancel, r=Veykril
internal: Bring back JodChild into flychecking for cancellation

cc https://github.com/rust-lang/rust-analyzer/pull/10517/files#r895241975
2022-06-24 17:42:00 +00:00
bitgaoshu
e3b1303c4f fix test in resolve_proc_macro: Foo is Owner 2022-06-25 01:02:39 +08:00
bitgaoshu
900b4208fd rename "trait_def" to "def_in_trait" 2022-06-24 23:04:35 +08:00
bitgaoshu
353829fc4e highlight: trait path 2022-06-24 23:04:35 +08:00
bitgaoshu
9ea8d5806d fix test in qualify_method: stay in trait path 2022-06-24 23:04:35 +08:00
bors
401a71d1d7 Auto merge of #12629 - flodiebold:proc-macro-error-improvement, r=Veykril
fix: Improve proc macro errors a bit

Distinguish between
 - there is no build data (for some reason?)
 - there is build data, but the cargo package didn't build a proc macro dylib
 - there is a proc macro dylib, but it didn't contain the proc macro we expected
 - the name did not resolve to any macro (this is now an
 unresolved_macro_call even for attributes)

I changed the handling of disabled attribute macro expansion to
immediately ignore the macro and report an unresolved_proc_macro,
because otherwise they would now result in loud unresolved_macro_call
errors. I hope this doesn't break anything.

Also try to improve error ranges for unresolved_macro_call / macro_error
by reusing the code for unresolved_proc_macro. It's not perfect but
probably better than before.
2022-06-24 12:27:59 +00:00
Florian Diebold
45fd5e697f Improve comments 2022-06-24 14:19:18 +02:00
Florian Diebold
c80c34867f Improve proc macro errors a bit
Distinguish between
 - there is no build data (for some reason?)
 - there is build data, but the cargo package didn't build a proc macro dylib
 - there is a proc macro dylib, but it didn't contain the proc macro we expected
 - the name did not resolve to any macro (this is now an
 unresolved_macro_call even for attributes)

I changed the handling of disabled attribute macro expansion to
immediately ignore the macro and report an unresolved_proc_macro,
because otherwise they would now result in loud unresolved_macro_call
errors. I hope this doesn't break anything.

Also try to improve error ranges for unresolved_macro_call / macro_error
by reusing the code for unresolved_proc_macro. It's not perfect but
probably better than before.
2022-06-24 13:45:19 +02:00
bitgaoshu
9e6bff79f4 fix some test due to resolve to where trait m impl 2022-06-24 19:15:16 +08:00
bitgaoshu
6ecabe352a functions resolve to impl 2022-06-24 19:11:35 +08:00
bors
434e718b67 Auto merge of #12605 - erhuve:fix/determine-doc-link-type-at-start, r=erhuve
fix: doc_links link type - Determine link type at start (fixes #12601)

fixes #12601
Looked like autolink/inline mismatch happened because end_link_type was parsed from the Text/Code events.
I changed it to be determined from the Start event, which should hopefully remain accurate while staying true to the cases where link type may need to be changed, according to the comment
```
// normally link's type is determined by the type of link tag in the end event,
// however in some cases we want to change the link type, for example,
// `Shortcut` type doesn't make sense for url links
```
Hopefully this is the desired behavior?
![Untitled](https://user-images.githubusercontent.com/59463268/174696581-3b1140a5-cdf0-4eda-9a11-ec648e4e7d21.gif)
2022-06-23 23:15:33 +00:00
Raymond Luo
5107123f9a clarify comment and add autolink test case 2022-06-23 19:02:30 -04:00
Laurențiu Nicola
21642a2d85 Try to publish releases to OpenVSX 2022-06-23 22:18:08 +03:00
bors
32b40ded0f Auto merge of #12628 - Veykril:simplify, r=Veykril
internal: Simplify
2022-06-23 18:13:08 +00:00
Lukas Wirth
2642f64570 internal: Simplify 2022-06-23 20:08:29 +02:00
CuriousCorrelation
e0c17e8777 fix: trailing ':' on empty inactive reasons
Fixes: #12615
2022-06-23 22:10:27 +05:30
bors
19fad541bd Auto merge of #12625 - yue4u:fix/non-exhaustive-variant, r=Veykril
fix: completes non exhaustive variant within the defining crate

close #12624
2022-06-23 15:05:39 +00:00
yue4u
472ae16bfb fix: completes non exhaustive variant within the defining crate 2022-06-24 00:00:51 +09:00
Florian Diebold
36fadc4224 Fix unstable feature use 2022-06-23 16:05:59 +02:00
Florian Diebold
f410fdf6e3 Add two more tests 2022-06-23 14:49:05 +02:00
Florian Diebold
29f01cd9d2 Various cleanups
- remove Valid, it serves no purpose and just obscures the diff
 - rename some things
 - don't use is_valid_candidate when searching for impl, it's not necessary
2022-06-23 14:38:28 +02:00
bitgaoshu
1064c7513a reformat code 2022-06-23 14:01:22 +02:00
bitgaoshu
1ef5e14c2c goto where trait method impl 2022-06-23 14:01:22 +02:00
Raymond Luo
96ff235770 condense matches on autolink 2022-06-22 22:07:26 -04:00
soruh
817082cad6 add doc strings to use_trivial_contructor.rs 2022-06-22 16:49:50 +02:00
soruh
f9379df630 add use_trivial_contructor.rs 2022-06-22 16:34:01 +02:00
soruh
f780145c4a apply suggestions 2022-06-22 16:29:59 +02:00
Raymond Luo
b7e3f525bd handle autolink as edge case 2022-06-20 23:15:27 -04:00
Raymond Luo
c6f776c5f9 determine doc link type from start instead of text or code 2022-06-20 21:10:45 -04:00
bors
6fc5c3cd21 Auto merge of #12604 - Veykril:completions, r=Veykril
internal: Simplify some completions
2022-06-20 19:56:05 +00:00
Lukas Wirth
7a0774defa internal: Simplify some completions 2022-06-20 21:55:33 +02:00
bors
312ac83caf Auto merge of #12599 - flodiebold:no-test-deps, r=flodiebold
fix: Only apply `cfg(test)` for local crates

Don't analyze dependencies with `test`; this should fix various cases where crates use `cfg(not(test))` and so we didn't find things.

"Local" here currently means anything that's not from the registry, so anything inside the workspace, but also path dependencies. So this isn't perfect, and users might still need to use `rust-analyzer.cargo.unsetTest` for these in some cases.
2022-06-20 18:42:48 +00:00
Florian Diebold
07d78b67cb Fix test 2022-06-20 20:34:08 +02:00