Commit Graph

23084 Commits

Author SHA1 Message Date
Lukas Wirth
0c9375b829 Remove u/i128 hashing overloads from NoHashHasher::Hasher impl 2022-08-25 20:45:35 +02:00
Lukas Wirth
d025c5d8d6 Make use of NoHash hashing for FileId and CrateId 2022-08-25 20:41:49 +02:00
Laurențiu Nicola
10617938b1 Remove unused UpdatesChannel type 2022-08-25 21:33:42 +03:00
Kartavya Vashishtha
0d7ba13b72
style: run tidy tests 2022-08-25 13:17:50 +05:30
Kartavya Vashishtha
9480b38189
extract const generic in ArrayType 2022-08-25 13:11:51 +05:30
Kartavya Vashishtha
71c15f2a44
add test 2022-08-25 13:11:14 +05:30
bors
e3dc5a588f Auto merge of #13101 - Veykril:sem-tokens, r=jonas-schievink
internal: Re-export standard semantic token types and mods

Should help in preventing future occurences of #13099 by having all token types and mods come through the same place
2022-08-23 16:24:39 +00:00
Lukas Wirth
715e3fc119 Re-export standard semantic token types and mods 2022-08-23 18:06:32 +02:00
bors
1456b80167 Auto merge of #13100 - jonas-schievink:doc-links-on-impl, r=jonas-schievink
fix: Resolve doc links on impl blocks

Fixes https://github.com/rust-lang/rust-analyzer/issues/13089
2022-08-23 15:57:12 +00:00
Jonas Schievink
322e7060de Resolve doc links on impl blocks 2022-08-23 17:50:45 +02:00
bors
8dcf4c70c4 Auto merge of #13099 - jonas-schievink:add-decorator-token, r=jonas-schievink
fix: Register decorator token type to avoid panic

Followup to https://github.com/rust-lang/rust-analyzer/pull/13084
2022-08-23 15:47:21 +00:00
Jonas Schievink
5804412869 Register decorator token type to avoid panic 2022-08-23 17:46:29 +02:00
bors
27e17ffd27 Auto merge of #13097 - jonas-schievink:liveshare-docs, r=jonas-schievink
minor: Add a short blurb about VS Code Live Share to the manual
2022-08-23 14:48:28 +00:00
Jonas Schievink
0cc1a89e08 Add a short blurb about VS Code Live Share to the manual 2022-08-23 16:47:26 +02:00
bors
e73b7a9ec7 Auto merge of #13096 - jonas-schievink:parse-more-or-pats, r=jonas-schievink
fix: Allow leading `|` in more pattern positions

fixes https://github.com/rust-lang/rust-analyzer/issues/12894, fixes https://github.com/rust-lang/rust-analyzer/issues/13094

Oddly, the leading `|` token does not end up inside the `OR_PAT` node, since `pattern_top_r` consumes it first. This is a preexisting issue in match arms though, so I didn't fix it here.
2022-08-23 14:35:03 +00:00
Jonas Schievink
8969655ed6 Allow leading | in more pattern positions 2022-08-23 16:31:59 +02:00
Jonas Schievink
dcbbb7f211 ForGoT tO RuN prEttIeR¿ 2022-08-23 15:56:02 +02:00
Jonas Schievink
16a0eb1829 Avoid error popup when using in Live Share 2022-08-23 15:45:02 +02:00
bors
f045f14626 Auto merge of #13084 - Veykril:highlight-config, r=Veykril
Add some more highlighting configurations

The following can be enabled/disabled now in terms of highlighting:
- doc comment injection (enabled by default)
- punctuation highlighting (disabled by default)
- operator highlighting (enabled by default)
- punctuation specialized highlighting (disabled by default)
- operator specialized highlighting (disabled by default)
- macro call bang highlighting (disabled by default)

This PR also changes our `attribute` semantic token type to the `decorator` type which landed upstream (but not yet in lsp-types).

Specialized highlighting is disabled by default, as all clients will have to ship something to map these back to the standard punctuation/operator token (we do this in VSCode via the inheritance mapping for example). This is a lot of maintenance work, and not something every client wants to do, pushing that need to use the user. As this is a rather niche use in the first place this will just be disabled by default.

Punctuation highlighting is disabled by default, punctuation is usually something that can be done by the native syntactic highlighting of the client, so there is no loss in quality. The main reason for this though is that punctuation adds a lot of extra token data that we sent over, a lot of clients struggle with applying this, so disabling this improves the UX for a lot of people. Note that we still highlight punctuations with special meaning as that special entity, (the never type `!` will still be tagged as a builtin type if it occurs as such)

Separate highlighting of the macro call bang `!` is disabled by default, as I think people actually didn't like that change that much, though at the same time I feel like not many people even noticed that change (I prefer it be separate, but that's not enough reason for it to be enabled by default I believe :^) )

cc https://github.com/rust-lang/rust-analyzer/issues/12783 https://github.com/rust-lang/rust-analyzer/issues/13066
2022-08-23 12:39:57 +00:00
bors
631ed2a518 Auto merge of #13092 - Veykril:ref-match-completion, r=Veykril
fix: Fix reference autocompletions using incorrect offsets in macro inputs

Fixes https://github.com/rust-lang/rust-analyzer/issues/13035
2022-08-23 12:30:50 +00:00
Lukas Wirth
6c5d15800e fix: Fix reference autocompletions using incorrect offsets in macro inputs
Fixes https://github.com/rust-lang/rust-analyzer/issues/13035
2022-08-23 14:29:59 +02:00
Lukas Wirth
2a26b054b7 Use lsp-types DECORATOR token type 2022-08-23 14:06:19 +02:00
Lukas Wirth
31fb917d8d Remove unused default semantic modifiers 2022-08-23 14:05:56 +02:00
Lukas Wirth
eadc2673c0 Regen docs 2022-08-23 14:05:56 +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
b26733f8a0 Change attribute semantic token type to decorator 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
afc8cfb4d1 Make operator highlighting configurable, disable it by default 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
bors
6627b473e2 Auto merge of #13090 - ice1k:master, r=Veykril
Do not substitute `Self` when in same impl block

Fix #13076
2022-08-23 08:08:45 +00:00
bors
b2bf37cdde Auto merge of #12976 - tjdevries:scip, r=Veykril
feat: emit SCIP from rust-analyzer

hi rust-analyzer team

I'm one of the engineers at Sourcegraph (and have done a few small changes related to the LSIF work done in rust-analyzer). Recently, we've moved to a new protocol as the primary way to interact with Sourcegraph (LSIF is still possible to upload, so existing jobs will not stop working any time soon). This new protocol is SCIP (I linked a blog post below with more information).

I've implemented SCIP support (based largely on the existing LSIF support). In addition to supporting the existing features that `rust-analyzer`'s LSIF support does, this PR adds the ability to move between crates on sourcegraph.com. So if both your project and a dependency are indexed, you would be able to hop to the particular version and view the source code. I'd be happy to record a demo of that on my local instance if you're interested.

There are a few TODO's left in the code (some that you might have insights on) which I'm happy to fix in this PR, but I just wanted to open this up for discussion first.

Thanks for your time :)

TJ

- [announcing scip](https://about.sourcegraph.com/blog/announcing-scip)
2022-08-23 07:53:36 +00:00
ice1000
148bdf85f2 Do not substitute Self when in same impl block 2022-08-23 01:52:47 -04:00
TJ DeVries
50ecb09da4 feat: emit SCIP via rust-analyzer 2022-08-22 15:13:46 -04:00
bors
6711ded5cd Auto merge of #13088 - Veykril:flycheck-failure, r=Veykril
Pop an error notification when flycheck can't be restarted
2022-08-22 15:43:13 +00:00
Lukas Wirth
2abb78d06d Pop an error notification when flycheck can't be restarted 2022-08-22 17:42:33 +02:00
Lukas Wirth
b19f78b022 Remove auto-config patching from the VSCode client 2022-08-22 17:13:49 +02:00
bors
fdc28b4333 Auto merge of #13021 - N3xed:fix-gat-panics, r=flodiebold
fix: Fix panics on GATs involving const generics

This workaround avoids constant crashing of rust analyzer when using GATs with const generics,
even when the const generics are only on the `impl` block.

The workaround treats GATs as non-existing if either itself or the parent has const generics and
removes relevant panicking code-paths.

Fixes #11989, fixes #12193
2022-08-22 14:00:23 +00:00
bors
c2310a0af6 Auto merge of #13001 - Veykril:scoped, r=Veykril
Replace crossbeam with std's scoped threads

Probably best to wait a week or two so we don't immediately give linux packagers problems again
2022-08-22 12:56:06 +00:00
Lukas Wirth
f9d1b26a96 Replace crossbeam with std's scoped threads 2022-08-22 14:55:13 +02:00
bors
dea163970a Auto merge of #12965 - DesmondWillowbrook:assoc-method-dimming, r=Veykril
feat: make trait assoc items become inactive due to cfg

fixes #12394
2022-08-22 07:20:56 +00:00
bors
f27f4a9b55 Auto merge of #13078 - pymongo:master, r=Veykril
internal: remove unnecessary stream writer try_clone in lsp-server
2022-08-22 06:18:26 +00:00
wuaoxiang
2c0d2e719d internal: remove unnecessary stream writer try_clone in lsp-server 2022-08-22 11:25:21 +08:00
Dominik Gschwind
ac8cb8ce3b
Expect the test to panic by catching the unwind 2022-08-21 22:48:53 +02:00
bors
a670ff8884 Auto merge of #13074 - lowr:fix/method-resolution-with-impl-predicate, r=lowr
Consider bounds on inherent impl in method resolution

There are three type-related things we should consider in method resolution: `Self` type, receiver type, and impl bounds. While we check the first two and impl bounds on trait impls, we've been ignoring the impl bounds on inherent impls. With this patch rust-analyzer now takes them into account and is able to select the appropriate inherent method.

Resolves #5441
Resolves #12308
2022-08-21 12:21:33 +00:00
bors
e1623635aa Auto merge of #13071 - lnicola:ubuntu-20.04, r=lnicola
internal: Build release binaries on `ubuntu-20.04`

Ubuntu 18.04 is still available until December 1st, but will start failing from time to time, which is not something we want when building nightlies.
2022-08-21 11:24:38 +00:00
Ryo Yoshida
dd22aa48ba
Consider bounds on inherent impl in method resolution 2022-08-21 18:41:46 +09:00
Laurențiu Nicola
00b0089615 Switch to ubuntu-20.04 runners 2022-08-20 17:21:54 +03:00
Kartavya Vashishtha
23c00ed50d
fix: formatting 2022-08-20 13:44:01 +05:30
Kartavya Vashishtha
8f87fcb179
remove push_diagnostic methods
weren't used in the end
2022-08-20 13:30:25 +05:30