4570: Use Chalk's built-in impls r=matklad a=flodiebold
This contains two changes:
- Chalk has begun adding built-in representations of primitive types; use these in our type conversion logic. There's one somewhat 'iffy' part here, namely references; we don't keep track of lifetimes, but Chalk does, so it will expect a lifetime parameter on references. If we didn't provide that, it could cause crashes in Chalk code that expects the lifetime, so I rather hackily add an (always the same) lifetime placeholder during conversion. I expect that we'll fully switch to using Chalk's types everywhere before we add lifetime support, so I think this is the best solution for now.
- let Chalk know about well-known traits (from lang items), so it can apply its built-in impls.
Before:
```
Total expressions: 181485
Expressions of unknown type: 2940 (1%)
Expressions of partially unknown type: 2884 (1%)
Type mismatches: 901
Inference: 37.821210245s, 0b allocated 0b resident
Total: 53.399467609s, 0b allocated 0b resident
```
After:
```
Total expressions: 181485
Expressions of unknown type: 2923 (1%)
Expressions of partially unknown type: 2879 (1%)
Type mismatches: 734
Inference: 39.157752509s, 0b allocated 0b resident
Total: 54.110767621s, 0b allocated 0b resident
```
(I will start splitting up `chalk.rs` in a separate PR, since it's getting pretty big...)
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4571: KISS SourceChange r=matklad a=matklad
The idea behind requiring the label is a noble one, but we are not
really using it consistently anyway, and it should be easy to retrofit
later, should we need it.
bors r+
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
The idea behind requiring the label is a noble one, but we are not
really using it consistently anyway, and it should be easy to retrofit
later, should we need it.
4516: LSP: Two stage initialization r=kjeremy a=kjeremy
Fills in server information.
Derives CodeAction capabilities from the client. If code action literals
are unsupported we fall back to the "simple support" which just sends back
commands (this is already supported in our config). The difference being
that we did not adjust our server capabilities so that if the client was
checking for `CodeActionProvider: "true"` in the response that would have failed.
Part of #144Fixes#4130 (the specific case called out in that issue)
Co-authored-by: kjeremy <kjeremy@gmail.com>
This also changes our handiling of snippet edits on the client side.
`editor.insertSnippet` unfortunately forces indentation, which we
really don't want to have to deal with. So, let's just implement our
manual hacky way of dealing with a simple subset of snippets we
actually use in rust-analyzer
4506: Make `find_path_inner` a query r=matklad a=jonas-schievink
This eliminates the remaining performance problems in the "Implement default members" assist (at least those that I've found).
Closes https://github.com/rust-analyzer/rust-analyzer/issues/4498
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
4526: Use a flat play icon instead of the blue emoji with test code lens r=kjeremy a=aloucks
@lnicola
Restores this commit:
55e914a2a1
That was effectively wiped out by this code formatting commit:
dc217bdf903d445256fe
Co-authored-by: Aaron Loucks <aloucks@cofront.net>