Commit Graph

2210 Commits

Author SHA1 Message Date
Wilfred Hughes
edabffbd5a SCIP: Qualify parameters by the containing function
SCIP requires symbols to be unique, but multiple functions may have a
parameter with the same name. Qualify parameters according to the
containing function.
2023-08-04 16:38:31 -07:00
Lukas Wirth
bcff166b3a Add ExternCrateDecl to HIR 2023-08-02 11:52:55 +02:00
bors
c71e1368fd Auto merge of #15269 - DropDemBits:structured-snippets-deferred-rendering, r=Veykril
internal: Defer structured snippet rendering to allow escaping snippet bits

Since we know exactly where snippets are, we can transparently escape snippet bits to the exact text edits that need it, and not have to do it for anything other text edits.

Also will eventually fix #11006 once all assists are migrated. This comes as a side-effect of text edits that don't have snippets get marked as having no insert formatting at all.
2023-08-01 09:18:46 +00:00
Lukas Wirth
bd6ec06237 Write proc-macro server spawn errors to the status text 2023-07-30 14:38:25 +02:00
bors
99718d0c8b Auto merge of #15303 - oxalica:fix/byte-escape-highlight, r=lowr
Fix highlighting of byte escape sequences

Currently non-UTF8 escape sequences in byte strings and any escape sequences in byte literals are ignored.
2023-07-22 20:25:40 +00:00
hkalbasi
eb143383c3 Pass TraitEnvironment into layout_ty and const_eval 2023-07-20 13:08:38 +03:30
oxalica
1f35e4d3f1
Introduce invalidEscapeSequence semantic token type 2023-07-19 15:12:53 +08:00
Bernardo Sulzbach
0e2c68da64
Fix rust-analzyer ssr help message 2023-07-16 12:12:33 +02:00
Красимир Беров
8f169f9642
Update flags.rs
Fixed typo in documentation comment
2023-07-16 10:27:20 +03:00
DropDemBits
614987ae71
Test rendering of snippets
Had a missing ':' between the snippet index and placeholder text
2023-07-12 17:22:02 -04:00
DropDemBits
a1877df5a5
Passthrough is_snippet for non-structured snippets
Structured snippets precisely track which text edits need to be marked
as snippet text edits, but the cases where structured snippets aren't
used but snippets are still present are for simple single text-edit
changes, so it's perfectly fine to mark all one of them as being a
snippet text edit
2023-07-12 03:14:09 -04:00
DropDemBits
a3a02d01f3
Simplify snippet rendering
Also makes sure that stray placeholders get converted into tabstops
2023-07-12 02:58:32 -04:00
DropDemBits
97a6fa58cd
internal: Defer rendering of structured snippets
This ensures that any assist using structured snippets won't
accidentally remove bits interpreted as snippet bits.
2023-07-12 01:50:35 -04:00
DropDemBits
89f7bf7411
Add SnippetEdit to be alongside source changes
Rendering of snippet edits is deferred to places using source change
2023-07-12 00:43:41 -04:00
Adenine
1dd54eb44a change viewMemoryLayoutParams to be textPositionParams 2023-07-08 12:25:54 -04:00
Adenine
2e515d0ac9 fix weird rebase error 2023-07-07 23:23:19 -04:00
Adenine
cfa15d49aa implement first pass of memory layout viewer 2023-07-07 23:09:41 -04:00
hkalbasi
3a1054fc1c Replace x with it 2023-07-06 17:33:17 +03:30
bors
45272efec5 Auto merge of #14990 - HKalbasi:diagnostic-map, r=HKalbasi
Map our diagnostics to rustc and clippy's ones

And control their severity by lint attributes `#[allow]`, `#[deny]` and ... .

It doesn't work with proc macros and I would like to fix that before merge but I don't know how to do it.
2023-07-03 18:58:47 +00:00
bors
daba334611 Auto merge of #15206 - Veykril:let-else-fmt, r=Veykril
internal: Format let-else

As nightly finally got support for it I went ahead and formatted r-a with the latest nightly, then with the latest stable (in case other stuff changed)
2023-07-03 18:41:59 +00:00
Lukas Wirth
69cd3c30ac Format let-else 2023-07-03 20:34:09 +02:00
bors
b9101895d2 Auto merge of #15205 - Veykril:load-cargo, r=Veykril
Split out project loading capabilities from rust-analyzer crate

External tools currently depend on the entire lsp infra for no good reason so let's lift that out so those tools have something better to depend on
2023-07-03 15:46:09 +00:00
Lukas Wirth
28fcd1bdd7 Split out project loading capabilities from rust-analyzer crate 2023-07-03 17:40:31 +02:00
Lukas Wirth
e52027861e Add analysis-stats flag to trigger some IDE features 2023-07-03 16:04:08 +02:00
bors
76bcd9946a Auto merge of #15169 - lowr:patch/impl-header-anon-lifetime, r=HKalbasi
Use anonymous lifetime where possible

Because anonymous lifetimes are *super* cool.

More seriously, I believe anonymous lifetimes, especially those in impl headers, reduce cognitive load to a certain extent because they usually signify that they are not relevant in the signature of the methods within (or that we can apply the usual lifetime elision rules even if they are relevant).
2023-06-30 16:57:20 +00:00
Ali Bektas
cfbeb66a63 Purge of unwrap version 2 2023-06-30 16:31:20 +02:00
Ali Bektas
72aeaef5f3 Purge of unwraps 2023-06-30 15:47:17 +02:00
Lukas Wirth
7e7f401a81
Fix panic in handle_code_action 2023-06-30 08:42:46 +02:00
Lukas Wirth
60d046f567
Fix panic in handle_code_action 2023-06-30 08:38:44 +02:00
Ryo Yoshida
4e793e7859
Use anonymous lifetime where possible 2023-06-29 23:27:28 +09:00
bors
ae89ca3fbb Auto merge of #15161 - lowr:patch/fixture-metadata-library, r=Veykril
internal: add `library` fixture meta

Currently, there is no way to specify `CrateOrigin` of a file fixture ([this] might be a bug?). This PR adds `library` meta to explicitly specify the fixture to be `CrateOrigin::Library` and also makes sure crates that belong to a library source root are set `CrateOrigin::Library`.

(`library` isn't really the best name. It essentially means that the crate is outside workspace but `non_workspace_member` feels a bit too long. Suggestions for the better name would be appreciated)

Additionally:
- documents the fixture meta syntax as thoroughly as possible
- refactors relevant code

[this]: 4b06d3c595/crates/base-db/src/fixture.rs (L450)
2023-06-28 15:23:32 +00:00
Ryo Yoshida
d51536c242
Add library fixture meta
Additionally documents the syntax for fixture meta.
2023-06-28 22:34:14 +09:00
bors
891331c74f Auto merge of #15101 - alibektas:14780, r=Veykril
Check Workspace Edit ResourceOps

PR fixes #14780
2023-06-28 09:57:54 +00:00
Lukas Wirth
f8518a6cfa
Update crates/rust-analyzer/src/handlers/request.rs 2023-06-28 11:57:36 +02:00
Ali Bektas
b96796ce5e Minor changes. Add resolve_resource_op() 2023-06-23 19:22:59 +02:00
Ali Bektas
96cebca116 Version 2 2023-06-22 20:29:11 +02:00
hkalbasi
674cd5ab57 Add run-tests command 2023-06-22 19:33:37 +03:30
Lukas Wirth
0953e85b59 Downgrade some deps to get rif of windows-sys duplication 2023-06-22 11:44:10 +02:00
Lukas Wirth
8823db6c78 Bump more deps 2023-06-22 11:44:10 +02:00
Lukas Wirth
4fa3f1ef5c Bump serde 2 things 2023-06-22 11:44:10 +02:00
Ali Bektas
1de842a7ba Check Workspace Edit ResourceOps
Fixes #14780 . This commit introduces guards for checking if the client supports ResourceOperations for operations to use them.
2023-06-21 18:20:22 +02:00
bors
bc26e81cd5 Auto merge of #15070 - Veykril:analysis-stat-stuff, r=Veykril
internal: Report metric timings for file item trees and crate def map creation
2023-06-21 05:58:13 +00:00
David Lattimore
bea3a33d84 Change in-tree libs to workspace dependencies 2023-06-20 13:53:39 +10:00
Lukas Wirth
8d33b39b4a Use RA_LOG in slow tests logging infra again 2023-06-19 15:11:47 +02:00
Alex Kladov
6303551cb8 internal: use consistent style for error handling 2023-06-19 13:01:47 +01:00
Alex Kladov
49318bbae7 fix: ensure that ws loading error includes path to ws 2023-06-19 12:32:04 +01:00
bors
00b9d9faf4 Auto merge of #15071 - matklad:no-regex, r=matklad
internal: remove spurious regex dependency

- replace tokio's env-filter with a smaller&simpler targets filter
- reshuffle logging infra a bit to make sure there's only a single place where we read environmental variables
- use anyhow::Result in rust-analyzer binary
2023-06-19 10:51:03 +00:00
Alex Kladov
424ef77809 internal: remove spurious regex dependency
- replace tokio's env-filter with a smaller&simpler targets filter
- reshuffle logging infra a bit to make sure there's only a single place
  where we read environmental variables
- use anyhow::Result in rust-analyzer binary
2023-06-18 13:59:32 +01:00
Lukas Wirth
83d7724629 fix: Add binding definition for for-expr iterator desugared binding 2023-06-18 11:44:01 +02:00
Lukas Wirth
a824b734dd Report metric timings for file item trees and crate def map creation 2023-06-17 11:20:21 +02:00