Go to file
bors[bot] 93527b5f19
Merge #3574
3574: Fix completion of HashMap::new r=matklad a=flodiebold

The `ty` function in code_model returned the type with placeholders for type parameters. That's nice for printing, but not good for completion, because placeholders won't unify with anything else: So the type we got for `HashMap` was `HashMap<K, V, T>`, which doesn't unify with `HashMap<?, ?, RandomState>`, so the `new` method wasn't shown.

Now we instead return `HashMap<{unknown}, {unknown}, {unknown}>`, which does unify with the impl type. Maybe we should just expose this properly as variables though, i.e. we'd return something like `exists<type, type, type> HashMap<?0, ?1, ?2>` (in Chalk notation). It'll make the API more complicated, but harder to misuse. (And it would handle cases like `type TypeAlias<T> = HashMap<T, T>` more correctly.)

The `ty` function for fields was used for signature help, so there we want placeholders so that it looks nicer, I think. Hence I renamed it to `signature_ty`.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-03-13 12:05:02 +00:00
.cargo Alternative quite tests alias 2019-11-20 22:22:32 +03:00
.github Set extension version during release 2020-03-09 14:24:00 +01:00
.vscode Rename the binary to rust-analyzer 2020-02-18 12:33:16 +01:00
crates Fix completion of HashMap::new 2020-03-13 13:04:32 +01:00
docs Fix docs 2020-03-12 18:04:11 +01:00
editors/code Simpler deserialization 2020-03-12 18:01:36 +01:00
xtask Restore cargo-fmt gating 2020-03-13 12:54:32 +01:00
.gitattributes Set text to autodetect and use LF 2019-11-14 19:44:37 -05:00
.gitignore cargo xtask dist 2020-03-04 18:18:20 +01:00
bors.toml Gate CI on windows build 2020-01-26 14:15:57 +01:00
Cargo.lock fix issue 3444 2020-03-12 17:16:28 -07:00
Cargo.toml Extend analysis-stats a bit 2020-02-15 18:04:01 +01:00
LICENSE-APACHE
LICENSE-MIT
README.md Link proper docs from readme 2020-03-05 17:26:47 +01:00
rustfmt.toml

rust-analyzer logo

rust-analyzer is an experimental modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust. If you want to get involved, check the rls-2.0 working group:

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0

Work on rust-analyzer is sponsored by

Ferrous Systems

Quick Start

https://rust-analyzer.github.io/manual.html#installation

Documentation

If you want to contribute to rust-analyzer or are just curious about how things work under the hood, check the ./docs/dev folder.

If you want to use rust-analyzer's language server with your editor of choice, check the manual folder. It also contains some tips & tricks to help you be more productive when using rust-analyzer.

Getting in touch

We are on the rust-lang Zulip!

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0

License

Rust analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.