Commit Graph

3837 Commits

Author SHA1 Message Date
bors[bot]
965363db15 Merge #1036
1036: Assist to flip equality (==) and negated equality (!=) operands. r=matklad a=marcogroppo

This PR adds an assist to flip the equality operands.

I hope this is the right way to do this (I'm a newbie...)

Fixes #1023.


Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
2019-03-25 07:04:47 +00:00
Ville Penttinen
b92fcbc956 Further improvements to the SourceChange convenience methods
Rename system_edit to file_system_edit, add more documentation, add
source_file_edit_from to create a SourceChange from `FileId` and `TextEdit`.
2019-03-25 09:03:10 +02:00
bors[bot]
219b157337 Merge #1035
1035: Add master branch docs build and publish r=matklad a=robojumper

Closes #1024.

Additional setup required: 

* The rust-analyzer travis repo needs an [environment variable](https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings) `DOCS_TOKEN` that will be used to publish docs to the `gh-pages` branch. This is a GitHub access token with the appropriate permissions to push to this repository. Travis will keep this a secret.
* In the GitHub repository settings, the GitHub pages source needs to be set to the `gh-pages` branch. This option will only appear once a branch is created with this exact name -- created either through the `deploy` step or manually.
* In the GitHub repository settings, a GitHub pages theme will need to be chosen. What theme to use is unimportant, but [you must choose a theme](https://github.community/t5/GitHub-Pages/Github-Pages-are-not-published-after-following-the-documentation/m-p/18676#M1398).

Docs are built as part of any rust build (on linux and windows, though all my Travis windows builds have timed out), but only published on master builds on linux.

The docs badge links to `https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/index.html` -- since this project is a cargo workspace, there isn't a global index page, hence just the link to an arbitrarily chosen crate. If this project had a canonical main crate with good documentation, one could link to that. All other crates are accessible through the sidebar.

Co-authored-by: robojumper <robojumper@gmail.com>
2019-03-25 06:54:15 +00:00
gfreezy
fd1585a071 inline immutable local varialbe 2019-03-25 10:18:20 +08:00
Marco Groppo
67055c47da Target only the actual operator.
Renamed `BinExpr::op()` and `PrefixExpr::op()` to `op_kind`.
Now `op()` returns the `SyntaxNode`.
2019-03-24 22:21:22 +01:00
bors[bot]
94cf23bfc4 Merge #1029
1029: Add impl members assist shold not copy docstrings, attrs and default methods r=matklad a=gfreezy

1. `add missing impl members` assist should not copy docstrings, attrs and default methods
2. Add `add impl default members` assist

fixed #1022

Co-authored-by: gfreezy <gfreezy@gmail.com>
2019-03-24 21:04:53 +00:00
Ville Penttinen
22e1c7a112 Add convenience functions to SourceChange for creating single edits 2019-03-24 22:53:41 +02:00
bors[bot]
449eea1161 Merge #1039
1039: Support references in higher-ranked trait bounds r=matklad a=vipentti

Fixes #1020

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-03-24 19:49:53 +00:00
Ville Penttinen
95505e80fc Support references in higher-ranked trait bounds
Fixes #1020
2019-03-24 20:51:55 +02:00
Marco Groppo
acac7415a6 Minor formatting changes. 2019-03-24 15:12:39 +01:00
Marco Groppo
481d3f56cf Assist to flip equality (==) and negative equality (!=) operands. 2019-03-24 14:42:11 +01:00
robojumper
022d88cf4c Add docs build 2019-03-23 22:03:41 +01:00
bors[bot]
18a8f48039 Merge #1031
1031: Move most things out of ra_ide_api_light r=matklad a=detrumi

This moves everything except `structure` out of `ra_ide_api_light`. So this PR and #1019 finish up #1009, whichever is merged last should probably remove the `ra_ide_api_light` crate.

Also, `LocalEdit` was removed since it wasn't used any more.

Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2019-03-23 17:25:40 +00:00
bors[bot]
2dfb47cc3d Merge #1032
1032: Fix apply_substs assertion failure r=matklad a=flodiebold

Fixes #1030.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-03-23 17:18:39 +00:00
Florian Diebold
dbfc68cea0 Fix apply_substs assertion failure
Fixes #1030.
2019-03-23 18:03:09 +01:00
Wilco Kusee
a3711e08dc Move highlighting and matching_brace 2019-03-23 17:34:49 +01:00
Wilco Kusee
a656b891fb Remove LocalEdit usage 2019-03-23 17:00:49 +01:00
gfreezy
02383b91d5 Add assist for adding default methods 2019-03-23 23:13:07 +08:00
gfreezy
d99ae9ba56 Add impl members assist shold not copy docstrings, attrs and default methods. 2019-03-23 22:49:20 +08:00
bors[bot]
5a6a3d0777 Merge #1027
1027: remove obsolete diagnostic r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-23 13:32:42 +00:00
Aleksey Kladov
46a21b07e6 remove obsolete diagnostic 2019-03-23 16:31:11 +03:00
bors[bot]
bce55c749a Merge #1026
1026: rename persistent hir database -> def database r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-23 12:44:47 +00:00
Aleksey Kladov
3f0cf6ebe1 rename persistent hir database -> def database 2019-03-23 15:44:24 +03:00
bors[bot]
331220fee2 Merge #1025
1025: Disable fork feature for proptest r=matklad a=detrumi



Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2019-03-23 12:09:07 +00:00
Wilco Kusee
0c15deac76 Move typing to ra_ide_api 2019-03-23 12:11:46 +01:00
Aleksey Kladov
d99abe4c25 document work list 2019-03-23 12:56:47 +03:00
bors[bot]
3d7a330f32 Merge #990
990: Forbid TODO markers on master branch r=matklad a=matklad

this makes TODO markers useful for things which you want to fix before sending a PR

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-23 08:07:30 +00:00
Aleksey Kladov
4fd8cfd6ad replace todo with fixme 2019-03-23 11:07:09 +03:00
Wilco Kusee
497934a7b4 Disable fork feature for proptest 2019-03-23 08:57:07 +01:00
Aleksey Kladov
2394a2ee35 forbid todo markers 2019-03-23 10:53:28 +03:00
bors[bot]
15189bc724 Merge #1021
1021: Wasm dependencies r=matklad a=detrumi

As a first step towards running RA on WASM (see #1007), this tweaks the dependencies somewhat so that projects built using `wasm-pack` can use `ra_ide_api` as a dependency.

There were two problems:
- use of undeclared type or module `MmapInner`
This error occurred because of the `memmap` crate, as a dependency of `fst`
Solution: specify `default-features = false` for the `fst` package (see https://github.com/BurntSushi/fst/issues/70)

- use of undeclared type or module `imp`
This happened in the `wait-timeout` crate ([which uses `Command` under the hood](https://github.com/alexcrichton/wait-timeout/issues/18)), a dependency of `rusty-fork` which is a dependency of `proptest`.
Solution: move `proptest` to dev-dependencies and add `#[cfg(test)]` to the `test_utils` crate.
**Edit:** Oh, that causes trouble with resolving the import when running the tests. Hmm...

Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2019-03-22 20:22:37 +00:00
Wilco Kusee
4e6d0933cc
Disable memmap feature in fst dependency 2019-03-22 21:22:03 +01:00
bors[bot]
3604f23e98 Merge #1012
1012: Move join_lines and test_utils to ra_ide_api r=matklad a=detrumi

Part of #1009 

Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2019-03-22 17:56:23 +00:00
Wilco Kusee
01bca7114c Simplify changes and fix tests 2019-03-22 17:12:32 +01:00
Wilco Kusee
9bd8336c51 Remove LocalEdit usage 2019-03-22 17:12:32 +01:00
Wilco Kusee
58e77660de Move join_lines to ra_ide_api 2019-03-22 17:12:31 +01:00
bors[bot]
6e324d38d6 Merge #1016
1016: Move folding_ranges to ra_ide_api r=pasa a=pasa

folding_ranges part of #1009 

Co-authored-by: Sergey Parilin <sergey.parilin@fxdd.com>
2019-03-22 13:57:07 +00:00
Sergey Parilin
47c501bcfb Move folding_ranges to ra_ide_api 2019-03-22 16:31:21 +03:00
bors[bot]
708a7d24c5 Merge #1017
1017: line_index and line_index_utils moved to ra_ide_api r=matklad a=pasa

line_index and line_index_utils for issue #1009 

Co-authored-by: Sergey Parilin <sergey.parilin@fxdd.com>
2019-03-22 12:38:59 +00:00
bors[bot]
6bc09e2ff8 Merge #1015
1015: Change primitive integers to have signedness and bitness r=matklad a=yanchith

Fixes #1004 

This creates enums: `Signedness`, `IntBitness` and `FloatBitness`, and condenses `UintTy` with `IntTy`, making use of the created enums. `FloatTy` is also changed from an enum into a struct containing `FloatBitness`.

`UncertainIntTy` and `UncertainFloatTy` now look much more similar.

`Ord` was removed from the types because `{u,i}size` aren't easily orderable with the rest. Fortunately this wasn't depended on anywhere.

Co-authored-by: yanchith <yanchi.toth@gmail.com>
2019-03-22 12:27:54 +00:00
Sergey Parilin
fda70badf8 line_index and line_index_utils moved to ra_ide_api 2019-03-22 15:24:43 +03:00
yanchith
504c8c7c2e Refactor primitive types into more orthogonal representation 2019-03-22 10:09:35 +01:00
bors[bot]
2a6544f906 Merge #1013
1013: Fuzz reparsing and fix found bugs r=matklad a=pcpthm

Add fuzz test for reparsing which:
- Checks reparsing doesn't panic and validate result syntax tree.
- Checks that incremental reparsing produces the same syntax tree as full reparse.
- Check for that errors are the same as full reparsing is disabled because errors are less important than syntax tree and produce failures which I couldn't figure out how to fix immediately (FIXME comment).

I guess the current input generation is inefficient but still found several bugs:
- Arithmetic overflow (negative result on an unsigned type). I changed the signature of `SyntaxError::add_offset` to solve this problem.
- When reparsing a leaf, the token of the leaf can be joined to the next characters. Such case was not considered.
- UNDERSCORE token was not produced when text length is exactly 1 (not a reparsing bug).
- When reparsing a block, *inner* curly braces should be balanced. i.e. `{}{}` is invalid.
- Effects of deleting newlines were not considered.

Co-authored-by: pcpthm <pcpthm@gmail.com>
2019-03-22 05:48:55 +00:00
bors[bot]
ed823cb38d Merge #1014
1014: Don't execute cargo watch when information message is dismissed r=matklad a=pcpthm

I think most information messages on `VSCode` have such behavior.

Co-authored-by: pcpthm <pcpthm@gmail.com>
2019-03-22 05:39:55 +00:00
bors[bot]
9c6c6a7cb5 Merge #988
988: Consolidate Ty variants into a new variant Ty::Apply r=matklad a=flodiebold

This gets us a lot closer to Chalk. It also introduces a lot of boilerplate, though, especially when matching :/ A lot of this can probably be refactored to be nicer, though.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-03-22 05:32:48 +00:00
pcpthm
1529eeb1b3 Don't execute cargo watch when popup is dismissed 2019-03-22 09:38:48 +09:00
pcpthm
bf8e7930da Fix reparsing failure when removing newline 2019-03-22 08:09:11 +09:00
pcpthm
edbc18516d Fix reparsing bug on "{}{}" 2019-03-22 08:09:11 +09:00
pcpthm
7669113e7c Completely ignore errors for reparse fuzz 2019-03-22 08:09:11 +09:00
pcpthm
c60ec02d75 Use template text to improve reparse fuzzing 2019-03-22 08:09:11 +09:00