Commit Graph

22901 Commits

Author SHA1 Message Date
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
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
Kartavya Vashishtha
87b779756c
make impl and trait inactive diagnostics work 2022-08-20 13:28:43 +05:30
bors
099f911b4a Auto merge of #13069 - lnicola:bump-deps, r=lnicola
minor: Bump deps
2022-08-19 18:37:54 +00:00
Laurențiu Nicola
e5d3ac58b3 Bump notify 2022-08-19 21:37:05 +03:00
Laurențiu Nicola
c3bb7bfc28 Bump chalk 2022-08-19 21:33:28 +03:00
Laurențiu Nicola
f5f689588f Bump deps 2022-08-19 21:33:09 +03:00
bors
c32ab970e3 Auto merge of #13065 - RalfJung:override-command-docs, r=Veykril
document interaction of checkOnSave.overrideCommand and multiple linked projects

Cc https://github.com/rust-lang/rust-analyzer/issues/10793

r? `@Veykril`
2022-08-19 14:52:26 +00:00
Ralf Jung
c5455d1af3 explain how to re-generate the package.json 2022-08-19 08:58:08 -04:00
Ralf Jung
4af9829dcf document interaction of checkOnSave.overrideCommand and multiple linked projects 2022-08-19 08:57:22 -04:00
bors
2f02ea03b0 Auto merge of #13041 - DorianListens:dscheidt/gen-fn-self-assoc-2, r=Veykril
feat: Generate static method using Self::assoc() syntax

This change improves the `generate_function` assist to support generating static methods/associated functions using the `Self::assoc()` syntax. Previously, one could generate a static method, but only when specifying the type name directly (like `Foo::assoc()`). After this change, `Self` is supported as well as the type name.

Fixes #13012
2022-08-19 10:57:02 +00:00
bors
62c3107065 Auto merge of #13061 - ice1k:master, r=Veykril
feat: Improved inline_call to replace `Self`

Fixes #13060
2022-08-19 10:47:15 +00:00
bors
a2ad3d0669 Auto merge of #13064 - Veykril:rustfmt-err, r=Veykril
Log rustfmt parsing errors as warnings

We unconditionally pass an edition parameter to rustfmt, for some crates
this might fail rustfmt so instead of swallowing the error, at least Log
it on a level that is logged by default so users won't be completely
confused about it.
See for context https://github.com/rust-lang/rust-analyzer/issues/10209

Closes https://github.com/rust-lang/rust-analyzer/issues/10209
2022-08-19 07:23:01 +00:00
Lukas Wirth
638755a771 Log rustfmt parsing errors as warnings
We unconditionally pass an edition parameter to rustfmt, for some crates
this might fail rustfmt so instead of swallowing the error, at least Log
it on a level that is logged by default so users won't be completely
confused about it.
See for context https://github.com/rust-lang/rust-analyzer/issues/10209

Closes https://github.com/rust-lang/rust-analyzer/issues/10209
2022-08-19 09:22:34 +02:00
bors
04c487dd51 Auto merge of #13063 - Veykril:stop-flycheck, r=Veykril
Implement lsp extension for cancelling running flychecks

Fixes https://github.com/rust-lang/rust-analyzer/issues/4828
2022-08-19 06:58:52 +00:00
Lukas Wirth
45b7b6a60a Implement lsp extension for cancelling running flychecks 2022-08-19 08:54:53 +02:00
ice1000
5a6c51ebb8 fix: use functional programming 2022-08-19 01:22:43 +00:00
ice1000
b6fe46055b feat: Improved inline_call to replace Self 2022-08-19 01:06:00 +00:00
Dorian Scheidt
48ea3825b8 Introduce and use get_fn_target_info 2022-08-18 18:39:42 -05:00
Dorian Scheidt
d8e7419c64 Generate and use TargetInfo::new 2022-08-18 18:32:35 -05:00
Dorian Scheidt
2e4a4f1a9c Cleanup inline 2022-08-18 18:28:43 -05:00
Dorian Scheidt
96c04c5e1c inline assoc_fn_target 2022-08-18 18:28:14 -05:00
Dorian Scheidt
2086c48cff Remove mut out params via assoc_fn_target_info 2022-08-18 18:26:54 -05:00
Dorian Scheidt
e27af5fae3 Reorder args with flip_comma 2022-08-18 18:21:58 -05:00
Dorian Scheidt
e513d7b504 Replace tuple with TargetInfo struct 2022-08-18 18:20:06 -05:00
Dorian Scheidt
30eabeb95d extract fn_target_info 2022-08-18 18:14:51 -05:00
Dorian Scheidt
6130860789 use fn_name instead of name_ref.text() 2022-08-18 18:12:53 -05:00
Dorian Scheidt
d39677c1eb Rename static_method_target -> assoc_fn_target 2022-08-18 18:10:37 -05:00
bors
917bd68b37 Auto merge of #13039 - davidbarsky:davidbarsky/remove-used-nightly-checking-code, r=Veykril
chore: remove unused `currentExtensionIsNightly()` in `config.ts`

I was debugging an unrelated issue in rust-analyzer, but came across this unused code and figured that it's fine to send a fully red PR :)
2022-08-18 16:06:18 +00:00