Commit graph

4457 commits

Author SHA1 Message Date
bors[bot]
8bb81d7418 Merge #1524
1524: make Parse fields private r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-07-12 16:42:06 +00:00
Aleksey Kladov
deab4caa7b make Parse fields private
this is in preparation for the new rowan API
2019-07-12 19:41:13 +03:00
bors[bot]
2e466bb365 Merge #1523
1523: account for dependencies when showing memory usage r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-07-12 15:05:28 +00:00
Aleksey Kladov
e40494c6c1 account for dependencies when showing memory usage 2019-07-12 18:04:48 +03:00
bors[bot]
48f90a9e3f Merge #1522
1522: Bump lodash from 4.17.11 to 4.17.14 in /editors/code r=matklad a=dependabot[bot]

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14.
<details>
<summary>Commits</summary>

- [`be87d30`](be87d30394) Bump to v4.17.14.
- [`a6fe6b1`](a6fe6b1e17) Rebuild lodash and docs.
- [`e371828`](e37182845f) Bump to v4.17.13.
- [`357e899`](357e899e68) Rebuild lodash and docs.
- [`fd9a062`](fd9a062d57) Bump to v4.17.12.
- [`e77d681`](e77d68121f) Rebuild lodash and docs.
- [`629d186`](629d186579) Update OpenJS references.
- [`2406eac`](2406eac542) Fix minified build.
- [`17a34bc`](17a34bc585) Fix test bootstrap for core build.
- [`53838a3`](53838a38f8) Fix tests in older browsers.
- Additional commits viewable in [compare view](https://github.com/lodash/lodash/compare/4.17.11...4.17.14)
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=lodash&package-manager=npm_and_yarn&previous-version=4.17.11&new-version=4.17.14)](https://help.github.com/articles/configuring-automated-security-fixes)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2019-07-12 06:40:25 +00:00
dependabot[bot]
83ab841bfa
Bump lodash from 4.17.11 to 4.17.14 in /editors/code
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.14.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.14)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-11 23:44:16 +00:00
bors[bot]
fa3716efe6 Merge #1520
1520: Ignore workspace/didChangeConfiguration notifications. r=matklad a=bolinfest

If the client happens to send a `workspace/didChangeConfiguration`
notification, it is nicer if rust-analyzer can just ignore it rather than
crash with an "unhandled notification" error.

Co-authored-by: Michael Bolin <bolinfest@gmail.com>
2019-07-11 09:13:10 +00:00
Michael Bolin
e81a47b8eb Remove executeCommandProvider: apply_code_action.
This appears to have been introduced ages ago in
be742a5877
but has since been removed.

As it stands, it is problematic if multiple instances of the
rust-analyzer LSP are launched during the same VS Code session because
VS Code complains about multiple LSP servers trying to register the
same command.

Most LSP servers workaround this by parameterizing the command by the
process id. For example, this is where `rls` does this:

ff0b9057c8/rls/src/server/mod.rs (L413-L421)

Though `apply_code_action` does not seems to be used, so it seems better
to delete it than to parameterize it.
2019-07-10 22:49:35 -07:00
Michael Bolin
a814883cd4 Ignore workspace/didChangeConfiguration notifications. 2019-07-10 20:56:16 -07:00
bors[bot]
46d7b08c5f Merge #1519
1519: Move whitespace manipulation inside AstEditor r=matklad a=viorina



Co-authored-by: Ekaterina Babshukova <ekaterina.babshukova@yandex.ru>
2019-07-10 19:06:44 +00:00
Ekaterina Babshukova
895597d567 move whitespace manipulation inside AstEditor 2019-07-10 22:03:00 +03:00
bors[bot]
82c3fe7d13 Merge #1518
1518: Remove a fixme r=matklad a=killercup

Just saw the new release of SmolStr and was reminded of this FIXME I added :)

Co-authored-by: Pascal Hertleif <pascal@technocreatives.com>
2019-07-10 16:59:44 +00:00
Pascal Hertleif
6e87065968 Make clippy a bit happier
Random drive-by fix. I honestly blame rust-analyzer itself on this,
because I set its watch mode to use `cargo clippy` 🤷
2019-07-10 17:05:39 +02:00
Pascal Hertleif
d0ff53de2d Resolve a FIXME
Now that we are using a newer smol_str release this can be simplified :)
2019-07-10 17:04:38 +02:00
Aleksey Kladov
61135d4d4d fix profile name 2019-07-09 11:13:15 +03:00
bors[bot]
f59cd1a4a0 Merge #1515
1515: Trait environment r=matklad a=flodiebold

This adds the environment, i.e. the set of `where` clauses in scope, when solving trait goals. That means that e.g. in
```rust
fn foo<T: SomeTrait>(t: T) {}
```
, we are able to complete methods of `SomeTrait` on the `t`. This affects the trait APIs quite a bit (since every method that needs to be able to solve for some trait needs to get this environment somehow), so I thought I'd do it rather sooner than later ;)

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-07-09 07:50:18 +00:00
bors[bot]
35f28c538a Merge #1512
1512: Infer ? operator r=unrealhoang a=unrealhoang

Logical continuation of https://github.com/rust-analyzer/rust-analyzer/pull/1501

cc https://github.com/rust-analyzer/rust-analyzer/issues/1426

Co-authored-by: Unreal Hoang <unrealhoang@gmail.com>
2019-07-09 00:41:03 +00:00
Unreal Hoang
9a0d4b16b7
beautify tests 2019-07-09 09:27:03 +09:00
Florian Diebold
9afbf2dff4 Unify normalize and implements to simplify code 2019-07-08 21:47:37 +02:00
Florian Diebold
15862fc041 Use environment for associated type normalization as well 2019-07-08 21:20:17 +02:00
Florian Diebold
b1b12072ed Start handling environment in trait resolution
I.e. if we are inside a function with some where clauses, we assume these where
clauses hold.
2019-07-08 21:20:17 +02:00
Florian Diebold
638100dc8b Refactor a bit & introduce Environment struct 2019-07-08 21:20:17 +02:00
bors[bot]
ecdc6cdce9 Merge #1514
1514: Better completions for floating point primitive types r=flodiebold a=marcogroppo

After #1499 completions for (some of) the inherent methods of `f32` and `f64` are now working.
Unfortunately during method resolution we were only looking for the `f32` and `f64` language items defined in `libcore` and we were ignoring the methods defined in `libstd`.

This PR fixes this issue.

Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
2019-07-08 19:18:49 +00:00
Marco Groppo
95d78a8d8d Look for the fXX_runtime lang items during method resolution. 2019-07-08 20:37:29 +02:00
Unreal Hoang
741fc8fbfc
use namespaced consts for KnownName 2019-07-09 01:00:47 +09:00
bors[bot]
3210002201 Merge #1513
1513: Remove unused dependencies r=matklad a=sinkuu



Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
2019-07-08 15:44:33 +00:00
Shotaro Yamada
a426de60ad Remove unused dependencies 2019-07-09 00:28:00 +09:00
Unreal Hoang
944f71afc6
projection over std::ops::Try::Ok to infer try/? 2019-07-09 00:19:09 +09:00
bors[bot]
64b718bff7 Merge #1511
1511: Send old-style responsed to goto definition unless the client explicitelly opts in r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-07-08 12:32:16 +00:00
Aleksey Kladov
e075e096cf don't send LocationLink unless the client opts-in
closes #1474
2019-07-08 14:09:38 +03:00
Aleksey Kladov
b042faeb64 simplify 2019-07-08 13:47:02 +03:00
Aleksey Kladov
227bc0b6d4 add try_conv_with_to_vec 2019-07-08 13:39:16 +03:00
bors[bot]
5ce2b4819e Merge #1504
1504: Simplify LSP handlers r=matklad a=kjeremy

Takes advantage of protocol inheritance via composition and simplifies some responses via the `From`/`Into` traits.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-07-08 09:55:23 +00:00
bors[bot]
5b19825e37 Merge #1507
1507: Constify KnownName's r=matklad a=mominul

Closes #1503 

Co-authored-by: Muhammad Mominul Huque <mominul2082@gmail.com>
2019-07-08 08:29:19 +00:00
Muhammad Mominul Huque
09b72489dd
cargo format 2019-07-08 04:09:35 +06:00
bors[bot]
a4316d6c63 Merge #1506
1506: Update memchr r=kjeremy a=kjeremy

New release has some performance improvements.

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-07-07 21:45:19 +00:00
Jeremy Kolb
8d3d6d5a84 Update memchr 2019-07-07 17:42:24 -04:00
Muhammad Mominul Huque
012fec54dc
Constify KnownName's 2019-07-08 03:29:38 +06:00
Jeremy Kolb
9c6e93cd6c Simplify responses by using into() 2019-07-07 17:28:21 -04:00
Jeremy Kolb
3f44aaf363 use flatten branch of lsp-types 2019-07-07 14:13:13 -04:00
bors[bot]
1b38ca3b87 Merge #1501
1501: Infer for loop variable r=flodiebold a=unrealhoang

My take on https://github.com/rust-analyzer/rust-analyzer/issues/1425

Co-authored-by: Unreal Hoang <unrealhoang@gmail.com>
2019-07-07 15:20:09 +00:00
bors[bot]
6c31f5b0a7 Merge #1499
1499: processing attribute #[path] of module  r=matklad a=andreevlex

support two cases
- simple name file `foo.rs`
- declaration in mod.rs

#1211 

Co-authored-by: Alexander Andreev <andreevlex.as@gmail.com>
2019-07-07 13:48:58 +00:00
Unreal Hoang
f7cd40d830
add projection to infer for loop variable 2019-07-07 22:26:51 +09:00
Alexander Andreev
1c582be63b Moved module resolution test in mods.rs 2019-07-07 16:06:54 +03:00
bors[bot]
89bfc59f1a Merge #1502
1502: Use inline snapshots in compelte_postfix r=matklad a=funkill

Relates to #1127

Co-authored-by: funkill2 <funkill2@gmail.com>
2019-07-07 11:24:35 +00:00
funkill2
ca42f621c6
inline snapshot in complete_postfix 2019-07-07 13:52:25 +03:00
Alexander Andreev
8579a9b834 Added support attribute path in resolusion module fn 2019-07-06 21:54:21 +03:00
bors[bot]
fee552d487 Merge #1497
1497: bump regex r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-07-06 17:50:03 +00:00
Jeremy Kolb
57607d6ee4 bump regex 2019-07-06 13:48:11 -04:00
bors[bot]
9dc9a7a3e2 Merge #1496
1496: Add trait obligations for where clauses when calling functions/methods r=matklad a=flodiebold

E.g. if we call `foo<T: Into<u32>>(x)`, that adds an obligation that `x: Into<u32>`, etc., which sometimes allows type inference to make further progress.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-07-06 16:28:42 +00:00