Ville Penttinen [Sun, 3 Mar 2019 20:03:37 +0000 (22:03 +0200)]
Allow syntax tree to update when changing files
Previously when using the file based syntax tree, it would not update until a
change had been made in the new file. Now we automatically update the syntax
tree to match the current file.
Ville Penttinen [Sun, 3 Mar 2019 19:21:40 +0000 (21:21 +0200)]
Add vscode support for range in SyntaxTreeParams
This enables the client to use a command to either show the live-updating
version of the syntax tree for the current file. Or optionally when a selected
range is provided, we then provide a snapshot of the syntax tree for the range.
bors[bot] [Sun, 3 Mar 2019 11:44:01 +0000 (11:44 +0000)]
Merge #917
917: Trait tests r=flodiebold a=flodiebold
This adds a bunch of basic tests for trait functionality, just to outline what seems like the first goals for that ;)
It also changes the display of `Ty::Unknown` to `{unknown}`, since `[unknown]` could be confused with a slice, and fixes an error in the emacs runnables code.
bors[bot] [Wed, 27 Feb 2019 11:09:47 +0000 (11:09 +0000)]
Merge #903
903: Work around for issue in vscode reporting a failure in request r=matklad a=vipentti
vscode would report "A request has failed" when it got "Content modified"
message and this would cause a pop-up to appear. This works around the issue by
returning an "empty" response that vscode can ignore.
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
Ville Penttinen [Wed, 27 Feb 2019 10:49:04 +0000 (12:49 +0200)]
Work around for issue in vscode reporting a failure in request
vscode would report "A request has failed" when it got "Content modified"
message and this would cause a pop-up to appear. This works around the issue by
returning an "empty" response that vscode can ignore.
Ville Penttinen [Tue, 26 Feb 2019 09:47:13 +0000 (11:47 +0200)]
Use TypeAscriptionOwner
This replaces places where we would use node + node.type_ref() with things that
have an ascribed type, with using the TypeAscriptionOwner as the trait bound so
we can simply pass the node.
bors[bot] [Tue, 26 Feb 2019 08:49:17 +0000 (08:49 +0000)]
Merge #899
899: Change default value of highlightingOn to false r=matklad a=vipentti
This changes the default value for the vscode setting `rust-analyzer.highlightingOn` to `false`. Since currently the highlighting only supports Zenburn, which people may not be using, I think it makes sense to have this feature disabled by default.
This was discussed in #896
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
bors[bot] [Mon, 25 Feb 2019 12:03:57 +0000 (12:03 +0000)]
Merge #897
897: Add basic const/static type inference r=flodiebold a=vipentti
This adds basic const/static type inference discussed in #887.
Currently the inference does not work for const/static declared inside a block. In addition the inference does not work inside the bodies of const/static.
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
bors[bot] [Sun, 24 Feb 2019 20:08:10 +0000 (20:08 +0000)]
Merge #892
892: Type aliases r=matklad a=flodiebold
This implements type aliases (i.e. `type` definitions).
There's just one snag: handling recursion. E.g. `type Foo = Foo` makes type inference panic with a query cycle. I think the best way to handle this would be if Salsa provided the ability to catch cycle errors? It seems that there's some work underway to support this [here](https://github.com/salsa-rs/salsa/issues/6) and [here](https://github.com/salsa-rs/salsa/pull/147). Should we wait for this? I don't see a good way to handle this without help from Salsa.
bors[bot] [Sun, 24 Feb 2019 12:52:44 +0000 (12:52 +0000)]
Merge #889
889: Refactor assits r=matklad a=matklad
* assign unique IDs to assists so that clients could do custom stuff
* specify kinds for assists,
* make introduce_variable a `refactoring.extract` and make it available only when expression is selected
* introduce marks to assists
bors[bot] [Sat, 23 Feb 2019 14:48:54 +0000 (14:48 +0000)]
Merge #884
884: Split ty.rs into several modules r=matklad a=flodiebold
It was just getting too big. We now have:
- ty: the `Ty` enum and helpers
- ty::infer: actual type inference
- ty::lower: lowering from HIR to `Ty`
- ty::op: helpers for binary operations, currently
Florian Diebold [Sat, 23 Feb 2019 14:24:07 +0000 (15:24 +0100)]
Split ty.rs into several modules
It was just getting too big. We now have:
- ty: the `Ty` enum and helpers
- ty::infer: actual type inference
- ty::lower: lowering from HIR to `Ty`
- ty::op: helpers for binary operations, currently