Commit graph

24277 commits

Author SHA1 Message Date
Laurențiu Nicola
549b53bbea Merge branch 'master' into sync-from-rust 2023-02-21 08:37:01 +02:00
Laurențiu Nicola
7e711da2f0 ⬆️ rust-analyzer 2023-02-20 10:14:12 +02:00
bors
a6603fc21d Auto merge of #14171 - Ethan-000:master, r=matklad
fix link

Fixes https://github.com/rust-lang/rust-analyzer/issues/14170
2023-02-16 21:49:22 +00:00
Ethan-000
936bac31d4
fix link 2023-02-16 21:45:56 +00:00
bors
b881deb66a Auto merge of #14165 - Veykril:completion-item, r=Veykril
internal: Make CompletionItem more POD-like
2023-02-16 08:30:56 +00:00
Lukas Wirth
404a51f26a internal: Make CompletionItem more POD-like 2023-02-16 09:29:55 +01:00
bors
d011e79d90 Auto merge of #14162 - azriel91:bugfix/14161/generate-getter-snippet-cap-check, r=Veykril
Conditionally add snippet marker.

Fixes #14161.

Heya, I just added the code with some tests, but not sure if it's *the way* to do it -- I didn't refactor existing methods for the `check` test method, but added another calling layer.
2023-02-16 08:10:32 +00:00
Azriel Hoh
a6f54d6c5f Conditionally add snippet marker. 2023-02-16 10:50:27 +13:00
bors
1f2d33fb40 Auto merge of #14160 - Veykril:hover-call, r=Veykril
fix: Bring back hovering call parens for return type info
2023-02-15 17:59:31 +00:00
Lukas Wirth
e550e553e0 fix: Bring back hovering call parens for return type info 2023-02-15 18:58:59 +01:00
bors
dd582dac67 Auto merge of #14157 - Veykril:inlay, r=Veykril
Adjust binding mode inlay hints to render better with @ patterns
2023-02-15 13:47:29 +00:00
Lukas Wirth
5859190066 Adjust binding mode inlay hints to render better with @ patterns 2023-02-15 14:47:02 +01:00
bors
a04054ac39 Auto merge of #14156 - Veykril:completion-pod, r=Veykril
internal: Don't reconstruct ref match completion in to_proto manually

cc https://github.com/rust-lang/rust-analyzer/issues/12571
2023-02-15 13:17:27 +00:00
Lukas Wirth
23fc596e40 Don't reconstruct ref match completion in to_proto manually 2023-02-15 14:15:22 +01:00
Lukas Wirth
026a8c976d Simplify 2023-02-15 13:38:42 +01:00
bors
160305b215 Auto merge of #14154 - lnicola:rand-typos, r=lnicola
minor: Fix a pair of typos
2023-02-15 12:11:36 +00:00
Laurențiu Nicola
6e5ec0b3ce Fix a pair of typos 2023-02-15 14:11:11 +02:00
bors
89b9940491 Auto merge of #14153 - CraftSpider:v7-metadata, r=CraftSpider
Add v7 metadata support to rust-analyzer

Paired to https://github.com/rust-lang/rust/pull/101550
2023-02-14 20:03:09 +00:00
Rune Tynan
853f047245
Cargo fmt 2023-02-14 14:45:05 -05:00
Rune Tynan
bc81d582c9
Add v7 support to rust-analyzer 2023-02-14 12:29:33 -05:00
bors
37608f306c Auto merge of #14152 - Veykril:path-opt, r=Veykril
Replace some often empty `Vec`s with boxed slices
2023-02-14 16:58:58 +00:00
bors
523fea8f25 Auto merge of #14149 - Veykril:completion, r=Veykril
Trigger call info for more completions of signature having things
2023-02-14 16:42:30 +00:00
Lukas Wirth
4aee911ce4 Slim down GenericArgs by one usize once more 2023-02-14 17:41:16 +01:00
Lukas Wirth
853ae1927d Slim down GenericArgs by one usize 2023-02-14 17:40:24 +01:00
Lukas Wirth
4c2aef650a Slim down AssociatedTypeBinding by one usize 2023-02-14 17:40:24 +01:00
bors
41db8c2b59 Auto merge of #14151 - Veykril:smallvec, r=Veykril
internal: Enable smallvec's `union` feature
2023-02-14 16:24:21 +00:00
Lukas Wirth
cade9f7020 Trigger call info for more completions of signature having things 2023-02-14 17:05:07 +01:00
bors
9548388534 Auto merge of #14150 - Veykril:path, r=Veykril
internal: Don't allocate the generic_args vec in `hir_def::Path` if it consists only of `None` args

Saves roughly 5mb on self
2023-02-14 16:02:02 +00:00
Lukas Wirth
a18ebf40cb Don't allocate the generic_args vec in hir_def::Path if it consists only of None args 2023-02-14 17:01:38 +01:00
Lukas Wirth
3c0f20a7bd internal: Enable smallvec's union feature 2023-02-14 17:01:01 +01:00
bors
e7bc68f2c3 Auto merge of #14148 - Veykril:lsp-types, r=Veykril
Bump lsp-types
2023-02-14 14:33:32 +00:00
bors
2e86029662 Auto merge of #14147 - Veykril:completion, r=Veykril
Don't assume VSCode internal commands in the server
2023-02-14 14:19:20 +00:00
Lukas Wirth
38144fd914 Bump lsp-types 2023-02-14 14:59:50 +01:00
Lukas Wirth
95fa278f30 Don't assume VSCode internal commands in the server 2023-02-14 14:45:48 +01:00
bors
44568007d1 Auto merge of #14128 - Veykril:parser, r=Veykril
internal: Improve parser recovery for delimited lists

Closes https://github.com/rust-lang/rust-analyzer/issues/11188, https://github.com/rust-lang/rust-analyzer/issues/10410, https://github.com/rust-lang/rust-analyzer/issues/10173

Should probably be merged after the stable release as this might get the parser stuck if I missed something
2023-02-14 12:59:39 +00:00
Lukas Wirth
4f6b5f41d4 Recover better for more delimited sequences 2023-02-14 13:52:15 +01:00
bors
88b3d9f6f4 Auto merge of #14144 - lowr:fix/find-occurrence-of-raw-ident, r=Veykril
fix: Search raw identifiers without prefix

When we find references/usages of a raw identifier, we should disregard `r#` prefix because there are keywords one can use without the prefix in earlier editions (see #13034; this bug is actually fallout from the PR). `name`, the text we're searching for, has already been stripped of the prefix, but the text of nodes we compare it to hasn't been.

The second commit is strictly refactoring, I can remove it if it's not much of value.
2023-02-14 11:15:55 +00:00
bors
31486a639d Auto merge of #14141 - matklad:utf-32, r=lnicola
Support UTF-32 position encoding

Looks like this is a native encoding for Emacs at least!
2023-02-14 10:53:35 +00:00
Ryo Yoshida
60fa8fefa6
refactor: reduce nesting 2023-02-14 17:34:19 +09:00
Ryo Yoshida
098d9d77b4
Search raw identifiers without prefix 2023-02-14 17:34:14 +09:00
Alex Kladov
9fdcf5787d
Update crates/ide-db/src/line_index.rs
Co-authored-by: Stig Brautaset <stig@brautaset.org>
2023-02-14 08:19:58 +00:00
bors
2a57b01980 Auto merge of #14122 - lowr:patch/abort-macro-expansion-on-overflow, r=Veykril
fix: Don't expand macros in the same expansion tree after overflow

This patch fixes 2 bugs:

- In `Expander::enter_expand_id()` (and in code paths it's called), we never check whether we've reached the recursion limit. Although it hasn't been reported as far as I'm aware, this may cause hangs or stack overflows if some malformed attribute macro is used on associated items.
- We keep expansion even when recursion limit is reached. Take the following for example:

  ```rust
  macro_rules! foo { () => {{ foo!(); foo!(); }} }
  fn main() { foo!(); }
  ```

  We keep expanding the first `foo!()` in each expansion and would reach the limit at some point, *after which* we would try expanding the second `foo!()` in each expansion until it hits the limit again. This will (by default) lead to ~2^128 expansions.

  This is essentially what's happening in #14074. Unlike rustc, we don't just stop expanding macros when we fail as long as it produces some tokens so that we can provide completions and other services in incomplete macro calls.

This patch provides a method that takes care of recursion depths (`Expander::within_limit()`) and stops macro expansions in the whole macro expansion tree once it detects recursion depth overflow. To be honest, I'm not really satisfied with this fix because it can still be used in unintended ways to bypass overflow checks, and I'm still seeking ways such that misuses are caught by the compiler by leveraging types or something.

Fixes #14074
2023-02-14 07:37:53 +00:00
bors
381295144e Auto merge of #14123 - dqkqd:discard-postfix-completion-for-indivisble-expr, r=Veykril
fix: Don't trigger postfix completion in `if` block which has an `else` block

Fix #14096
2023-02-14 07:24:47 +00:00
bors
a33e9d9482 Auto merge of #14143 - lnicola:sync-from-rust, r=lnicola
minor: sync from downstream
2023-02-14 06:41:55 +00:00
Laurențiu Nicola
354b1aaa50 Merge branch 'master' into sync-from-rust 2023-02-14 08:40:55 +02:00
Aleksey Kladov
0da27376cf Support UTF-32 position encoding
Looks like this is a native encoding for Emacs at least!
2023-02-14 01:09:50 +00:00
Laurențiu Nicola
bc45c7659a ⬆️ rust-analyzer 2023-02-13 13:55:14 +02:00
bors
c97aae38f2 Auto merge of #14138 - lowr:fix/rename-raw-ident-mod, r=Veykril
fix: don't include `r#` prefix in filesystem changes

Fixes #14131

In addition to fix for #14131, this PR adds raw ident validity checks in rename functionality that we've been missing.
2023-02-13 11:38:32 +00:00
Duong Quoc Khanh
0285acc5f7
Find next_non_trivia_token of name_ref. 2023-02-13 20:11:04 +09:00
bors
23871f9dd1 Auto merge of #14140 - Veykril:proc-macro-srv-fix, r=Veykril
fix: Fix proc-macro-server incorrectly stripping delimiters

🙄
2023-02-13 11:08:23 +00:00