Commit graph

8102 commits

Author SHA1 Message Date
Igor Aleksanov
c26c911ec1 Merge branch 'master' into add-disable-diagnostics 2020-08-14 07:34:07 +03:00
Armin Sander
8fc254597f Sophisticate Windows path encoding 2020-08-14 02:03:54 +02:00
Aleksey Kladov
9664c57e60 Make hygiene private to hir 2020-08-13 23:54:37 +02:00
bors[bot]
9930ef2536
Merge #5753
5753: Remove Hygiene from completion
 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-13 20:42:36 +00:00
Aleksey Kladov
86f89d9b31 Remove Hygiene from completion 2020-08-13 22:41:55 +02:00
Benjamin Coenen
947a27b797 display correctly 'impl Trait<T> + Trait<T>' #4814
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-08-13 22:13:34 +02:00
Aleksey Kladov
ef462ed6af Better recovery in use foo::; 2020-08-13 18:50:21 +02:00
Aleksey Kladov
0e1cda3079 Minor 2020-08-13 18:17:53 +02:00
Aleksey Kladov
6bc2633c90 Align parser names with grammar 2020-08-13 17:59:27 +02:00
Aleksey Kladov
1b0c7701cc Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
Aleksey Kladov
fc34403018 Rename ra_assists -> assists 2020-08-13 17:33:38 +02:00
Aleksey Kladov
ae3abd6e57 Rename ra_ssr -> ssr 2020-08-13 17:02:44 +02:00
Aleksey Kladov
bb5c189b7d Rename ra_ide_db -> ide_db 2020-08-13 16:39:16 +02:00
Aleksey Kladov
ae71a631fd Rename ra_hir -> hir 2020-08-13 16:36:55 +02:00
Aleksey Kladov
6a77ec7bbe Rename ra_hir_ty -> hir_ty 2020-08-13 16:35:29 +02:00
Aleksey Kladov
b28c54a2c2 Rename ra_hir_def -> hir_def 2020-08-13 16:29:33 +02:00
Aleksey Kladov
b7aa4898e0 Rename ra_hir_expand -> hir_expand 2020-08-13 16:29:33 +02:00
Aleksey Kladov
ed20a857f4 Rename ra_db -> base_db 2020-08-13 16:29:33 +02:00
bors[bot]
902f74c269
Merge #5746
5746: Structured search replace now handles UFCS calls to trait methods r=matklad a=davidlattimore



Co-authored-by: David Lattimore <dml@google.com>
2020-08-13 14:21:35 +00:00
Aleksey Kladov
2119dc23e8 Rename ra_proc_macro -> proc_macro_api 2020-08-13 12:39:27 +02:00
David Lattimore
3100de842b Structured search replace now handles UFCS calls to trait methods 2020-08-13 20:24:55 +10:00
bors[bot]
4abdf323af
Merge #5732
5732: Consider only IdentPats for param name hints r=matklad a=SomeoneToIgnore

Closes https://github.com/rust-analyzer/rust-analyzer/issues/4960

Avoid displaying any param name hints like 
<img width="590" alt="image" src="https://user-images.githubusercontent.com/2690773/90071461-47a4ad80-dcfe-11ea-9330-fb4f4e2d1b71.png">

Those hints seem to occupy plenty of space for no apparent benefit, with their destructured content not used in the code with the function hints.

I'm not entirely sure if we should show something else than `IdentPat`s, since I don't understand some of the `Pat` variant meanings:
a1c187eef3/crates/syntax/src/ast/generated/nodes.rs (L1336-L1352)

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-08-13 10:20:59 +00:00
bors[bot]
de1d93455f
Merge #5744
5744: Rename ra_project_model -> project_model r=matklad a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2020-08-13 10:10:03 +00:00
Pavan Kumar Sunkara
eac24d52e6 Rename ra_project_model -> project_model 2020-08-13 12:05:30 +02:00
Aleksey Kladov
c81f6230da Remove ra_fmt crate 2020-08-13 11:59:42 +02:00
Aleksey Kladov
479235ff0b Minor 2020-08-13 11:48:26 +02:00
Aleksey Kladov
80c241b39a Minor 2020-08-13 11:44:39 +02:00
Aleksey Kladov
f0a9128761 Minor 2020-08-13 11:41:39 +02:00
Aleksey Kladov
b0f03db51d Remove deprecated function 2020-08-13 11:37:54 +02:00
Aleksey Kladov
26b98b07aa Cleanup **Move Guard** assist 2020-08-13 10:57:17 +02:00
Aleksey Kladov
7d9480c6eb fmt 2020-08-13 10:36:04 +02:00
Aleksey Kladov
68c2238725 Rename ra_cfg -> cfg 2020-08-13 10:36:04 +02:00
Aleksey Kladov
5734cc8586 Simplify 2020-08-13 10:36:04 +02:00
Aleksey Kladov
3615758f8e Minimize deps 2020-08-13 10:36:04 +02:00
Aleksey Kladov
2f45cfc415 Rename ra_mbe -> mbe 2020-08-13 10:36:04 +02:00
Aleksey Kladov
0e6b94de78 Minor 2020-08-13 10:36:04 +02:00
Pavan Kumar Sunkara
349e6c62ad Rename ra_proc_macro_srv -> proc_macro_srv 2020-08-13 03:18:19 +02:00
Kirill Bulatov
0de795fc4c Consider only IdentPats for param name hints 2020-08-13 00:44:16 +03:00
Aleksey Kladov
0635458a6b **Merge Imports** assist handles self 2020-08-12 18:59:13 +02:00
Aleksey Kladov
a1c187eef3 Rename ra_syntax -> syntax 2020-08-12 18:30:53 +02:00
Aleksey Kladov
50a02eb359 Rename ra_parser -> parser 2020-08-12 17:14:23 +02:00
Aleksey Kladov
6dafc13f5f Rename ra_text_edit -> text_edit 2020-08-12 17:03:06 +02:00
Aleksey Kladov
7510048ec0 Cleanup TextEdit API 2020-08-12 16:58:56 +02:00
Aleksey Kladov
8d34262956 Rename ra_toolchain -> toolchain 2020-08-12 16:52:28 +02:00
Aleksey Kladov
550d7fbe3c Rename ra_tt -> tt 2020-08-12 16:46:54 +02:00
Aleksey Kladov
208b7bd7ba Rename ra_prof -> profile 2020-08-12 16:35:29 +02:00
Igor Aleksanov
b50bb800a5 Merge branch 'master' into add-disable-diagnostics 2020-08-12 17:26:43 +03:00
Aleksey Kladov
98baa9b569 Rename ra_arena 2020-08-12 16:22:05 +02:00
bors[bot]
1e8b2c498a
Merge #5637
5637: SSR: Matching trait associated constants, types and functions r=matklad a=davidlattimore

This fixes matching of things like `HashMap::default()` by resolving `HashMap` instead of `default` (which resolves to `Default::default`).

Same for associated constants and types that are part of a trait implementation.

However, we still don't support matching calls to trait methods.

Co-authored-by: David Lattimore <dml@google.com>
2020-08-12 13:50:34 +00:00
bors[bot]
5b8fdfe231
Merge #5553
5553: Add fix ranges for diagnostics r=matklad a=SomeoneToIgnore

A follow-up of https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Less.20red.20in.20the.20code

Now diagnostics can apply fixes in a range that's different from the range used to highlight the diagnostics.
Previous logic did not consider the fix range, having both ranges equal, which could cause a lot of red noise in the editor.
Now, the fix range gets used with the fix, the diagnostics range is used for everything else which allows to improve the error highlighting.

before:
<img width="191" alt="image" src="https://user-images.githubusercontent.com/2690773/88590727-df9a6a00-d063-11ea-97ed-9809c1c5e6e6.png">
after:
<img width="222" alt="image" src="https://user-images.githubusercontent.com/2690773/88590734-e1fcc400-d063-11ea-9b7c-25701cbd5352.png">

`MissingFields` and `MissingPatFields` diagnostics now have the fix range as `ast::RecordFieldList` of the expression with an error (as it was before this PR), and the diagnostics range as a `ast::Path` of the expression, if it's present (do you have any example of `ast::Expr::RecordLit` that has no path btw?).
The rest of the diagnostics have both ranges equal, same as it was before this PR.

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-08-12 13:44:13 +00:00
bors[bot]
11de7ac2fb
Merge #4743
4743: Add tracking of packed repr, use it to highlight unsafe refs r=matklad a=Nashenas88

Taking a reference to a misaligned field on a packed struct is an
unsafe operation. Highlight that behavior. Currently, the misaligned
part isn't tracked, so this highlight is a bit too aggressive.

Fixes #4600

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
Co-authored-by: Paul Daniel Faria <nashenas88@users.noreply.github.com>
Co-authored-by: Paul Daniel Faria <paulf@pop-os.localdomain>
2020-08-12 13:20:18 +00:00
bors[bot]
2d41cc0ea3
Merge #5722
5722: Replace SepBy with Itertools

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 13:06:38 +00:00
Aleksey Kladov
1c359ab634 Replace SepBy with Itertools 2020-08-12 15:04:06 +02:00
bors[bot]
441fbe3b0a
Merge #5721
5721: Cleanup parser modifiers tests

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 12:53:11 +00:00
Aleksey Kladov
f8bfd77e84 Cleanup parser modifiers tests 2020-08-12 14:52:37 +02:00
Igor Aleksanov
ae0b2477fe
Update crates/ra_ide/src/diagnostics.rs
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-08-12 15:48:56 +03:00
Igor Aleksanov
831e3d58b3 Replace String with &'static str 2020-08-12 15:33:07 +03:00
Aleksey Kladov
f73a6419d4 Allow default everywhere
closes #5681
2020-08-12 14:28:32 +02:00
bors[bot]
42a1692629
Merge #5720
5720: Fix docs

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 11:59:02 +00:00
Aleksey Kladov
c9a42c7c46 Fix docs 2020-08-12 13:56:58 +02:00
bors[bot]
4b3d99f98f
Merge #5699
5699: Fix clippy warnings r=matklad a=popzxc

Currently clippy spawns a bunch of warnings on the `rust-analyzer` project. Nothing critical, but easy to fix, so I guess it won't harm.

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
2020-08-12 11:51:53 +00:00
Igor Aleksanov
fcd4b0176f Revert style preference-related fixes 2020-08-12 14:08:55 +03:00
bors[bot]
e471cb2a12
Merge #5718
5718: Deny clippy

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 10:51:02 +00:00
Aleksey Kladov
49af51129b Deny clippy 2020-08-12 12:49:48 +02:00
bors[bot]
d0fd8eb7f6
Merge #5717
5717: Minor

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-08-12 10:35:18 +00:00
Jonas Schievink
b27d5233bb
Merge pull request #5716 from jonas-schievink/musl
Fix build on musl and test it in CI
2020-08-12 12:31:17 +02:00
Jonas Schievink
67b2b3d0ce Fix build on musl and test it in CI 2020-08-12 12:23:25 +02:00
Aleksey Kladov
96001921fc Minor 2020-08-12 12:21:03 +02:00
bors[bot]
87429768bd
Merge #5711
5711: Display snippet in the completion label r=matklad a=SomeoneToIgnore

Before, the completion did not show the actual snippet and it was hard to understand what to input to get the right snippet:

<img width="467" alt="image" src="https://user-images.githubusercontent.com/2690773/89941040-21f6a600-dc23-11ea-94b8-61f77f88feaf.png">
<img width="367" alt="image" src="https://user-images.githubusercontent.com/2690773/89941046-23c06980-dc23-11ea-8034-6c4e14357c94.png">

Now it's more clear:

<img width="315" alt="image" src="https://user-images.githubusercontent.com/2690773/89941124-42befb80-dc23-11ea-9fcc-5fd49cc92b74.png">
<img width="210" alt="image" src="https://user-images.githubusercontent.com/2690773/89941132-4488bf00-dc23-11ea-99c2-12ec66e0a044.png">


Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-08-12 10:00:08 +00:00
Aleksey Kladov
8aba6bfef5 Simplify 2020-08-12 10:14:08 +02:00
Kirill Bulatov
7543b06d30 Display snippet in the completion label 2020-08-11 22:33:17 +03:00
Kirill Bulatov
db12ccee96 Better naming and docs 2020-08-11 17:52:05 +03:00
Kirill Bulatov
188ec3459e Simplify fix structure 2020-08-11 17:13:40 +03:00
Kirill Bulatov
37aa68f050 Add rustdocs 2020-08-11 15:09:08 +03:00
Kirill Bulatov
c8cad76d25 Improve the ide diagnostics trait API 2020-08-11 15:09:08 +03:00
Kirill Bulatov
29fbc8e021 Move the DiagnosticsWithFix trait on the ide level 2020-08-11 15:09:08 +03:00
Kirill Bulatov
9368619939 Make the fix AST source Optional 2020-08-11 15:09:08 +03:00
Kirill Bulatov
9963f43d51 Refactor the diagnostics 2020-08-11 15:09:08 +03:00
Kirill Bulatov
cfbbd91a88 Require source implementations for Diagnostic 2020-08-11 15:09:08 +03:00
Kirill Bulatov
21184a1b2a Restore accidentally removed public method 2020-08-11 15:09:08 +03:00
Kirill Bulatov
cb0b13a583 Fix another missing fields diagnostics 2020-08-11 15:09:08 +03:00
Kirill Bulatov
ee1586c1ed Better naming 2020-08-11 15:09:08 +03:00
Kirill Bulatov
a61f2445cb Less stubs 2020-08-11 15:09:08 +03:00
Kirill Bulatov
21e5224484 Custom ranges for missing fields 2020-08-11 15:09:08 +03:00
Kirill Bulatov
26e102a567 Separate diagnostics and diagnostics fix ranges 2020-08-11 15:09:08 +03:00
bors[bot]
e0de247520
Merge #5708
5708: Use Hygiene in completion r=jonas-schievink a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-08-11 10:30:39 +00:00
bors[bot]
ef20dfc78d
Merge #5707
5707: Address some FIXMEs for ra_assists r=jonas-schievink a=JmPotato

Signed-off-by: JmPotato <ghzpotato@gmail.com>

Co-authored-by: JmPotato <ghzpotato@gmail.com>
2020-08-11 10:22:57 +00:00
JmPotato
6ef019bd46 Revert some FIXMEs
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-11 17:19:02 +08:00
JmPotato
7fbc9afca4 Typo fix
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-11 16:50:45 +08:00
Laurențiu Nicola
fc01c7846d Use Hygiene in completion 2020-08-11 10:09:50 +03:00
JmPotato
b69dfddb57 Remove redundant dependencies
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-11 14:35:15 +08:00
JmPotato
ace75f9590 Typo fix
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-11 12:09:11 +08:00
JmPotato
dc6e1e0dac Address some FIXMEs
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-11 10:55:26 +08:00
Veetaha
4f386afb16 Log the command flycheck runs to debug misconfigurations
Without this users have no clue why flycheck fails to run.
This is what is printed to the output channel:
```
[ERROR rust_analyzer::main_loop] cargo check failed: Cargo watcher failed,the command produced no valid metadata (exit code: ExitStatus(ExitStatus(25856)))
```

I stumbled with this figuring out that rust-analyzer adds `--all-features` which is not intended
for some crates in the workspace (e.g. they have mutually-exclusive features.
Having the command rust-analyzer ran should help a lot
2020-08-11 03:12:09 +03:00
Jeremy Kolb
cf6d14cee7 Return InvalidRequest if Shutdown has been requested
From the LSP 3.16 spec: "If a server receives requests after a shutdown request those requests should error with InvalidRequest."
2020-08-10 11:03:08 -04:00
Igor Aleksanov
d180b8bbe8 Revert boxing for large enum variant 2020-08-10 15:50:27 +03:00
Paul Daniel Faria
72baf1acdd Remove unused import left behind after rebasing 2020-08-10 08:46:34 -04:00
Paul Daniel Faria
2199d0cda9 Fix type names broken by rebase, redo expected test because of rebase 2020-08-10 08:46:34 -04:00
Paul Daniel Faria
61dff939f9 Move unsafe semantics methods into SemanticsImpl and reference them in Semantics 2020-08-10 08:46:34 -04:00
Paul Daniel Faria
39fdd41df4 Return bool from is_unsafe_method_call and cleanup usages 2020-08-10 08:46:34 -04:00
Paul Daniel Faria
a6af0272f7 Move semantic logic into Semantics, fix missing tag for safe amp operator, using functional methods rather than clunky inline closure 2020-08-10 08:46:34 -04:00
Paul Daniel Faria
87cb09365c Remove merge backup 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
55633f3404 Fix rebase errors 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
08182aa9fa Move unsafe packed ref logic to Semantics, use Attrs::by_key to simplify repr attr lookup 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
c5cc24cb31 Revert function structs back to using bool to track self param, use first param for self information in syntax highlighting instead 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
aca3d6c57e Deduplicate unsafe method call into a single function 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
d5f11e530d Unsafe borrow of packed fields: account for borrow through ref binding, auto ref function calls 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
38440d53d8 Cleanup repr check, fix packed repr check and test 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
c9e670b875 Update FIXME comment to be more useful 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
4a4b1f48ef Limit scope of unsafe to & instead of all ref exprs, add test showing missing support for autoref behavior 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
fd30134cf8 Remove token tree from ReprKind::Other variant, expose ReprKind higher, remove debug println. 2020-08-10 08:44:54 -04:00
Paul Daniel Faria
263f9a7f23 Add tracking of packed repr, use it to highlight unsafe refs
Taking a reference to a misaligned field on a packed struct is an
unsafe operation. Highlight that behavior. Currently, the misaligned
part isn't tracked, so this highlight is a bit too aggressive.
2020-08-10 08:44:54 -04:00
Igor Aleksanov
6344a7f362 Fix clippy warnings 2020-08-10 15:05:01 +03:00
JmPotato
958b91c1e8 Better codes
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-10 17:51:45 +08:00
Dmitry
4874c559ef remove fmt skip attr 2020-08-10 14:17:45 +07:00
JmPotato
4d9c8821e5 Show const body in short_label
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-10 14:02:40 +08:00
bors[bot]
7a03f05eac
Merge #5692
5692: Add support for extern crate r=jonas-schievink a=Nashenas88

This adds syntax highlighting, hover and goto def functionality for extern crate.

Fixes #5690 

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-09 23:16:58 +00:00
Paul Daniel Faria
bf9b4578bb Remove Option<...> from result of Crate::root_module
There doesn't seem to be any need for it, and removing it simplies
several paths of code that depend on it.
2020-08-09 18:52:19 -04:00
bors[bot]
b1cb4ac13d
Merge #5693
5693: Fix no inlay hints / unresolved tokens until manual edit to refresh r=jonas-schievink a=Veetaha

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5349 

Now we return ContentModified during the workspace loading. This signifies the language
client to retry the operation (i.e. the client will
continue polling the server while it returns ContentModified).
I believe that there might be cases of overly big projects where the backoff
logic we have setup in `sendRequestWithRetry` (which we use for inlay hints)
might bail too early (currently the largest retry standby time is 10 seconds).
However, I've tried on one of my project with 500+ dependencies and it is still enough.

Here are the examples before/after the change (the gifs are quite lengthy because they show testing rather large cargo workspace).

<details>
<summary>Before</summary>

Here you can see that the client receives empty array of inlay hints and does nothing more.
Same applies to semantic tokens. The client receives unresolved tokens and does nothing more.
The user needs to do a manual edit to refresh the editor.

![prev-demo](https://user-images.githubusercontent.com/36276403/89717721-e4471280-d9c1-11ea-89ce-7dc3e83d9768.gif)

</details>

<details>
<summary>After</summary>

Here the server returns ContentModified, so the client periodically retries the requests and eventually receives the wellformed response.

![new-demo](https://user-images.githubusercontent.com/36276403/89717725-eb6e2080-d9c1-11ea-84c9-796bb2b22cec.gif)

</details>

Co-authored-by: Veetaha <veetaha2@gmail.com>
2020-08-09 22:39:10 +00:00
Veetaha
dbe7ede2ee Let shutdown request to pass through when status == Loading 2020-08-10 00:49:53 +03:00
bors[bot]
9995e79cce
Merge #5414
5414: Fix test code lens r=jonas-schievink a=avrong

Closes #5217

The implementation is quite similar to #4821. Maybe we should somehow deal with duplicated code.

Also, both of these requests introduce some unclear behavior. I'm not sure how to process this, therefore asking for advice. Examples are below.
<img width="286" alt="image" src="https://user-images.githubusercontent.com/6342851/87713209-83595f80-c7b2-11ea-8c0f-a12e7571e7df.png">

Co-authored-by: Aleksei Trifonov <avrong@avrong.me>
2020-08-09 21:23:20 +00:00
Dmitry
8366e3a7d5 refactoring to show more clearly the import problems 2020-08-10 00:48:32 +07:00
Dmitry
4c6f3f6880 refactoring to show more clearly the import problems 2020-08-10 00:47:22 +07:00
Dmitry
fab733b3ae Revert "fixes"
This reverts commit b602c73911.
2020-08-10 00:23:35 +07:00
Dmitry
ceadcf23fe add skip for generate file 2020-08-10 00:09:53 +07:00
Dmitry
b602c73911 fixes 2020-08-09 23:55:45 +07:00
Dmitry
cff0fba5e5 apply format 2020-08-09 23:47:02 +07:00
Dmitry
06ca135bba fix trailing space 2020-08-09 23:28:48 +07:00
Dmitry
a2eb7e5739 fix unused 2020-08-09 21:03:42 +07:00
Dmitry
8068302fef Merge remote-tracking branch 'origin/master' 2020-08-09 20:39:32 +07:00
Dmitry
1a43a0f63e Added competition for unstable features
Added xtask for download unstable book from rust repository and codegene for it. Also small changes from lint
2020-08-09 20:33:47 +07:00
JmPotato
3f2bc813d3 format in to_proto::markup_content
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2020-08-09 21:33:14 +08:00
Veetaha
e43811c164 Fix no inlay hints / unresolved tokens until manual edit
No we return ContentModified during the workspace loading. This signifies the language
client to retry the operation (i.e. the client will
continue polling the server while it returns ContentModified).
I believe that there might be cases of overly big projects where the backoff
logic we have setup in `sendRequestWithRetry` (which we use for inlay hints)
might bail too early (currently the largest retry standby time is 10 seconds).
However, I've tried on one of my project with 500+ dependencies and it is still enough.
2020-08-08 21:53:38 +03:00
Paul Daniel Faria
6cde0b1aa0 Add support for extern crate
This adds syntax highlighting, hover and goto def
functionality for extern crate
2020-08-08 14:14:18 -04:00
bors[bot]
8a57afe5a4
Merge #5684
5684: Semantic highlighting for unsafe union field access r=jonas-schievink a=Nashenas88

This change adds support for unions in inference and lowering, then extends on that to add the unsafe semantic modifier on field access only. The `is_possibly_unsafe` function in `syntax_highlighting.rs` could be extended to support fns and static muts so that their definitions are not highlighted as unsafe, but only their usage.

Also, each commit of this PR updates the tests. By reviewing the files by commit, it's easy to see how the changes in the code affected the tests.

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-08 16:45:37 +00:00
Paul Daniel Faria
be935b2b56 Apply unsafe semantic highlighting to union field access 2020-08-08 11:29:56 -04:00
Paul Daniel Faria
3bf033e548 Add support for unions in inference and lowering 2020-08-08 11:29:56 -04:00
Paul Daniel Faria
a39d503ef3 Add additional checks for union inference tests 2020-08-08 11:29:50 -04:00
Veetaha
b1ec08e3ff Remove clone 2020-08-08 17:42:50 +03:00
Yusuke Tanaka
cd49e41642
Add test for handle_document_symbol (#5655) 2020-08-08 20:49:09 +09:00
Yusuke Tanaka
b970d675f5
Reverse document symbols for each scope (#5655) 2020-08-08 20:48:45 +09:00
bors[bot]
7a02cc8845
Merge #5679
5679: Account for static mut in missing unsafe diagnostic r=jonas-schievink a=Nashenas88

Accessing or modifying a static mut is an unsafe operation. The "missing unsafe" diagnostic now tracks this.

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-07 12:26:23 +00:00
bors[bot]
911ef38b24
Merge #5678
5678: Static mut unsafe semantic highlighting r=jonas-schievink a=Nashenas88

This marks static mutable names as unsafe, since accessing or modifying a static mut is an unsafe operation.

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-07 12:20:13 +00:00
Igor Aleksanov
c51fb7aca5 Fix failing test 2020-08-07 14:35:43 +03:00
Igor Aleksanov
78c1a87797 Add a test for disabled diagnostics 2020-08-07 14:26:36 +03:00
Igor Aleksanov
90857ff8b0 Add an AnalysisConfig structure and use it to configure diagnostics run 2020-08-07 14:25:55 +03:00
bors[bot]
ae1197accd
Merge #5674
5674: Update chalk r=matklad a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-08-07 10:32:06 +00:00
Igor Aleksanov
c463d217a1 Add names for diagnostics and add a possibility to disable them 2020-08-07 13:18:47 +03:00
Paul Daniel Faria
a6532905a9 Add test for unsafe union field access highlighting 2020-08-06 21:15:31 -04:00
Paul Daniel Faria
f089690a21 Account for static mut in missing unsafe diagnostic 2020-08-06 20:55:29 -04:00