Edit: Windows encoding for Unicode is UTF-16 so String::from_utf8 will probably fail unless `Vec<u8>` is already UTF-8 somehow, which I don't know for sure.
Ville Penttinen [Wed, 6 Mar 2019 09:34:38 +0000 (11:34 +0200)]
Add showWorkspaceLoadedNotification to vscode client
This allows users to control whether or not they want to see the "workspace
loaded" notification.
This is done on the server side using InitializationOptions which are provided
by the client. By default show_workspace_loaded is true, meaning the
notification is sent.
bors[bot] [Mon, 4 Mar 2019 10:50:40 +0000 (10:50 +0000)]
Merge #924
924: Improve show syntax tree r=matklad a=vipentti
This implements some of the features discussed in #820.
You can now select a range of syntax in a file and then use "Show Syntax Tree" to show its syntax. In addition you can select a range of syntax that is inside a string (typically test cases) and show its syntax as well.
Previous behavior is still available, simply use "Show Syntax Tree" without a selection, and you get the live updating syntax tree. Additionally now the live updating tree will update when the active file is changed. Previously you had to type something in the new file to get the syntax tree to update.
Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
Ville Penttinen [Mon, 4 Mar 2019 07:19:46 +0000 (09:19 +0200)]
Allow syntax strings to contain test markers
We simply remove all the CUSTOM_MARKERS before attempting to parse the file.
This allows for the syntax selection to work with most of the test strings.
Ville Penttinen [Mon, 4 Mar 2019 06:54:54 +0000 (08:54 +0200)]
Implement syntax tree support for syntax inside string
This allows us to select a string or portions of it and try parsing it as rust
syntax. This is mostly helpful when developing tests where the test
itself contains some rust syntax as a string.
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>