Allan Brondum Rasmussen
cc4f9db086
remove unneeded test
2022-12-03 00:53:56 +01:00
Allan Brondum Rasmussen
bce3b63700
check reference is a NameRef (and not Name)
2022-12-02 23:50:39 +01:00
Jonas Schievink
b65b02fd97
Fix signature help not showing up when cursor is between ))
or >>
2022-11-29 18:50:21 +01:00
bors
99daf23e11
Auto merge of #13671 - Veykril:goto-decl, r=Veykril
...
Improve goto declaration
Closes https://github.com/rust-lang/rust-analyzer/issues/13599
- goto decl now goes to assoc items of trait declarations over the items of trait implementations
- goto decl now goes to the field declaration (opposed to goto def which shows both the field decl and binding created/local being used)
- also adds back the goto definition fallback that seems to have been dropped at some point.
2022-11-25 09:28:39 +00:00
Lukas Wirth
ae0bdffcc9
Go to declaration goes to field declaration in pattern and expression shorthands
2022-11-25 10:27:54 +01:00
Lukas Wirth
3c794a34da
Go to declaration goes to assoc items of trait declarations
2022-11-25 10:27:49 +01:00
Kartavya Vashishtha
a26aef9055
fix formatting
2022-11-25 12:22:06 +05:30
Kartavya Vashishtha
91e7624de0
add hover tests
2022-11-25 12:20:38 +05:30
Kartavya Vashishtha
e86d451484
fix token method call
2022-11-25 12:20:34 +05:30
Kartavya Vashishtha
132d5ffc7d
add back [] in hover documentation
2022-11-25 12:04:14 +05:30
Kartavya Vashishtha
f64feeb11a
Correct node traversal to look at parent instead
...
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-11-24 22:32:15 -08:00
Laurențiu Nicola
a2a1d99545
⬆️ rust-analyzer
2022-11-23 17:24:03 +02:00
Kartavya Vashishtha
29951f9766
fix formatting
2022-11-19 21:23:33 +05:30
Kartavya Vashishtha
87658c8173
refactor hover
...
change struct_rest_pat to guarentee a HoverResult
Move token and node matching out of struct_rest_pat into hover
2022-11-19 21:22:10 +05:30
Kartavya Vashishtha
8b17681058
fix formatting
...
and remove unnecessary check
2022-11-19 11:34:49 +05:30
Kartavya Vashishtha
a778203db9
simplify ancestor climbing to not consider macros
2022-11-19 11:17:43 +05:30
Kartavya Vashishtha
0ffb361eb9
feat: adds hover hint to ".." in record pattern
...
currently only works with struct pattern
2022-11-19 11:10:47 +05:30
bors
add85397ae
Auto merge of #13604 - Veykril:hover-attr, r=Veykril
...
fix: Fix hover in attributed items not preferring similar kinded tokens
2022-11-11 12:48:48 +00:00
Lukas Wirth
e50712cf2c
fix: Fix hover in attributed items not preferring similar kinded tokens
2022-11-11 13:38:07 +01:00
Ryo Yoshida
19306c070d
Fix tests that depended on loose visibility restriction
2022-11-11 20:31:46 +09:00
Laurențiu Nicola
79923c382a
⬆️ rust-analyzer
2022-11-09 21:49:10 +02:00
Jonas Schievink
9be0615bde
Don't canonicalize self type when querying FnOnce signature
2022-11-08 18:05:07 +01:00
bors
0aa0da9dda
Auto merge of #13572 - Veykril:cancellable, r=Veykril
...
internal: Use Cancellable in favor of Result for clarity
2022-11-07 16:22:33 +00:00
Lukas Wirth
fa70b0a86e
internal: Use Cancellable in favor of Result for clarity
2022-11-07 17:21:37 +01:00
bors
a27e4dad37
Auto merge of #13571 - Veykril:unique-references, r=Veykril
...
minor: Deduplicate reference search results
Fixes https://github.com/rust-lang/rust-analyzer/issues/13407
2022-11-07 15:49:54 +00:00
Lukas Wirth
6a06f6f724
Deduplicate reference search results
2022-11-07 16:48:50 +01:00
bors
8a633fe986
Auto merge of #13570 - Veykril:dedup-crates-for, r=Veykril
...
minor: Remove code duplication
2022-11-07 14:52:05 +00:00
Lukas Wirth
b169e1e5de
Remove code duplication
2022-11-07 15:49:26 +01:00
bors
b0e56ef5e8
Auto merge of #13545 - Veykril:adjustment-hints, r=Veykril
...
Generalize reborrow hints as adjustment hints
Like reborrow hints, these are still mainly useful for teaching/learning
![image](https://user-images.githubusercontent.com/3757771/200073606-b5cd3b95-a9ad-454d-a3c4-d4d89bf45928.png )
2022-11-07 14:38:59 +00:00
Lukas Wirth
ffd7bf8bf9
Bump Cargo rust-version fields to latest stable
2022-11-07 12:59:51 +01:00
Lukas Wirth
ee2dd934ca
Don't trigger adjustment hints in all inlay hint tests
2022-11-07 12:49:52 +01:00
Lukas Wirth
17619de711
fix: Fix reference searching only accounting substrings instead of whole identifiers
2022-11-05 13:00:02 +01:00
Lukas Wirth
d841ad116a
Fix up adjustment hints configurations
2022-11-04 22:59:07 +01:00
Lukas Wirth
95d20fccd7
Add adjustment hint tests
2022-11-04 22:40:06 +01:00
Lukas Wirth
c98fc537e6
Generalize reborrow hints as adjustment hints
2022-11-04 21:53:23 +01:00
bors
bbcb77ea6f
Auto merge of #13456 - emilio:scip-local-symbol, r=Veykril
...
scip: Generate symbols for local crates.
Consider something like:
```
// a.rs
pub struct Foo { .. } // Foo is "local 1"
fn something() {
crate:🅱️ :Bar::new() // Bar is "local 1", but of "b.rs"
}
// b.rs
pub struct Bar { .. } // "local 1"
```
Without this there's no way to disambiguate whether "local 1" references "Bar" or "Foo".
2022-11-03 13:58:36 +00:00
Jonas Schievink
ecad1a9a6e
Create Callable
s for generic types implementing FnOnce
2022-11-01 16:38:19 +01:00
Laurențiu Nicola
c60b1f6414
⬆️ rust-analyzer
2022-11-01 11:31:31 +02:00
Laurențiu Nicola
8807fc4cc3
⬆️ rust-analyzer
2022-10-26 17:40:41 +03:00
Ryo Yoshida
67f1d8fe2c
Test all generic args for trait when finding matching impl
2022-10-25 23:28:40 +09:00
Emilio Cobos Álvarez
8039a07a5e
ide: Generate monikers for local crates.
2022-10-22 19:33:47 +02:00
Emilio Cobos Álvarez
bd49d01906
ide: Remove unnecessary continue.
2022-10-22 15:15:10 +02:00
Lukas Wirth
de195ff97c
fix: Fix DidSaveDocument requests blocking the server on startup
2022-10-20 19:55:04 +02:00
Lukas Wirth
8047512dca
Revert "feat: Diagnose some incorrect usages of the question mark operator"
2022-10-18 14:18:59 +02:00
Laurențiu Nicola
a99a48e786
⬆️ rust-analyzer
2022-10-18 09:12:49 +03:00
Lukas Wirth
a762baca02
fix: Fix formatting requests hanging when r-a is still starting
...
The reason for that was that we were calculating the crate defmaps
of the file we are saving by accident causing us to get stuck waiting
on their expensive computation, while we only need the relevant crate
id.
2022-10-17 18:21:18 +02:00
Lukas Wirth
381366f1dd
Diagnose incorrect usages of the question mark operator
2022-10-16 12:58:24 +02:00
bors
855cd5c280
Auto merge of #13418 - lnicola:bump-deps, r=lnicola
...
Bump deps
2022-10-15 11:27:12 +00:00
Laurențiu Nicola
792920f441
Bump pulldown-cmark-to-cmark
2022-10-15 13:00:41 +03:00
Laurențiu Nicola
97eebbfab6
Bump url
2022-10-15 12:57:30 +03:00
Laurențiu Nicola
cbce0cda08
Bump anyhow, arbitrary, itertools, semver, serde
2022-10-15 12:52:34 +03:00
Laurențiu Nicola
4f55ebbd4f
⬆️ rust-analyzer
2022-10-11 10:37:35 +03:00
DropDemBits
a69cccfc0e
Underline only the intra-doc link instead of the whole doc comment
2022-10-09 21:29:31 -04:00
Maybe Waffle
1c0ec9f0c8
Fix go-to-def for #[doc = include_str!("path")]
2022-10-07 09:04:41 +00:00
bors
a415fb4c4e
Auto merge of #13353 - wildbook:fix_type_inference_panic, r=Veykril
...
Fix assertion failure in type inference (#13352 )
Fixes https://github.com/rust-lang/rust-analyzer/issues/13352
2022-10-06 12:33:50 +00:00
Maybe Waffle
a57ef6b0b1
Fix go-to-def for shadowed include*!
2022-10-06 06:16:39 +00:00
Wildbook
8862fe6ff2
Fix assertion failure in type inference ( #13352 )
2022-10-05 17:46:56 +02:00
bors
2293949bbf
Auto merge of #13318 - Veykril:annotations, r=Veykril
...
Fix annotations not resolving when lens location is set to whole item
Fixes https://github.com/rust-lang/rust-analyzer/issues/13310
2022-09-30 22:31:05 +00:00
Lukas Wirth
3cd57c425a
Fix annotations not resolving when lens location is set to whole item
2022-10-01 00:18:23 +02:00
Ryo Yoshida
6d8903ae5f
fix: infer for-loop item type with IntoIterator
and Iterator
2022-09-29 19:48:08 +09:00
Noah Santschi-Cooney
aa093f5a58
Fix PackageInformation having the crate name instead of package name
2022-09-26 17:31:38 +01:00
Laurențiu Nicola
f5fde4df43
⬆️ rust-analyzer
2022-09-20 17:39:17 +03:00
bors
817a6a8609
Auto merge of #12966 - OleStrohm:master, r=Veykril
...
feat: Display the value of enum variant on hover
fixes #12955
This PR adds const eval support for enums, as well as showing their value on hover, just as consts currently have.
I developed these two things at the same time, but I've realized now that they are separate. However since the hover is just a 10 line change (not including tests), I figured I may as well put them in the same PR. Though if you want them split up into "enum const eval support" and "show enum variant value on hover", I think that's reasonable too.
Since this adds const eval support for enums this also allows consts that reference enums to have their values computed now too.
The const evaluation itself is quite rudimentary, it doesn't keep track of the actual type of the enum, but it turns out that Rust doesn't actually either, and `E::A as u8` is valid regardless of the `repr` on `E`.
It also doesn't really care about what expression the enum variant contains, it could for example be a string, despite that not being allowed, but I guess it's up to the `cargo check` diagnostics to inform of such issues anyway?
2022-09-20 14:01:16 +00:00
bors
09600a3a5b
Auto merge of #13268 - Veykril:simplify, r=Veykril
...
Simplify
2022-09-20 12:35:18 +00:00
Lukas Wirth
027bfd68ba
Fix operator highlighting tags applying too broadly
2022-09-20 14:33:44 +02:00
DidiBear
cdc362e6cc
docs(inlay-hints): remove reference to Toggle inlay hints
2022-09-19 12:00:58 -04:00
bors
dbb8fedf8b
Auto merge of #13221 - mdx97:mdx97/annotations-above-whole-item, r=Veykril
...
Allow configuration of annotation location.
I've added the ability to configure where lens annotations render relevant to the item they describe. Previously, these would render directly above the line the item is declared on. Now, there is the ability to render these annotations above the entire item (including doc comments, and attributes).
The names of the config options are up for debate, I did what seemed best to me but if anyone has better ideas let me know.
This is my first contribution so if I've missed anything please let me know.
Here's a preview of what the new option looks like:
<img width="577" alt="Screen Shot 2022-09-11 at 10 39 51 PM" src="https://user-images.githubusercontent.com/33100798/189570298-b4fcbf9c-ee49-4b79-aae6-1037ae4f26af.png ">
closes https://github.com/rust-lang/rust-analyzer/issues/13218
2022-09-13 15:09:53 +00:00
Lukas Wirth
cadb01c315
Move reference imports filtering into to_proto layer
2022-09-13 14:58:50 +02:00
Laurențiu Nicola
459bbb4222
⬆️ rust-analyzer
2022-09-13 15:38:11 +03:00
Mathew Horner
f57c15f3e9
Address comments and fix build.
2022-09-12 16:34:13 -05:00
OleStrohm
3931e55aee
Fixed lints
2022-09-12 21:27:19 +01:00
OleStrohm
177ec82a41
Rebased
2022-09-12 21:02:30 +01:00
OleStrohm
5313bd1984
Cleaned up code based on feedback
2022-09-12 20:20:45 +01:00
OleStrohm
301b8894ea
Added more consteval tests and fixed consteval result
2022-09-12 20:20:45 +01:00
OleStrohm
ad0a6bf1a3
Added consteval tests
2022-09-12 20:20:43 +01:00
OleStrohm
2f84b6e2e5
Almost there
2022-09-12 20:20:22 +01:00
OleStrohm
b63234e20b
Cleaned up code
2022-09-12 20:19:49 +01:00
OleStrohm
997fc46efa
Implemented basic enum const eval
2022-09-12 20:19:13 +01:00
bors
b1a4ba3e84
Auto merge of #13223 - lowr:fix/hir-proj-normalization, r=flodiebold
...
fix: handle lifetime variables in projection normalization
Fixes #12674
The problem is that we've been skipping the binders of normalized projections assuming they should be empty, but the assumption is unfortunately wrong. We may get back lifetime variables and should handle them before returning them as normalized projections. For those who are curious why we get those even though we treat all lifetimes as 'static, [this comment in chalk](d875af0ff1/chalk-solve/src/infer/unify.rs (L888-L908)
) may be interesting.
I thought using `InferenceTable` would be cleaner than the other ways as it already has the methods for canonicalization, normalizing projection, and resolving variables, so moved goal building and trait solving logic to a new `HirDatabase` query. I made it transparent query as the query itself doesn't do much work but the eventual call to `HirDatabase::trait_solve_query()` does.
2022-09-12 14:24:57 +00:00
Ryo Yoshida
efb56160c9
fix: handle lifetime variables in projection normalization
2022-09-12 22:52:58 +09:00
bors
e38dfe5536
Auto merge of #13186 - enomado:master, r=Veykril
...
Filter imports on find-all-references
Attempt to #13184
2022-09-12 12:09:57 +00:00
Mathew Horner
8a2803d9ae
Allow configuration of annotation location.
...
Previously, annotations would only appear above the name of an item (function signature, struct declaration, etc).
Now, rust-analyzer can be configured to show annotations either above the name or above the whole item (including doc comments and attributes).
2022-09-11 22:40:33 -05:00
Stanislav
f7f4792f4f
fixes
2022-09-09 20:58:06 +03:00
bors
4e1a3da8f2
Auto merge of #13158 - jonas-schievink:inlayhint-links, r=jonas-schievink
...
feat: make clicking a closing brace inlay hint go to the opening brace
2022-09-08 16:38:40 +00:00
Jonas Schievink
064c9ef9e2
Make clicking closing brace hint go to the opening brace
2022-09-08 17:25:28 +02:00
Stanislav
9f6553e1d6
add config for import filtering
2022-09-08 01:53:20 +03:00
Stanislav
eba54c2fc9
pretty solition works
2022-09-07 04:09:25 +03:00
Stanislav
92d54f9b30
typo and draft
2022-09-07 03:24:55 +03:00
Stanislav
bd0eeb3f04
Update crates/ide/src/references.rs
...
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-09-07 03:01:06 +03:00
Laurențiu Nicola
65e1dc4d9c
⬆️ rust-analyzer
2022-09-06 21:20:49 +03:00
bors
5be2e6574d
Auto merge of #13185 - ChayimFriedman2:insert-ws-in-static-const-macro, r=Veykril
...
fix: Insert whitespaces into static & const bodies if they are expanded from macro on hover
Partially fixes #13143 .
To resolve the other part we need to expand macros in unevaluated static & const bodies, and I'm not sure we want to. If for example it includes a call to `assert!()`, expanding it will lead to worse hover.
2022-09-05 11:10:40 +00:00
Stanislav
6001e7dfb1
fix
2022-09-04 19:45:50 +03:00
Stanislav
ba40aa72ac
Update crates/ide/src/references.rs
...
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2022-09-04 19:41:06 +03:00
Stanislav
29729abc3c
Retain imports on find-all-references
2022-09-04 19:14:52 +03:00
Chayim Refael Friedman
26b5f1f92f
Do not insert a newline after ;
if the next token is a }
...
This creates double newline.
2022-09-04 14:33:15 +00:00
Chayim Refael Friedman
e295f0c29c
Insert whitespaces into static & const bodies if they are expanded from macro on hover
...
Macro expansion erases whitespace information, and so we end with invalid Rust code.
2022-09-04 14:33:15 +00:00
Jonas Schievink
241807dbf9
Allow multi-part inlay hint labels with location links
2022-08-31 18:34:10 +02:00
bors
56d888689b
Auto merge of #12793 - lowr:fix/12739, r=Veykril
...
fix: sort and deduplicate auto traits in trait object types
Fixes #12739
Chalk solver doesn't sort and deduplicate auto traits in trait object types, so we need to handle them ourselves in the lowering phase, just like [`rustc`](880416180b/compiler/rustc_typeck/src/astconv/mod.rs (L1487-L1488)
) and [`chalk-integration`](https://github.com/rust-lang/chalk/blob/master/chalk-integration/src/lowering.rs#L575 ) do.
Quoting from [the Chalk book](https://rust-lang.github.io/chalk/book/types/rust_types.html#dyn-types ):
> Note that -- for this purpose -- ordering of bounds is significant. That means that if you create a `dyn Foo + Send` and a `dyn Send + Foo`, chalk would consider them distinct types. The assumption is that bounds are ordered in some canonical fashion somewhere else.
Also, trait object types with more than one non-auto traits were previously allowed, but are now disallowed with this patch.
2022-08-31 08:28:12 +00:00
Ryo Yoshida
7ecead23c8
fix: sort and deduplicate auto traits in trait object types
2022-08-30 20:52:42 +09:00
Laurențiu Nicola
3e358a6827
⬆️ rust-analyzer
2022-08-30 14:51:24 +03:00
bors
ca8093e282
Auto merge of #13116 - Veykril:nohash, r=Veykril
...
Make use of NoHash hashing for FileId and CrateId
Both of these are mere integers so there is nothing to hash here.
Ideally we would use this for `la_arena::Idx` too, but that doesn't work due to the orphan rule, and `la_arena` is unfortunately a public library so we can't really do much here... Unless we remove the trait restriction but I'd like not to
2022-08-25 19:08:57 +00:00
Lukas Wirth
d025c5d8d6
Make use of NoHash hashing for FileId and CrateId
2022-08-25 20:41:49 +02:00
Jonas Schievink
322e7060de
Resolve doc links on impl blocks
2022-08-23 17:50:45 +02:00
Lukas Wirth
f6f0516603
Add config for macro bang token highlighting, disable by default
2022-08-23 14:05:56 +02:00
Lukas Wirth
9700c95ced
Make doc comment highlight injection configurable
2022-08-23 14:05:55 +02:00
Lukas Wirth
9a201873b8
Move highlight configuration from protocol into the feature
2022-08-23 14:05:55 +02:00
Lukas Wirth
16315edaee
Make punctuation highlighting configurable, disable it by default
2022-08-23 14:05:55 +02:00
Laurențiu Nicola
31519bb394
⬆️ rust-analyzer
2022-08-23 10:05:52 +03:00
TJ DeVries
50ecb09da4
feat: emit SCIP via rust-analyzer
2022-08-22 15:13:46 -04:00
bors
1da9156b0d
Auto merge of #12982 - jridgewell:into_future, r=Veykril
...
Implement IntoFuture type inference
One of my projects is using [IntoFuture](https://doc.rust-lang.org/std/future/trait.IntoFuture.html ) to make our async code a little less verbose. However, rust-analyzer can't infer the output type of an await expression if the value uses `IntoFuture` to convert into another type. So we're getting `{unknown}` types everywhere since switching.
`foo.await` itself [desugars](e4417cf020/compiler/rustc_ast_lowering/src/expr.rs (L644-L658)
) into a `match into_future(foo) {}`, with every `Future` impl getting a [default](e4417cf020/library/core/src/future/into_future.rs (L131-L139)
) `IntoFuture` implementation. I'm not sure if we want to disable the old `future_trait` paths, since this only recently [stabilize](https://github.com/rust-lang/rust/pull/98718 ).
2022-08-18 07:37:47 +00:00
Justin Ridgewell
cebf95718c
Find IntoFuture::IntoFuture's poll method
2022-08-16 17:53:10 -04:00
Jonas Schievink
0616cee92b
Add a setting for keyword hover popups
2022-08-16 16:51:40 +02:00
Laurențiu Nicola
8231fee466
⬆️ rust-analyzer
2022-08-16 11:24:50 +03:00
bors
6d6201299c
Auto merge of #13025 - Veykril:simplify2, r=Veykril
...
Simplify
2022-08-15 14:40:26 +00:00
Lukas Wirth
3f149a63d2
Simplify
2022-08-15 16:40:10 +02:00
Jonas Schievink
dcbe892d7c
Add an HIR pretty-printer
2022-08-15 13:51:45 +02:00
Ryo Yoshida
ba6db3e9b0
Add test for runnables with raw identifiers
2022-08-11 03:41:23 +09:00
Laurențiu Nicola
22c8c9c401
⬆️ rust-analyzer
2022-08-09 07:23:57 +03:00
KaDiWa
232176b46a
remove imports that are also in edition 2021's prelude
2022-08-09 01:16:32 +02:00
Laurențiu Nicola
eca6f2e897
Fix test_rainbow_highlighting gate
2022-08-07 09:29:26 +03:00
bors
97038e55cf
Auto merge of #12949 - Veykril:token-pick, r=Veykril
...
fix: Fix incorrect token pick rankings
2022-08-05 13:06:10 +00:00
Lukas Wirth
6bf674c8e4
fix: Fix incorrect token pick rankings
2022-08-05 14:59:26 +02:00
Lukas Wirth
d6e78b04d0
feat: Handle operators like their trait functions in the IDE
2022-08-05 14:16:36 +02:00
Jean santos
5698e51027
tidy formatting
2022-08-04 09:28:34 -03:00
Jean santos
49dac4070c
on hover fallback error, adds ast::type as possible node
2022-08-03 17:37:11 -03:00
Laurențiu Nicola
9d2cb42a41
⬆️ rust-analyzer
2022-08-02 09:05:16 +03:00
Jonas Schievink
bd7dfac5eb
Fix r-a spelling in some places
2022-08-01 13:47:09 +02:00
Ryo Yoshida
d40ab66186
fix: remove whitespaces from doctest names
2022-08-01 17:57:47 +09:00
Lukas Wirth
618cfd792c
fix: Fix ast-id up when merging raw attributes
2022-07-30 09:43:30 +02:00
Laurențiu Nicola
948c9afc73
Only run rainbow highlighting test on 64-bit Unix
2022-07-28 21:03:59 +03:00
Amos Wenger
a1f1b95d00
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-and-pms-component
2022-07-26 11:53:50 +02:00
Lukas Wirth
ddad2847ab
Allow name querying for derive helpers
2022-07-26 09:27:22 +02:00
Lukas Wirth
aa1491ecde
Record derive helper attributes, resolve them in IDE layer
2022-07-26 09:26:51 +02:00
Lukas Wirth
4e60db2d07
feat: Downmap tokens inside derive helpers
2022-07-26 09:26:47 +02:00
Amos Wenger
0bffdf2627
Disable all source-gen tests at compile time
2022-07-24 10:38:28 +02:00
Lukas Wirth
1ab862a628
fix: Improve syntax highlighting in attributes
2022-07-22 17:29:03 +02:00
Amos Wenger
7e285e1ef5
Run cargo fmt
2022-07-20 15:06:15 +02:00
Amos Wenger
816f7fe12a
Run cargo fix --edition-idioms
2022-07-20 15:02:08 +02:00
Amos Wenger
23d25a3094
Enable extra warnings required by rust-lang/rust
2022-07-20 15:00:17 +02:00
Lukas Wirth
bb4bfae422
fix: Fix search for associated trait items being inconsistent
2022-07-20 13:59:31 +02:00
Amos Wenger
1b416473a3
Upgrade to expect-test@1.4.0
...
cf. https://github.com/rust-analyzer/expect-test/issues/33
cf. https://github.com/rust-lang/rust/pull/99444#issuecomment-1188844202
2022-07-19 13:00:45 +02:00
bors
22e53f1d33
Auto merge of #12549 - bitgaoshu:goto_where_trait_m_impl, r=Veykril
...
feat: Go to implementation of trait methods
try goto where the trait method implies, #4558
2022-07-18 16:29:23 +00:00
bors
db6a85d358
Auto merge of #12778 - Logarithmus:feature/fix-negative-const-generics, r=flodiebold
...
Support negative, `char` & `bool` const generics
Before:
![Before](https://user-images.githubusercontent.com/29541480/179379832-0c3b2a74-fef6-427e-b89f-7e31d9c37b3d.png )
After:
![After](https://user-images.githubusercontent.com/29541480/179379863-b62475dd-e7bf-41f2-b437-08dfe55951af.png )
I tried to implement stuff like `Const<{NUM1 + 3 + NUM2}>` by using already existing constant evaluation mechanism for ordinary constants, but turned out to be harder than I thought, maybe because I've never ever tinkered with compilers before
2022-07-17 17:17:39 +00:00
Artur Sinila
a96f0aa7cd
feat: support negative const generic parameters
...
* feat: support `bool` & `char` const generics
2022-07-17 04:18:53 +03:00
Artur Sinila
b9b42e8670
tests: add hover tests for const generics
2022-07-17 02:13:09 +03:00
bors
766c5f0861
Auto merge of #12689 - Veykril:macro-rec, r=Veykril
...
internal: Record all macro definitions in ItemScope
Fixes https://github.com/rust-lang/rust-analyzer/issues/12100
Doesn't resolve the shadowing issues though, fixing those is gonna be really tricky I believe unless we can come up with a nice scheme to "order" item tree items (using syntax ranges and file ids would be a pain and also a bad idea since that'll require us to potentially reparse files in collection).
2022-07-16 16:45:26 +00:00
bors
ac526e029a
Auto merge of #12712 - harpsword:fix-rename-crate-root, r=Veykril
...
fix: ignore renames for crate root
close #12684 . I just ignore renames for crate root in `rename_mod` func.
2022-07-16 16:28:41 +00:00
Lukas Wirth
7ff6c36716
fix: Don't show qualified path completions for private items
2022-07-15 13:30:43 +02:00
hi-rustin
d9ab7f21e4
Fix typos
...
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-07-11 21:42:05 +08:00
harpsword
4b3164f129
fix: ignore renames for crate root
2022-07-10 10:45:03 +08:00
Jonas Schievink
6c6ae965ba
Update remaining GitHub URLs
2022-07-08 15:44:49 +02:00
Lukas Wirth
db49ac8734
internal: Record all macro definitions in ItemScope
2022-07-05 11:28:47 +02:00
Laurențiu Nicola
e6fcb23445
Bump either
2022-07-03 10:09:35 +03:00
Laurențiu Nicola
212f84ab46
Bump crossbeam-channel
2022-07-03 09:56:58 +03:00
Lukas Wirth
531e152390
fix: Simplify macro statement expansion handling
2022-07-01 14:49:30 +02:00
Ryo Yoshida
36d2b43dfd
fix: improve whitespace insertion in pretty printer
2022-06-28 20:44:55 +09: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
bitgaoshu
353829fc4e
highlight: trait path
2022-06-24 23:04:35 +08: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
Raymond Luo
5107123f9a
clarify comment and add autolink test case
2022-06-23 19:02:30 -04:00
Florian Diebold
f410fdf6e3
Add two more tests
2022-06-23 14:49:05 +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
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
harpsword
3a78cc5e67
feat: add fold range for multi line match arm list
2022-06-18 16:05:56 +08:00
Lukas Wirth
7d51fc4640
Show proc-macro loading errors in unresolved-proc-macro diagnostics
2022-06-15 17:34:01 +02:00
Lukas Wirth
325ceaef19
fix: Check for the correct proc-macro settings in missing proc-macro diagnostics
2022-06-14 11:00:06 +02:00
Lukas Wirth
9b9c13fc40
feat: On assoc item name hover, render trait decl docs
2022-06-13 11:57:33 +02:00
bors
e9d3fe0484
Auto merge of #12502 - Veykril:deps, r=Veykril
...
internal: Bump Dependencies
2022-06-10 19:51:04 +00:00
Lukas Wirth
76ae5434fa
internal: Bump Dependencies
2022-06-10 17:30:02 +02:00
Luke Chu
6079eeb1bf
Hide param inlay hint when argument is fn-like macro with similar name
2022-06-08 14:37:57 +00:00
feniljain
25f3e7a33c
fix: float display impl
2022-05-31 10:13:03 +05:30
bors
a5d7ab54f9
Auto merge of #12418 - Veykril:completions, r=Veykril
...
internal: More precise completion filtering with existing item qualifiers
Now we are approaching the more complex cases for filtering completions
2022-05-30 14:05:37 +00:00
Lukas Wirth
ea594c4c44
Use char for trigger character
2022-05-30 14:17:58 +02:00
Lukas Wirth
aced76d0ff
Add implicit static lifetime hints
2022-05-30 13:59:58 +02:00
bors
9ceaff91d3
Auto merge of #12406 - harpsword:fix-add-inlayHints-closures-without-block, r=Veykril
...
fix: add an option to show inlay hint for return type of closures wit…
fix #12321
2022-05-30 11:36:55 +00:00
bors
bd0c2344f2
Auto merge of #12387 - 00nktk:fix-mod-rename, r=Veykril
...
fix(ide-db): correct single-file module rename
Fixes a bug where rust-analyzer would emit `WorkspaceEdit`s with paths to dirs instead of files for the following project layout.
lib.rs
```rust
mod foo;
```
foo.rs
```rust
mod bar {
struct Bar;
}
```
Also fixes emitted paths for modules with mod.rs.
The bug resulted in panic in helix editor when attempting to rename a module.
2022-05-30 11:29:55 +00:00
yue4u
1b5f0462ed
fix: visibility completion
2022-05-30 00:06:48 +09:00
harpsword
55509548e8
fix: add an option to show inlay hint for return type of closures without block
2022-05-28 22:12:30 +08:00
Nikita Podoliako
d98c04aac1
fix(ide-db): correct single-file module rename
2022-05-28 15:07:22 +03:00
bors
6c9fc4fec2
Auto merge of #12402 - Veykril:feat-docs, r=Veykril
...
minor: Freshen up goto feature docs
Fixes https://github.com/rust-lang/rust-analyzer/issues/2541
2022-05-27 13:47:56 +00:00
Lukas Wirth
86576072ab
minor: Freshen up goto feature docs
2022-05-27 15:47:31 +02:00
bors
bd06902f90
Auto merge of #12395 - feniljain:fix_bugs, r=Veykril
...
fix: f32 and f64 representation during lowering
should fix #12380
2022-05-27 12:44:08 +00:00
feniljain
1f4870ff1c
fix: f32 and f64 representation during lowering
2022-05-26 20:03:05 +05:30
Lukas Wirth
f02c915eb5
internal: Make autoclosing angle brackets configurable, disabled by default
2022-05-25 12:42:07 +02:00
Lukas Wirth
86d1d9067e
fix: Insert whitespace into trait-impl completions when coming from macros
2022-05-24 22:56:33 +02:00
andylizi
e34ae760f0
add test for macro expand formatting
2022-05-24 12:45:58 +08:00
andylizi
ebf8b1a96e
ide: insert whitespaces surrounding _
in macro expansion
2022-05-24 07:54:43 +08:00
Lukas Wirth
9f6d99c6bd
minor: Simplify syntax-highlighting macro checks
2022-05-23 17:03:19 +02:00
Lukas Wirth
377c9247e6
fix: When hovering macro inputs, don't show everything that was downmapped
2022-05-23 16:11:36 +02:00
Lukas Wirth
ad537be194
fix: When reference searching macro inputs, don't search everything that was downmapped
2022-05-23 16:09:56 +02:00
bors
038a71a201
Auto merge of #12345 - bvanjoi:escape_format_spcifier, r=Veykril
...
feat: escape format specifier(close : #12258 )
solve https://github.com/rust-lang/rust-analyzer/issues/12258
2022-05-22 10:41:31 +00:00
bors
3535a052ce
Auto merge of #12346 - rainy-me:fix/builtin-type-docs-links, r=Veykril
...
fix: special case base url of `BuiltinType` to core
fix #12250
2022-05-22 10:33:43 +00:00
rainy-me
3a380d4b3a
fix: special case base url of BuiltinType
to core
2022-05-22 18:50:40 +09:00
Felicián Németh
f7c963c0f2
onTypeFormatting: don't insert > if another > is there
2022-05-22 10:40:53 +02:00
Felicián Németh
3bb02f2329
feat: Add on-typing handler for left angle
...
Only advertise this feature in the server capabilities when the client
supports SnippetTextEdit.
Close #11398 .
Co-authored-by: unexge <unexge@gmail.com>
2022-05-22 10:40:37 +02:00
Felicián Németh
636d4880c4
internal: Allow OnTypeFormatting to send SnippetTextEdit
...
But continue to send TextEdit only.
2022-05-22 10:39:18 +02:00
bvanjoi
f6b8525b1d
feat: escape format specifier( close : #12258 )
2022-05-22 15:32:24 +08:00
bors
2a978e1404
Auto merge of #12328 - Veykril:simplify, r=Veykril
...
minor: Simplify
2022-05-20 15:03:59 +00:00
Lukas Wirth
88e297e47d
minor: Simplify
2022-05-20 16:52:10 +02:00
andylizi
2b1c1a934c
feat: hide type inlay hints for initializations of closures
2022-05-20 17:42:56 +08:00
NotWearingPants
641b78a162
hide closure ret hints if ret type is specified
...
fixes #12319
2022-05-20 02:35:37 +03:00
Jonas Schievink
52ff863abc
Teach Callable
about closures properly
2022-05-19 18:53:08 +02:00
Lukas Wirth
9ebb55d354
Hide more unnecessary parameter hints for constructors
2022-05-19 15:44:52 +02:00
Lukas Wirth
5fe28441b8
Update test fixtures
2022-05-19 15:20:45 +02:00
Lukas Wirth
b08bbd7be0
Enable hovering function parameter inlay hints
2022-05-19 14:32:40 +02:00
Lukas Wirth
74230e26ff
internal: Improve inlay hint tooltips
2022-05-19 13:38:37 +02:00
Lukas Wirth
58a241134c
Update test output
2022-05-17 14:58:26 +02:00
Lukas Wirth
21f37a6d9e
Allow inlay hint tooltips to trigger hovers
2022-05-17 14:46:43 +02:00
Lukas Wirth
a2ec010185
Trigger hover requests on closing brace hints
2022-05-17 13:39:45 +02:00
Lukas Wirth
0756719a30
Replace some SmolStr usages with String as the conversion happens anyways
2022-05-17 12:56:14 +02:00
Lukas Wirth
12d5343993
internal: Cleanup lifetime elision hints
2022-05-17 12:18:07 +02:00
Jonas Schievink
fccc12982e
Add closing brace hints for macros
2022-05-16 15:23:25 +02:00
Jonas Schievink
867a7dc7a0
Show inlay hints after a }
to indicate the closed item
2022-05-16 14:55:47 +02:00
Lukas Wirth
7cbde1b3a5
Enable reborrow hints in attribute calls
2022-05-14 15:00:14 +02:00
Lukas Wirth
6b696fced8
feat: Add binding mode inlay hints
2022-05-14 14:58:35 +02:00
Lukas Wirth
3577c44dee
fix: Fix fill-arguments completions not working
2022-05-13 19:52:44 +02:00
Jonas Schievink
9bd11459ba
Revert "Auto merge of #12149 - jonas-schievink:literally-just-a-literal, r=jonas-schievink"
...
This reverts commit cc9ae2b89e
, reversing
changes made to 7dfd1cb572
.
2022-05-13 15:08:14 +02:00
bors
135164f547
Auto merge of #12226 - Veykril:reborrow-inlay-hints, r=Veykril
...
feat: Allow reborrow inlay hints to be restricted to mutable reborrows only
2022-05-12 12:21:06 +00:00
Lukas Wirth
c2190ad87c
feat: Allow reborrow inlay hints to be restricted to mutable reborrows only
2022-05-12 14:00:06 +02:00
Lukas Wirth
ca46c68b04
internal: Remove redundant offset data in annotations
2022-05-12 13:06:49 +02:00
Jonas Schievink
ac3c18bc17
Include assoc. types in trait signature help
2022-05-10 16:54:31 +02:00
bors
cc695363e4
Auto merge of #12202 - iDawer:ide.sig_help-fix, r=lnicola
...
fix: don't panic at fully qualified call syntax in signature help
Closes #12200
Regressed from #12082
2022-05-10 12:28:34 +00:00
iDawer
956b8fb954
signature_help
: detect fully qualified call syntax for parameter fallback
2022-05-10 17:18:42 +05:00
bors
cf152e8a94
Auto merge of #12201 - Veykril:inlay-hide, r=Veykril
...
fix: Add cast expressions to param name inlay hint heuristics
2022-05-10 11:44:06 +00:00
Lukas Wirth
822d9b55b7
fix: Add cast expressions to param name inlay hint heuristics
2022-05-10 13:43:43 +02:00
Jonas Schievink
7e45915aa4
Resolve assoc. types of supertraits in the IDE layer
2022-05-09 17:30:49 +02:00
Jonas Schievink
37443eb9a1
Maybe everything else *should* have to deal with it
2022-05-05 16:28:59 +02:00
Jonas Schievink
34dc8e9383
Wrap floats in token trees in FLOAT_LITERAL
node
2022-05-05 16:28:59 +02:00
Jonas Schievink
1bc3305d95
Split float literal tokens at the .
2022-05-05 16:28:58 +02:00
Laurențiu Nicola
9856144b0b
Lower values of char and byte literals
2022-05-05 08:12:08 +03:00
rainy-me
ddff1b22f9
fix: add docs and remove unnecessary check
2022-05-05 13:41:33 +09:00
rainy-me
5f4351fbb6
fix: doc url link type
2022-05-05 00:41:29 +09:00
bors
cc12d9df3f
Auto merge of #12120 - iDawer:ide.sig_help, r=Veykril
...
fix: Don't show signature help after closing bracket
Stop showing signature help after closing angle/round brackets.
Fixes #11624
2022-05-02 12:13:16 +00:00
Lukas Wirth
b6e19add06
minor: Add a test for display rendering record variants
2022-05-02 12:51:00 +02:00
Peh
1f011fa4a3
style: rename crates to kebab case
2022-05-01 10:48:58 +00:00
iDawer
dffbab45f4
Don't show signature help after closing bracket
2022-04-29 23:26:54 +05:00
Laurențiu Nicola
4a57307674
Revert "Correctly fix formatting doc tests with generics"
...
This reverts commit 5f3327a6b8
.
2022-04-27 15:30:54 +03:00
Laurențiu Nicola
0d02be7330
Revert "Update crates/ide/src/runnables.rs"
...
This reverts commit bf47acf1d3
.
2022-04-27 15:30:54 +03:00
bors
198c075580
Auto merge of #12083 - Veykril:inlays, r=Veykril
...
minor: Add test for parameter and reborrow hint order
2022-04-26 09:53:26 +00:00
Lukas Wirth
5e413997a1
minor: Add test for parameter and reborrow hint order
2022-04-26 11:46:03 +02:00
iDawer
729cd8530b
signature_help
: use corresponding param list for methods
2022-04-26 11:50:28 +05:00
Lukas Wirth
4255996965
Re-export FxHashMap
and FxHashSet
from ide_db
2022-04-25 18:51:59 +02:00
bors
c1de78f54c
Auto merge of #12072 - bitgaoshu:master, r=jonas-schievink
...
fix #11973 associated type is unresolved
2022-04-25 11:07:09 +00:00
bitgaoshu
5d1aff3357
#11973 associated type is unresolved
2022-04-24 20:51:48 +08:00
iDawer
baa4fa09ef
Add fallback for return type
2022-04-23 17:21:21 +05:00
iDawer
fae9049ccd
Fall back to parameter definitions on error types in signature help
2022-04-23 17:21:21 +05:00
Jonas Schievink
c6ffffccbd
Allows triggering commands after an assist edit
2022-04-19 18:45:48 +02:00
Lukas Wirth
3de9a42810
Disable rustfmt for expand_macro on wasm platforms
2022-04-17 14:00:19 +02:00
Lukas Wirth
895a16265c
Fix macro patterns not getting formatted properly
2022-04-17 13:46:00 +02:00
Lukas Wirth
e2f1a9a558
feat: Attempt to format expand_macro output with rustfmt if possible
2022-04-17 13:33:39 +02:00
bors
a912f2a9f6
Auto merge of #12001 - Veykril:refs, r=Veykril
...
fix: Do reference search on all downmapped tokens with the same kind only
cc https://github.com/rust-lang/rust-analyzer/issues/11668
2022-04-15 17:43:24 +00:00
Lukas Wirth
58660dee2a
fix: Do reference search on all downmapped tokens with the same kind only
2022-04-15 19:42:48 +02:00
bors
5e41205e9c
Auto merge of #12000 - Veykril:hlmac, r=Veykril
...
fix: Tag `macro_rules` macro bang with `MacroBang` tag
cc https://github.com/rust-lang/rust-analyzer/issues/11996
2022-04-15 17:19:33 +00:00
Lukas Wirth
be27efabfa
fix: Tag macro_rules
macro bang with MacroBang
tag
2022-04-15 19:16:18 +02:00
Jonas Schievink
f96fd40104
add docs
2022-04-14 13:23:19 +02:00
Jonas Schievink
99e9e52fbc
Remove trailing ;
when turning assignment into ==
comparison
2022-04-13 16:01:09 +02:00
Jonas Schievink
b9dd7db817
Add more no-op tests
2022-04-13 15:47:33 +02:00
Jonas Schievink
cde2a1de36
Add trailing ;
when typing =
in assignment
2022-04-12 19:39:19 +02:00
bors[bot]
49847a25ae
Merge #11883
...
11883: fix(ide): move moudle directory when rename r=rainy-me a=rainy-me
fix : #10992
Added `FileSystemEdit::MoveDir` variant for move dirs. Original implemented as recursively move child mod files but had many issues like
1. left empty dir after rename file
2. only affect rust file
3. not performant
so changed to current version
Co-authored-by: rainy-me <github@yue.coffee>
2022-04-12 15:17:00 +00:00
rainy-me
3dd581b97d
fix: move dir on rename mod
2022-04-12 23:01:53 +09:00
Lukas Wirth
7f3572fa0d
Simplify
2022-04-10 20:02:06 +02:00
Lukas Wirth
15e7112da3
fix: Check whether a parameter can be converted to a local
2022-04-09 00:55:45 +02:00
Jonas Schievink
5d8b4c40eb
Determine function unsafety semantically
2022-04-07 18:33:03 +02:00
Lukas Wirth
3632d5946f
minor: Remove pointless rebindings
2022-04-07 01:29:31 +02:00
Lukas Wirth
96b641e95e
internal: Add more doc-link tests
2022-04-06 20:58:46 +02:00
Lukas Wirth
4a1423337f
fix: Attempt to resolve paths in const arguments heuristically
...
While we don't support const args in type inference yet, we can at least
make use of the fallback path resolution to resolve paths in const args
in the IDE layer to enable some features for them.
2022-04-06 20:24:24 +02:00
Lukas Wirth
7959c24876
fix: Fix path qualifiers not resolving generic type params when shadowed by trait
2022-04-06 19:38:45 +02:00
Jonas Schievink
872b7b9660
Wrap macros in expr position in MacroExpr
node
2022-04-05 17:43:34 +02:00
Lukas Wirth
f610e2c2ed
Simplify completion import insertion
2022-04-02 01:42:21 +02:00
bors[bot]
ce8e028e9b
Merge #11872
...
11872: internal: Remove `PathResolution::AssocItem` r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-04-01 17:12:44 +00:00
Lukas Wirth
c290e68ff9
internal: Remove PathResolution::AssocItem
2022-04-01 18:32:05 +02:00
bors[bot]
50225fe630
Merge #11869
...
11869: fix: code blocks with tilde also works like code block r=Veykril a=moreal
The `rustdoc` uses the `pulldown_cmark` package to parse *doc_comment* and the package also treat triple `~` characters also as code block fences. So when we run `cargo doc`, they will be placed also.
<img width="965" alt="image" src="https://user-images.githubusercontent.com/26626194/161208072-5a09a209-57fc-4a52-b190-b0a9be9ffcd6.png ">
But `rust-analyzer` doesn't support it so it doesn't have any injected code highlights and any `Run doctest` hint. This pull request tries to allow also them. 🙇🏻♂️
Before:
<img width="224" alt="image" src="https://user-images.githubusercontent.com/26626194/161207405-b1d6cfda-82b1-4f60-8e42-c51d0ed98f38.png ">
After:
<img width="161" alt="image" src="https://user-images.githubusercontent.com/26626194/161207693-8e39997c-9ca6-4e69-8c65-e9b70899f7db.png ">
Co-authored-by: Lee Dogeon <dev.moreal@gmail.com>
2022-04-01 12:40:51 +00:00
Lee Dogeon
e3f32d13e1
Code blocks with tilde also works like code block
2022-04-01 20:29:32 +09:00
Lukas Wirth
75689f2ad8
internal: Enforce Resolver to always have a module scope
2022-03-31 11:12:08 +02:00
Lukas Wirth
ef92453dfe
internal: Refactor FamousDefs builtin crate search
2022-03-30 22:23:54 +02:00
Lukas Wirth
0ae795136d
Sort runnable test results to make them deterministic
2022-03-26 19:38:20 +01:00
hkalbasi
22eaee25b8
organize const eval tests
2022-03-24 13:20:35 +04:30
hkalbasi
0e2989e421
Support constants in const eval
2022-03-24 13:09:22 +04:30
bors[bot]
75fada4aab
Merge #11805
...
11805: fix: Don't try to resolve methods on unknown types r=Veykril a=flodiebold
Fixes #10454 , and some type mismatches.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2022-03-23 20:20:09 +00:00
Florian Diebold
fa923f9b19
Adjust value in syntax highlighting benchmark
2022-03-23 19:28:01 +01:00
bors[bot]
652233283b
Merge #11791
...
11791: fix: some fixes and improvements to signature help r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2022-03-23 00:36:11 +00:00
Lukas Wirth
8e91bb7660
minor: Bump dependencies
2022-03-22 17:42:24 +01:00
Jonas Schievink
4e07864f59
signature help: skip lifetimes when non-lifetime arguments are present
2022-03-22 16:44:27 +01:00
Jonas Schievink
4bb5df0ce5
Avoid signature help inside multiline expressions
...
Fixes #11768
2022-03-22 16:08:46 +01:00
Jonas Schievink
c9cefb9916
Improve readability of signature help tests
2022-03-22 15:03:19 +01:00
Laurențiu Nicola
1a37b17162
Replace write! with direct calls
2022-03-21 10:43:36 +02:00
bors[bot]
6f2b118605
Merge #11775
...
11775: internal: Treat `global_asm` and `asm` macros as unsafe r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:31:27 +00:00
Lukas Wirth
ddf144051a
internal: Treat {global_}asm macros as unsafe
2022-03-20 19:31:00 +01:00
bors[bot]
fedf724d82
Merge #11774
...
11774: feat: Tag macro calls as unsafe if they expand to unsafe expressions r=Veykril a=Veykril
as long as they aren't inside an unsafe block inside the macro that is.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 18:15:29 +00:00
Lukas Wirth
68de7b30e0
feat: Tag macro calls as unsafe if they expand to unsafe expressions
2022-03-20 19:07:44 +01:00
bors[bot]
966b692422
Merge #11771
...
11771: feat: Visualize compiler inserted reborrows via inlay hints r=Veykril a=Veykril
Disabled by default.
![image](https://user-images.githubusercontent.com/3757771/159165178-baaf968a-4381-468e-933f-5326ca1b203d.png )
Closes https://github.com/rust-analyzer/rust-analyzer/issues/11275
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-20 13:47:16 +00:00
Lukas Wirth
5a87f09a71
Update inlay hint feature docs
2022-03-20 14:41:27 +01:00
Lukas Wirth
37b48ceb8f
feat: Visualize compiler inserted reborrows via inlay hints
2022-03-20 14:38:16 +01:00
bors[bot]
a82caff588
Merge #11765
...
11765: fix: Fix closure hints using macro ranges r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-19 19:26:34 +00:00
Lukas Wirth
2598575a35
fix: Fix closure hints using macro ranges
2022-03-19 20:24:09 +01:00
bors[bot]
7315d97347
Merge #11755
...
11755: feat: Implement lifetime elision hints r=Veykril a=Veykril
With names on:
![Code_erl26zKvuf](https://user-images.githubusercontent.com/3757771/159134856-e2c75d2d-f17c-45c7-9a78-3da5ee8b1acd.png )
With names off:
![Code_MRP1Pbfe9d](https://user-images.githubusercontent.com/3757771/159134857-30fac3a1-825e-4f49-ba9b-9fa0bb215694.png )
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-19 19:15:06 +00:00
Lukas Wirth
7da5b80f25
Change skip trivial behaviour
2022-03-19 20:12:14 +01:00
Lukas Wirth
7ab0aaa82a
Add option to skip trivial cases
2022-03-19 19:01:19 +01:00
Lukas Wirth
45756c823f
Use numbers for lifetimes by default, add setting to prefer using parameter names
2022-03-19 18:11:56 +01:00
Jonas Schievink
55d2a25123
Rename call info to "signature help"
...
It is no longer limited to just calls
2022-03-18 20:19:35 +01:00
Jonas Schievink
0642724e94
Provide signature help when editing generic args
2022-03-18 19:59:41 +01:00
Lukas Wirth
c22fed895e
Fix test fixtures
2022-03-18 18:57:15 +01:00
Lukas Wirth
b634d99361
Give the lifetimes better names
2022-03-18 18:55:03 +01:00
Lukas Wirth
673e2b1d8f
feat: Implement lifetime elision hints
2022-03-18 18:11:16 +01:00
Lukas Wirth
828196be3b
fix: Fix runnables trying to add doc tests in the crate root from #[macro_export] macros
2022-03-18 12:01:59 +01:00
Lukas Wirth
bd17933c31
feat: Add return type hints for closures with block bodies
2022-03-16 21:25:03 +01:00
Lukas Wirth
4fe5f03c7f
Rename compound things to variant things
2022-03-16 13:41:47 +01:00
hkalbasi
b301b040f5
Add const generics
2022-03-14 14:38:37 +03:30
Matthias Krüger
5a0078c9d1
more clippy fixes:
...
clippy::search_is_some
clippy::redundant_static_lifetimes
clippy::match_single_binding
clippy::match_ref_pats
clippy::map_entry
clippy::manual_map
clippy::iter_overeager_cloned
clippy::into_iter_on_ref
clippy::extra_unused_lifetimes
2022-03-12 16:50:49 +01:00
Matthias Krüger
56e4ea59d9
more clippy fixes:
...
clippy::match_like_matches_macro
clippy::to_string_in_format_args
clippy::single_char_add_str
clippy::filter_map_identity
clippy::clone_on_copy
clippy::useless_format
clippy::unused_unit
2022-03-12 16:50:49 +01:00
Matthias Krüger
d64d711db2
fix clippy::map_flatten
2022-03-12 16:50:49 +01:00
Matthias Krüger
451fcd3c79
fix clippy::redundant_closure
2022-03-12 16:50:49 +01:00
Matthias Krüger
1f70886b15
fix clippy::single_char_pattern
2022-03-12 16:50:49 +01:00
Matthias Krüger
7912e33ed6
fix clippy::needless_borrow
2022-03-12 16:50:49 +01:00
yipinliu
c15ebcd84c
Optimize imports
2022-03-12 21:06:33 +08:00
yipinliu
0c54921f93
Fixed code style issues
2022-03-12 20:36:56 +08:00
yipinliu
8247925313
Fixed tidy test
2022-03-12 20:04:14 +08:00
yipinliu
581e1bf0d7
Highlight escape sequences in byte strings
2022-03-12 19:03:14 +08:00
Lukas Wirth
62265ee9cb
fix: Allow configuration of colons in inlay-hints
2022-03-11 21:15:36 +01:00
Lukas Wirth
6c8c02f625
Don't parse source files to generate macro completion details
2022-03-10 22:21:58 +01:00
bors[bot]
5b51cb835a
Merge #11664
...
11664: fix: Properly handle proc-macro crate types for nameres r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-09 21:45:42 +00:00
Lukas Wirth
1f1185dcbb
Specific proc-macro crate type for other test fixture where needed
2022-03-09 22:18:09 +01:00
Lukas Wirth
3edc5dcea8
fix: Properly handle proc-macro crate types for nameres
2022-03-09 14:33:39 +01:00
bors[bot]
d70ea759b3
Merge #11663
...
11663: Internal: Add hir_def::MacroId, add Macro{Id} to ModuleDef{Id} r=Veykril a=Veykril
With this we can now handle macros like we handle ModuleDefs making them work more like other definitions and allowing us to remove a bunch of special cases. This also enables us to track the modules these macros are defined in, instead of only recording the crate they come from.
Introduces a new class of `MacroId`s (for each of the 3 macro kinds) into `hir_def`. We can't reuse `MacroDefId` as that is defined in `hir_expand` which doesn't know of modules, so now we have two different macro ids, this unfortunately requires some back and forth mapping between the two via database accesses which I hope won't be too expensive.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-03-09 10:26:34 +00:00
Lukas Wirth
4e94fb7028
Fix ProcMacroData recording wrong name for derives
2022-03-09 01:13:38 +01:00
Lukas Wirth
c37fe779c6
Add data queries for macros
2022-03-09 00:41:54 +01:00
Lukas Wirth
eba90936c1
Move ide crates to new hir::Macro
2022-03-08 23:52:26 +01:00
bors[bot]
49646b71d4
Merge #11445
...
11445: Upstream inlay hints r=lnicola a=lnicola
Closes https://github.com/rust-analyzer/rust-analyzer/issues/2797
Closes https://github.com/rust-analyzer/rust-analyzer/issues/3394 (since now resolve the hints for the range given only, not for the whole document. We don't actually resolve anything due to [hard requirement](https://github.com/rust-analyzer/rust-analyzer/pull/11445#issuecomment-1035227434 ) on label being immutable. Any further heavy actions could go to the `resolve` method that's now available via the official Code API for hints)
Based on `@SomeoneToIgnore's` branch, with a couple of updates:
- I squashed, more or less successfully, the commits on that branch
- downloading the `.d.ts` no longer works, but you can get it manually from https://raw.githubusercontent.com/microsoft/vscode/release/1.64/src/vscode-dts/vscode.proposed.inlayHints.d.ts
- you might need to pass `--enable-proposed-api matklad.rust-analyzer`
- if I'm reading the definition right, `InlayHintKind` needs to be serialized as a number, not string
- this doesn't work anyway -- the client-side gets the hints, but they don't display
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-03-07 16:49:12 +00:00
Luna Razzaghipour
6da1228898
Emit more detailed highlighting for %
, >>
, <<
2022-03-07 20:16:03 +11:00
Lukas Wirth
ab21cf2f4f
internal: Re-arrange ide_db modules
2022-03-06 19:04:04 +01:00
Lukas Wirth
97076c074d
internal: Simplify and optimize syntax_highlighting
2022-03-06 03:49:54 +01:00
Lukas Wirth
e8edbb5d6f
Add a macro case for the keyword highlighting test fixture
2022-03-06 00:26:15 +01:00
Lukas Wirth
d460b7c9d1
Fix extern crate self having self unresolved
2022-03-06 00:17:40 +01:00
Lukas Wirth
e5bb661b7a
Highlight Self
as a keyword by default
2022-03-06 00:13:45 +01:00
Lukas Wirth
b454f11f38
Fix hover for Self
keyword
2022-03-05 23:47:44 +01:00
Lukas Wirth
5c0aee013e
Fix highlighting of Self
2022-03-05 23:34:37 +01:00
Lukas Wirth
c0d6471143
fix: Recognize Self
as a proper keyword
2022-03-05 23:20:06 +01:00
Andy Russell
49fab593ad
show variadic args in hover function signature
2022-03-04 16:44:31 -05:00
bors[bot]
908c17bfa6
Merge #11595
...
11595: fix: lower string literals with actual value instead of default r=lnicola a=tysg
Fixes #11582 . Some questions below in the code review section.
Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
2022-03-04 20:21:43 +00:00
Lukas Wirth
4a866fc672
Simplify
2022-03-04 20:23:25 +01:00
Lukas Wirth
32bf7af83e
Support locals with multiple declaration sites
2022-03-04 19:49:08 +01:00
hkalbasi
4fa8749c44
Preserve order of generic args
2022-03-04 11:46:14 +03:30
Kirill Bulatov
b1d8dae930
Load hints for part of the file only
2022-03-04 07:45:51 +02:00
Tianyi Song
89a19f57f8
Lower string literals with real val, not default
2022-03-04 10:16:35 +08:00
Lukas Wirth
464dd814ca
slightly improve highlighting performance for derive annotated items
2022-03-03 22:59:34 +01:00
Lukas Wirth
8ded3ec9cf
fix: Fix semantic highlighting breaking for lifetimes in macros
2022-03-03 22:53:03 +01:00
bors[bot]
342c3c42bb
Merge #11433
...
11433: minor: Add scary warning to `onEnter` r=lnicola a=lnicola
Closes #11432
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2022-02-28 10:15:44 +00:00
Laurențiu Nicola
6bf97692ae
Add scary warning to onEnter
2022-02-28 12:15:15 +02:00
Lukas Wirth
47ce4436e4
Make hir::Local::name infallible
2022-02-26 16:36:44 +01:00
Lukas Wirth
36603e0478
Rename test highlighting output files
2022-02-26 14:52:42 +01:00
Lukas Wirth
c99fb4b1ac
Split up highlighting tests a bit more
2022-02-26 14:45:09 +01:00
Lukas Wirth
48189bc1b4
Re-order and cleanup highlighting tests
2022-02-26 14:29:03 +01:00
Lukas Wirth
03d33556c9
fix: Don't emit unresolvedReference highlight tags in unlinked files
2022-02-26 13:53:54 +01:00
Jonas Schievink
a247fffdf6
Resolve $crate
in HirDisplay
of Path
2022-02-25 18:38:51 +01:00
Moritz Vetter
3da08071ce
add logic to highlight continue and break keywords according to expectations
2022-02-24 18:58:14 +01:00
Moritz Vetter
cad0cf6950
refactor helper function to work with function taking expression enum instead of break expression
2022-02-24 18:58:14 +01:00
Moritz Vetter
1c074499f3
add some breaking tests (TDD - style)
2022-02-24 18:58:14 +01:00
Lukas Wirth
e759db361e
Resolve functions as proc-macros via FileAstId
2022-02-23 11:21:46 +01:00
Lukas Wirth
2e124d15fb
fix: Fix expand_macro always expanding the first listed derive
2022-02-22 12:32:27 +01:00
Lukas Wirth
b494795a42
update references::derive test output
2022-02-22 10:52:35 +01:00
Lukas Wirth
1bbef5af85
Fix syntax highlighting not highlighting derives anymore
2022-02-22 10:20:44 +01:00
Lukas Wirth
f13c98034b
Make replace_derive_with_manual_impl work again
2022-02-22 10:20:44 +01:00
Lukas Wirth
be3168dabe
Fix expand_macro
not working for derive attributes
2022-02-22 10:20:44 +01:00
Lukas Wirth
7b89d5ede2
internal: Expand the derive attribute into a pseudo expansion
2022-02-22 10:20:40 +01:00
bors[bot]
c0ee2f23ff
Merge #11490
...
11490: Correctly fix formatting doc tests with generics r=Veykril a=KarlWithK
Before the doc_test would be outputted like this:
```zsh
"Foo<T, U>::t"
```
However, this would cause problems with shell redirection. I've changed it
so when generics are involved we simply wrap the expression under quotes as so:
```zsh
"\"Foo<T, U>::t\""
```
Note:
At the cost of adding this, I had to allocate a new string via
`format!{}`. However, I argue this is alright as this for just for
outputting the name of the doc test.
The following tests have been changed:
```
runnables::tests::doc_test_type_params
runnables::tests::test_doc_runnables_impl_mod
runnables::tests::test_runnables_doc_test_in_impl
```
Closes https://github.com/rust-analyzer/rust-analyzer/issues/11489
Co-authored-by: KarlWithK <jocelinc60@outlook.com>
Co-authored-by: SeniorMars <jocelinc60@outlook.com>
2022-02-21 21:57:44 +00:00
SeniorMars
bf47acf1d3
Update crates/ide/src/runnables.rs
...
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-21 15:23:09 -06:00
bors[bot]
b663b733d9
Merge #11522
...
11522: fix: Make code lenses work on attributed items r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11213
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-21 17:08:19 +00:00
Lukas Wirth
c6645f2eb6
fix: Make code lenses work on attributed items
2022-02-21 18:07:47 +01:00
bors[bot]
979b5b32bc
Merge #11455
...
11455: Handle proc-macro functions as the proc-macro they resolve to r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11212
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-21 16:56:37 +00:00
Lukas Wirth
0d3cd90d08
Move fn to proc-macro conversion to name classification
2022-02-21 17:56:11 +01:00
bors[bot]
24255e5b3d
Merge #11481
...
11481: Display parameter names when hovering over a function pointer r=Veykril a=Vannevelj
Implements #11474
The idea is pretty straightforward: previously we constructed the hover based on just the parameter types, now we pass in the parameter names as well. I went for a quick-hit approach here but I expect someone will be able to point me to a better way of resolving the identifier.
I haven't figured out yet how to actually run my rust-analyzer locally so I can see it in action but the unit test indicates it should work.
Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2022-02-21 13:08:31 +00:00
Chayim Refael Friedman
13ac5c3491
Fix various IDE features
...
As a side benefit, we got `let` guard support for `move_guard` for free.
2022-02-21 08:34:35 +02:00
KarlWithK
5f3327a6b8
Correctly fix formatting doc tests with generics
...
Before the doc_test would be outputted like this:
"Foo<T, U>::t"
However, this would cause shells with shell redirection. I've changed it
so when generics are involved we simply wrap the expression under escape
chanters as so:
"\"Foo<T, U>::t\""
Note:
At the cost of adding this, I had to allocate a new string via
format!{}. However, I argue this is alright as this for just for
outputting the name of the doc test.
The following tests have been changed:
runnables::tests::doc_test_type_params
runnables::tests::test_doc_runnables_impl_mod
runnables::tests::test_runnables_doc_test_in_impl
2022-02-17 20:27:37 -06:00
Jeroen Vannevel
842ffde43d
test names
2022-02-15 19:22:36 +00:00
Jeroen Vannevel
d985394ce2
add test for function pointer without identifier
2022-02-15 19:20:50 +00:00
Jeroen Vannevel
c450d0ce41
cleanup
2022-02-15 14:47:23 +00:00
Jeroen Vannevel
73e49493bd
rough, but appears to work
2022-02-15 14:39:22 +00:00
Lukas Wirth
95db3c1476
fix: keyword hover works on non-keyword tokens if expanded to keyword
2022-02-15 10:09:19 +01:00
bors[bot]
aafa40cebd
Merge #11369
...
11369: feat: Add type hint for keyword expression hovers r=Veykril a=danii
Adds the return type of keywords to tool-tips where it makes sense. This applies to: `if`, `else`, `match`, `loop`, `unsafe` and `await`. Thanks to `@Veykril` for sharing the idea of putting return type highlighting on other keywords!
![image](https://user-images.githubusercontent.com/39541871/151611737-12325c23-a1f9-4fca-ae48-279b374bdcdf.png )
Closes #11359
Co-authored-by: Daniel Conley <himself@danii.dev>
2022-02-14 21:07:41 +00:00
Daniel Conley
768804f11d
Hide Keyword Expression Hover For Units ()
...
Cleaned up the code for keyword expression hovers.
Added a check to hide units `()` in keyword expression hovers.
2022-02-14 15:26:40 -05:00
Lukas Wirth
cef8a17ea5
Handle proc-macro functions as the proc-macro they resolve to
2022-02-11 22:06:03 +01:00
Tianyi Song
e62e926a8a
Use text range of name after macro expansion
2022-02-11 14:17:12 +08:00
TheDoctor314
add80bccfc
Add test
...
The rename function should not change any path segments that refer to a
module by super.
2022-02-08 21:19:14 +05:30
Moritz Vetter
ba2ef69c79
Bump pulldown-cmark-to-cmark, adjust usages and fix test
2022-02-06 09:04:06 +01:00
Lukas Wirth
f6def3ccdf
fix: Fix proc-macro server not using the supplied span in Ident::new
2022-01-31 17:02:57 +01:00
Lukas Wirth
45ff51ba22
Make more precise range macro upmapping
2022-01-31 15:53:44 +01:00
Lukas Wirth
5fd3688018
Fix token ascension single token check being inverted
2022-01-31 13:26:09 +01:00
Lukas Wirth
ddf7b70a0f
Fix cfg_attr invalidating derive identifier IDE functionality
2022-01-30 22:47:16 +01:00
Daniel Conley
261abbf45e
Add Keyword Return Type Highlighting
2022-01-28 14:44:17 -05:00
bors[bot]
2cb85c14b6
Merge #11281
...
11281: ide: parallel prime caches r=jonas-schievink a=jhgg
cache priming goes brrrr... the successor to #10149
---
this PR implements a parallel cache priming strategy that uses a topological work queue to feed a pool of worker threads the crates to index in parallel.
## todo
- [x] should we keep the old prime caches?
- [x] we should use num_cpus to detect how many cpus to use to prime caches. should we also expose a config for # of worker CPU threads to use?
- [x] something is wonky with cancellation, need to figure it out before this can merge.
Co-authored-by: Jake Heinz <jh@discordapp.com>
2022-01-25 16:03:35 +00:00
Laurențiu Nicola
e3e6133ff4
Bump pulldown-cmark and pulldown-cmark-to-cmark
2022-01-21 19:49:57 +02:00
Jonas Schievink
a3d06f824b
status: output all crates a file belongs to
2022-01-17 18:10:01 +01:00
bors[bot]
7a52f83700
Merge #11294
...
11294: internal: Move format specifier lexing from syntax to ide_db r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-15 12:18:46 +00:00
Lukas Wirth
91279db2b4
Move format specifier lexing from syntax to ide_db
2022-01-15 13:14:59 +01:00
bors[bot]
4c34909308
Merge #11293
...
11293: feat: Add very simplistic ident completion for format_args! macro input r=Veykril a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-15 11:24:21 +00:00
Lukas Wirth
82fccb971e
feat: Add very simplistic ident completion for format_args! macro input
2022-01-15 12:23:26 +01:00
Jake Heinz
25f67b6939
make it a config
2022-01-15 02:47:47 +00:00
bors[bot]
9ba6cfa9c7
Merge #11283
...
11283: fix: Adjust `.` typing auto indentation r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/629
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-14 11:16:18 +00:00
Lukas Wirth
ba3efafc0d
fix: Adjust .
typing auto indentation
2022-01-14 12:15:43 +01:00
Jake Heinz
bcc99091f3
hacky fix for cancelling
2022-01-14 10:30:51 +00:00
Jake Heinz
6c5504a617
one last bit of cleanup
2022-01-14 10:10:47 +00:00
Jake Heinz
c3f30ae4f0
removed scoped threads, cleanup
2022-01-14 10:06:28 +00:00
Jake Heinz
f83c0166be
cleanup + detect num cpus
2022-01-14 09:48:59 +00:00
Jake Heinz
0b0bfc6fdd
cleanup
2022-01-14 09:36:03 +00:00
Jake Heinz
c8aa2f6a61
use index map
2022-01-14 09:35:41 +00:00
Jake Heinz
5f0c1aa2de
make progress callback dyn
2022-01-14 09:33:40 +00:00
Jake Heinz
2b0d8a86a2
fix warnings
2022-01-14 09:25:45 +00:00
Jake Heinz
343b0ccfb9
simplify
2022-01-14 09:21:25 +00:00
Jake Heinz
3168148cc6
ide: parallel prime caches
2022-01-14 09:16:35 +00:00
Jonas Schievink
09219e10f1
Mostly restore hir
API boundary
2022-01-12 19:56:47 +01:00
Lukas Wirth
b32f611b6e
fix: Fix outline modules spilling inner doc injections into their parent
2022-01-08 14:54:31 +01:00
Lukas Wirth
6746ba5839
Record attribute calls on assoc items in TraitData and ImplData
2022-01-08 10:45:12 +01:00
bors[bot]
40009e07d0
Merge #11145
...
11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj
Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields
before:
```rust
pub enum Other {
One,
Two,
}
pub struct Test {
text: String,
num: usize,
other: Other,
}
fn t_test() {
let test = Test {<|>};
}
```
after:
```rust
pub enum Other {
One,
Two,
}
pub struct Test {
text: String,
num: usize,
other: Other,
}
fn t_test() {
let test = Test {
text: String::new(),
num: 0,
other: todo!(),
};
}
```
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
2022-01-07 14:10:11 +00:00
Lukas Wirth
ca4baa6e55
Use FileAstId<ast::Adt>
in nameres where appropriate instead
2022-01-07 14:20:27 +01:00
Laurențiu Nicola
e14d9208f5
Move pretty-printing test out of assist
2022-01-06 16:38:25 +02:00
Lukas Wirth
dc135cc076
internal: Support registered tools and attributes in ide layer
2022-01-06 14:56:50 +01:00
Jonas Platte
c90c88b083
Always put a space after impl in macro pretty-printing
...
… regardless of whether the next symbol is punctuation or not.
2022-01-06 11:33:08 +01:00
bors[bot]
ac3ea3e81c
Merge #11112
...
11112: Evaluate constants in array repeat expression r=HKalbasi a=HKalbasi
cc #8655
Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
2022-01-04 21:51:37 +00:00
hkalbasi
75c2acae6e
Evaluate constants in array repeat expression
2022-01-05 01:17:01 +03:30
Lukas Wirth
c5a9985fc5
Remove lossy Definition::from_token
/Definition::from_node
methods
2022-01-04 18:29:53 +01:00
bors[bot]
68bc12c3b8
Merge #11157
...
11157: internal: Remove `SemanticScope::speculative_resolve_as_mac` r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11132
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-04 16:49:47 +00:00
Lukas Wirth
19f1ff5c70
give resolve_derive_ident
a more robust api
2022-01-03 16:00:45 +01:00
bors[bot]
8e9ccbf97a
Merge #11177
...
11177: internal: dont descend into comments r=Veykril a=jhgg
fixes #11176
Co-authored-by: Jake Heinz <jh@discordapp.com>
2022-01-03 02:03:03 +00:00
Jake Heinz
04decd5e6b
internal: dont descend into comments
2022-01-03 01:53:58 +00:00
bors[bot]
abbc7e3a0e
Merge #11088
...
11088: closes #10446 hide type inlay hints r=Veykril a=Heinenen
Passes tests as described in #10446
Works for all happy cases, there may be some cases that I forgot as I am not that familiar with Rust and r-a (yet).
Co-authored-by: Heinenen <th.m.heinen@gmail.com>
2022-01-03 00:51:08 +00:00
Lukas Wirth
087122ad1a
fix: Fix highlighting hack for self-params
2022-01-03 01:32:03 +01:00
Lukas Wirth
6b7b09d329
internal: Record unresolved derive invocations in hir
2022-01-02 23:44:23 +01:00
Lukas Wirth
762a3b3030
Fix tool module classification not working correctly
2022-01-02 23:14:18 +01:00
Lukas Wirth
19d894cdec
minor: Cleanup syntax highlighting
2022-01-02 22:23:05 +01:00
Lukas Wirth
22160c418b
fix NameRefClass misclassifying proc-macros
2022-01-02 19:20:10 +01:00
Lukas Wirth
9eed85b171
fix syntactic highlighting for macros
2022-01-02 19:10:23 +01:00
Lukas Wirth
3a525c831f
internal: Handle macro calls better in highlighting
2022-01-02 19:10:10 +01:00
Aleksey Kladov
d846afdeef
check top level entry point invariants
2022-01-02 18:41:32 +03:00
Benjamin Coenen
df6fa50f92
feat(diagnostics): add new config to fill default expression
...
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-12-31 16:29:08 +01:00
hkalbasi
e6139cf47b
show values of constants in hover
2021-12-23 17:53:46 +03:30
Heinenen
05abfc77f5
hide type inlay hints
2021-12-23 12:56:38 +01:00
Heinenen
d7dfe93fc3
hide type inlay hints for enum variant constructors and tuple struct constructors
2021-12-23 12:56:38 +01:00
Lukas Wirth
85ed5a3182
Make hover test not relient on minicore structure
2021-12-22 02:36:31 +01:00
Lukas Wirth
40d5c58a80
Fully render const item completions from hir
2021-12-21 16:35:51 +01:00
bors[bot]
d3aa2579cc
Merge #11069
...
11069: fix: Partially fix `ide_db::search` for crate roots r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10007
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-20 16:50:35 +00:00
Lukas Wirth
5206946674
fix: Partially fix ide_db::search
for crate roots
2021-12-20 17:48:47 +01:00
bors[bot]
f46731a230
Merge #11028
...
11028: Bump MSRV (1.57) r=Veykril a=iDawer
This bumps MSRV on all crates to 1.57 except `la-arena`
#10986 requires >=1.57
Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2021-12-20 13:45:35 +00:00
rainy-me
67cc6c1e16
feat: treat fn keyword inside function pointer type as primitive
2021-12-19 01:51:51 +09:00
Laurențiu Nicola
8ad7c0439c
Remove needless clones
2021-12-17 17:35:10 +02:00
Lukas Wirth
d3e538638a
fix: Don't duplicate attribute completions
2021-12-17 15:22:53 +01:00
iDawer
676744be6e
Bump MSRV (1.57)
2021-12-16 01:56:12 +05:00