Commit graph

926 commits

Author SHA1 Message Date
Aleksey Kladov
1a860dba38 simplify 2018-12-28 20:45:58 +03:00
Aleksey Kladov
5299a35e3d extend selection works with macros 2018-12-28 20:33:39 +03:00
bors[bot]
7a268b9b96 Merge #350
350: Super simple macro support r=matklad a=matklad

Super simple support for macros, mostly for figuring out how to fit them into the current architecture. Expansion is hard-coded and string based (mid-term, we should try to copy-paste macro-by-example expander from rustc). 

Ideally, we should handle

* highlighting inside the macro (done)
* extend selection inside the macro 
* completion inside the macro
* indexing structs, produced by the macro

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2018-12-28 16:17:19 +00:00
Aleksey Kladov
13631a2955 ⬆️ salsa 2018-12-28 19:10:31 +03:00
Aleksey Kladov
b911ee542b move macro to a separate module 2018-12-28 18:21:30 +03:00
Aleksey Kladov
fd33c89207 switch to FileRange 2018-12-28 18:17:43 +03:00
Aleksey Kladov
02924174bb introduce FileRange 2018-12-28 18:17:43 +03:00
Aleksey Kladov
d7440a5f49 highlight macro idents 2018-12-28 18:17:43 +03:00
Aleksey Kladov
406505e096 super simplistic macro expansion 2018-12-28 16:59:58 +03:00
Aleksey Kladov
072028e679 add macro-call node 2018-12-28 13:27:30 +03:00
Aleksey Kladov
dc496d0516 move highlightning to a separate file 2018-12-28 13:14:39 +03:00
dependabot[bot]
626badc30a
Bump serde from 1.0.82 to 1.0.83
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.82 to 1.0.83.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.82...v1.0.83)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-28 06:08:30 +00:00
Aleksey Kladov
bc833216d7 simplify 2018-12-28 00:08:33 +03:00
Aleksey Kladov
58a631f39a dead code 2018-12-28 00:01:56 +03:00
Aleksey Kladov
dddbac6877 remove FnId 2018-12-27 23:51:44 +03:00
Aleksey Kladov
e066050671 use names everywhere 2018-12-27 21:21:10 +03:00
Aleksey Kladov
63f54d234f dont leak Name details in testing 2018-12-27 21:02:08 +03:00
Aleksey Kladov
a9f55029b9 introduce known names 2018-12-27 20:26:15 +03:00
Aleksey Kladov
d963042ca9 introduce hir::Name 2018-12-27 20:07:21 +03:00
Aleksey Kladov
e4de2c8d7f add function to completion ctx 2018-12-27 17:33:52 +03:00
bors[bot]
7a1ed6400d Merge #341
341: Bump languageserver-types from 0.53.0 to 0.53.1 r=matklad a=dependabot[bot]

Bumps [languageserver-types](https://github.com/gluon-lang/languageserver-types) from 0.53.0 to 0.53.1.
<details>
<summary>Commits</summary>

- [`1a6c6c1`](1a6c6c18fc) (cargo-release) version 0.53.1
- [`5591192`](5591192047) Merge pull request [#88](https://github-redirect.dependabot.com/gluon-lang/languageserver-types/issues/88) from Xanewok/hover-clone
- [`c78120b`](c78120bf28) Add `Clone` impl for HoverContents and related
- See full diff in [compare view](https://github.com/gluon-lang/languageserver-types/compare/v0.53.0...v0.53.1)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=languageserver-types&package-manager=cargo&previous-version=0.53.0&new-version=0.53.1)](https://dependabot.com/compatibility-score.html?dependency-name=languageserver-types&package-manager=cargo&previous-version=0.53.0&new-version=0.53.1)

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)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<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 cancel merge` will cancel a previously requested merge
- `@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
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot[bot] <support@dependabot.com>
2018-12-27 13:38:15 +00:00
dependabot[bot]
74f342648d
Bump languageserver-types from 0.53.0 to 0.53.1
Bumps [languageserver-types](https://github.com/gluon-lang/languageserver-types) from 0.53.0 to 0.53.1.
- [Release notes](https://github.com/gluon-lang/languageserver-types/releases)
- [Changelog](https://github.com/gluon-lang/languageserver-types/blob/master/release.toml)
- [Commits](https://github.com/gluon-lang/languageserver-types/compare/v0.53.0...v0.53.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-27 13:15:04 +00:00
dependabot[bot]
4017966a0b
Bump parking_lot from 0.6.4 to 0.7.0
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.6.4 to 0.7.0.
- [Release notes](https://github.com/Amanieu/parking_lot/releases)
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-27 13:14:24 +00:00
bors[bot]
d8bfad9e92 Merge #343 #344
343: Bump arrayvec from 0.4.9 to 0.4.10 r=matklad a=dependabot[bot]

Bumps [arrayvec](https://github.com/bluss/arrayvec) from 0.4.9 to 0.4.10.
<details>
<summary>Commits</summary>

- [`21661fa`](21661facf8) 0.4.10
- [`06930d2`](06930d27ce) FIX: Remove unused Copy/Clone for MaybeUninit
- [`85d9a06`](85d9a06a62) FIX: Use repr(C) MaybeUninit after discussion with RalfJung
- See full diff in [compare view](https://github.com/bluss/arrayvec/compare/0.4.9...0.4.10)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=arrayvec&package-manager=cargo&previous-version=0.4.9&new-version=0.4.10)](https://dependabot.com/compatibility-score.html?dependency-name=arrayvec&package-manager=cargo&previous-version=0.4.9&new-version=0.4.10)

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)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<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 cancel merge` will cancel a previously requested merge
- `@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
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

344: Bump itertools from 0.7.11 to 0.8.0 r=matklad a=dependabot[bot]

Bumps [itertools](https://github.com/bluss/rust-itertools) from 0.7.11 to 0.8.0.
<details>
<summary>Commits</summary>

- [`cd0602a`](cd0602addc) 0.8.0
- [`5a8f2fd`](5a8f2fd5ed) MAINT: Require Rust 1.24 as minimum version
- [`4986d92`](4986d92d7f) DOC: Minor edits to module docs
- [`01f15a0`](01f15a0910) Merge [#288](https://github-redirect.dependabot.com/bluss/rust-itertools/issues/288)
- [`883d40a`](883d40a6ef) map_into method
- [`3bf265d`](3bf265d5b7) Merge pull request [#321](https://github-redirect.dependabot.com/bluss/rust-itertools/issues/321) from JohnHeitmann/master
- [`e820996`](e820996f64) Document the trait extension behavior of Itertools a bit more clearly
- [`44c9654`](44c9654fdb) Merge pull request [#318](https://github-redirect.dependabot.com/bluss/rust-itertools/issues/318) from bluss/std-deprecations
- [`d2e254f`](d2e254f22f) API: Fix the mystery deprecation message for Step
- [`602f2f6`](602f2f675e) API: Deprecate .foreach() in favour of std's .for_each()
- Additional commits viewable in [compare view](https://github.com/bluss/rust-itertools/compare/0.7.11...0.8.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=itertools&package-manager=cargo&previous-version=0.7.11&new-version=0.8.0)](https://dependabot.com/compatibility-score.html?dependency-name=itertools&package-manager=cargo&previous-version=0.7.11&new-version=0.8.0)

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)

---

**Note:** This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking `Bump now` in your [Dependabot dashboard](https://app.dependabot.com).

<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 cancel merge` will cancel a previously requested merge
- `@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
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)

Finally, you can contact us by mentioning @dependabot.

</details>

Co-authored-by: dependabot[bot] <support@dependabot.com>
2018-12-27 13:06:30 +00:00
dependabot[bot]
a400444e33
Bump itertools from 0.7.11 to 0.8.0
Bumps [itertools](https://github.com/bluss/rust-itertools) from 0.7.11 to 0.8.0.
- [Release notes](https://github.com/bluss/rust-itertools/releases)
- [Commits](https://github.com/bluss/rust-itertools/compare/0.7.11...0.8.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-27 12:32:23 +00:00
dependabot[bot]
6fb53caea5
Bump arrayvec from 0.4.9 to 0.4.10
Bumps [arrayvec](https://github.com/bluss/arrayvec) from 0.4.9 to 0.4.10.
- [Release notes](https://github.com/bluss/arrayvec/releases)
- [Commits](https://github.com/bluss/arrayvec/compare/0.4.9...0.4.10)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2018-12-27 12:32:18 +00:00
bors[bot]
e422c2e2f4 Merge #325
325: implement translate_offset_with_edit r=matklad a=vemoo

- Implement `translate_offset_with_edit` to resolve #105 
- Add proptest impls for text, offsets and edits and use them in tests for `translate_offset_with_edit` and `LineIndex`
- Added benchmark for `translate_offset_with_edit`

Co-authored-by: Bernardo <berublan@gmail.com>
2018-12-27 12:19:19 +00:00
Aleksey Kladov
49b0fe20ab fix suffix ranges 2018-12-27 15:10:30 +03:00
Aleksey Kladov
a912b261d3 dump validation errors 2018-12-27 15:07:51 +03:00
Aleksey Kladov
359e70d1b2 support literal suffixes 2018-12-27 15:03:18 +03:00
Aleksey Kladov
73ded3c63c dedupe literal parsers 2018-12-27 14:42:46 +03:00
Aleksey Kladov
8c2c1bf9eb check edits in diagnostics 2018-12-27 13:35:08 +03:00
bors[bot]
1d6dcef5c5 Merge #332
332: Struct types r=matklad a=flodiebold

Infer types for struct fields, and add basic field completions. There's also some code for enums, but I focused on getting structs working.

There's still ways to go before this becomes useful: There's no autoderef (or even reference types) and no inference for `self`, for example.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2018-12-27 10:08:34 +00:00
Aleksey Kladov
93996fecdc add cancelation module & cancelation backtraces 2018-12-27 13:03:32 +03:00
Aleksey Kladov
62c40b0e91 fix the test 2018-12-27 12:54:59 +03:00
Aleksey Kladov
4e2dffd798 expose make_pub_crate action 2018-12-27 12:35:40 +03:00
gfreezy
cd60998b9b fix use std::{self} 2018-12-27 00:51:27 +08:00
Florian Diebold
bc745a1396 Resolve field types lazily
I.e. not already when getting the HIR for the struct.
2018-12-25 21:40:33 +01:00
Bernardo
1cda43aafd test code and dependency cleanup 2018-12-25 21:26:36 +01:00
Florian Diebold
cdca397061 Add a hir::TypeRef as an intermediate between ast::TypeRef and ty::Ty 2018-12-25 21:14:13 +01:00
Bernardo
e9c186e48a change to TextEdit to avoid allocation and sort
rename newline to step where applicable
2018-12-25 20:49:18 +01:00
Florian Diebold
2870effd5c Implement reference / pointer types
- parse them
 - infer types of & and * expressions
2018-12-25 20:36:06 +01:00
Bernardo
863ed19946 remove benchmark and simplify tests 2018-12-25 20:14:27 +01:00
Bernardo
6b2da4e547 use new translate_offset_with_edit for TryConvWith
doc comments
2018-12-25 20:06:49 +01:00
Bernardo
aff0124b37 add line_index proptest 2018-12-25 20:03:14 +01:00
Bernardo
c886b72dab make criterion args work, small simplification 2018-12-25 20:03:14 +01:00
Bernardo
dc2afae991 fix arbitrary offset generation, col translation working 2018-12-25 20:03:14 +01:00
Bernardo
5c8525ce4a column translation implemented but not quite working yet 2018-12-25 20:03:14 +01:00
Bernardo
36f2b1f3b9 iterate over Steps which are either, newlines or multibyte chars 2018-12-25 20:03:14 +01:00
Bernardo
1c44ba0f04 simplify newline check with macro 2018-12-25 20:03:14 +01:00