about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2019-03-03Allow syntax tree to update when changing filesVille Penttinen-17/+26
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.
2019-03-03Rename syntaxtree text provider to SyntaxTreeContentProviderVille Penttinen-13/+11
2019-03-03Add vscode support for range in SyntaxTreeParamsVille Penttinen-11/+41
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.
2019-03-03Add optional range parameter to SyntaxTreeParamsVille Penttinen-5/+148
When range is provided, instead of showing the syntax for the whole file, we'll show the syntax tree for the given range.
2019-03-03Merge #917bors[bot]-1291/+1286
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. Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-03-03Inline type inference test snapshotsFlorian Diebold-1504/+1096
2019-03-03emacs: Fix (void-variable rust-analyzer--last-runnable)Florian Diebold-1/+1
2019-03-03Represent unknown types as {unknown} instead of [unknown]Florian Diebold-172/+172
Since the latter could actually be a real type...
2019-03-02Add a bunch of tests for type inference involving traitsFlorian Diebold-0/+403
None of them works correctly yet, of course.
2019-03-02Merge #908bors[bot]-8/+27
908: Enable markup for hover on expressions which resolve using type_of r=matklad a=vipentti This adds highlighting when hovering over items which are resolved using `type_of`. This adds basic highlighting, discussed in #904. Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-03-02Merge #915bors[bot]-133/+108
915: Bring BodySyntaxMapping in line with other source-map instances r=flodiebold a=matklad * rename to SourceMap * don't store the actual body inline, just return a pair r? @flodiebold Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-02remove commentAleksey Kladov-1/+0
2019-03-02remove second way to get the bodyAleksey Kladov-5/+1
2019-03-02rename syntax_mapping as wellAleksey Kladov-19/+18
2019-03-02Merge #914bors[bot]-28/+1
914: A bit of cleanup in ty.rs r=flodiebold a=flodiebold Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-03-02A bit of cleanup in ty.rsFlorian Diebold-28/+1
2019-03-02align lower module query namesAleksey Kladov-23/+15
2019-03-02rename scopesAleksey Kladov-9/+9
2019-03-02rename to source_mapAleksey Kladov-17/+13
2019-03-02dont store body inside source mapAleksey Kladov-61/+54
2019-03-02rename syntax-mapping -> source-mapAleksey Kladov-32/+32
2019-02-28Merge #910bors[bot]-1/+1
910: Update hover message since we do support globs r=matklad a=kjeremy #909 drew attention to this. Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-28Update hover message since we do support globskjeremy-1/+1
2019-02-28add syntax-trees videoAleksey Kladov-0/+3
2019-02-28Enable markup for hover on expressions which resolve using type_ofVille Penttinen-8/+27
This adds highlighting when hovering over items which are resolved using `type_of`.
2019-02-27Merge #906bors[bot]-3/+124
906: Add support for goto definition and hover for struct fields r=matklad a=vipentti This works partially towards fixing #512 Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-27Enable hover support for NamedFieldDefsVille Penttinen-3/+79
Additionally add type ascription for const and statics as well.
2019-02-27Allow goto-definition to work for named fields in struct initializerVille Penttinen-0/+45
Now goto definition should work when done on a named field in a struct initializer.
2019-02-27Merge #905bors[bot]-61/+63
905: Update deps r=kjeremy a=kjeremy Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-27Fix the buildkjeremy-1/+3
2019-02-27Update depskjeremy-60/+60
2019-02-27Merge #900bors[bot]-61/+72
900: Add new trait ast::TypeAscriptionOwner r=vipentti a=vipentti This trait should be implemented for nodes which have an ascribed type, e.g. thing : Type. Such as let, const, static, param, named struct fields. In addition, we update some places where previously we used node + node.type_ref() with `TypeAscriptionOwner` in the trait bounds. Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-27Remove `TypeRef` from item opts which implement TypeAscriptionOwnerVille Penttinen-43/+24
2019-02-27Merge #901bors[bot]-21/+179
901: Add basic support for showing fn signature when hovering r=matklad a=vipentti This adds basic support for displaying function signature when hovering over a usage of a function. Additionally refactored `hover` to return `HoverResult` to ease with testing and in general to be more robust. Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-02-27Merge #903bors[bot]-4/+13
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>
2019-02-27Remove RawResponse::empty()Ville Penttinen-7/+5
2019-02-27Work around for issue in vscode reporting a failure in requestVille Penttinen-5/+16
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.
2019-02-27Add support for hovering over the name of an itemVille Penttinen-2/+28
2019-02-26Replace visit_fn with crate::completion::function_labelVille Penttinen-43/+2
2019-02-26Merge #902bors[bot]-4/+4
902: Fix a typo r=matklad a=dwijnand Co-authored-by: Dale Wijnand <dale.wijnand@gmail.com>
2019-02-26Fix a typoDale Wijnand-4/+4
2019-02-26Add new type HoverResult to contain the results of hoveringVille Penttinen-16/+149
This makes testing hovers easier as well as allows us to do more things with the results if needed.
2019-02-26Add support for showing fn signature when hoveringVille Penttinen-3/+43
2019-02-26Use TypeAscriptionOwnerVille Penttinen-12/+15
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.
2019-02-26Add new trait TypeAscriptionOwnerVille Penttinen-9/+36
This trait should be implemented for nodes which have an ascribed type, e.g. thing : Type. Such as let, const, static, param, named struct fields.
2019-02-26Merge #899bors[bot]-1/+1
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>
2019-02-26Change default value of highlightingOn to falseVille Penttinen-1/+1
2019-02-25Merge #897bors[bot]-20/+206
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>
2019-02-25kill accidently commited fileAleksey Kladov-182/+0
2019-02-25Merge #898bors[bot]-108/+293
898: rename type to type_alias in the AST as well r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>