Commit graph

3248 commits

Author SHA1 Message Date
bors[bot]
efff774068 Merge #940
940: Show workspace loaded notification r=matklad a=vipentti

This fixes #935 

This adds support for more `InitializationOptions` which are provided by the client.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-03-06 09:56:16 +00:00
Ville Penttinen
0dcb1cb569 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.
2019-03-06 11:34:38 +02:00
Caio
cb60416cb5 Check installed extension 2019-03-05 18:19:36 -03:00
Ville Penttinen
ce118da149 Rename feedback to show_message 2019-03-05 22:25:24 +02:00
Ville Penttinen
80347b8187 Remove InternalFeedback 2019-03-05 22:20:11 +02:00
Ville Penttinen
9063dabcca Send an actual ShowMessage instead of InternalFeedback in feedback()
This now allows us to send a notification that can be shown in the UI when the
workspace has been loaded.

Additionally this removes the need for internal_mode flag.
2019-03-05 21:59:01 +02:00
bors[bot]
ab288a32f9 Merge #938
938: Updates r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-03-05 15:31:10 +00:00
kjeremy
eb3ee7b8e5 Updates 2019-03-05 10:26:36 -05:00
bors[bot]
738f2c6fc3 Merge #936
936: dont produce giant debug dumps r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-05 14:11:43 +00:00
Aleksey Kladov
d1c982d3c7 dont produce giant debug dumps 2019-03-05 17:09:48 +03:00
bors[bot]
4fb4b59f89 Merge #934
934: show message in client's UI if workspace fails to load r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-05 13:33:32 +00:00
Aleksey Kladov
73b892aaa3 show message in client's UI if workspace fails to load 2019-03-05 16:33:05 +03:00
bors[bot]
e7241274ef Merge #930
930: Add support for parsing multiple if and while-let patterns r=matklad a=vipentti



Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
2019-03-05 10:28:24 +00:00
Ville Penttinen
eb1ac43867 Introduce pattern_list to parse pipe separated patterns
pattern_list comes in two variants, one uses the default PAT_RECOVERY_SET as the
recovery set, while other allows the user to provide a recovery set.
2019-03-05 11:31:25 +02:00
bors[bot]
fe48f9f4d2 Merge #912
912: Make goto definition/hover work for associated items r=matklad a=kjeremy

Just functions so far. Looking for comments.

Fixes #911
Towards #832

Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-03-05 07:30:19 +00:00
Ville Penttinen
1f4468a8da Add support for parsing multiple if and while-let patterns 2019-03-04 19:10:14 +02:00
kjeremy
ac678473b8 Use impl_froms! 2019-03-04 09:52:48 -05:00
kjeremy
1578375b89 Make ExpOrPatId private 2019-03-04 09:49:18 -05:00
bors[bot]
bbaf750b10 Merge #929
929: allow `mut ident` patterns in trait methods r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-04 14:48:55 +00:00
Aleksey Kladov
90122542b2 allow mut ident patterns in trait methods
closes #928
2019-03-04 17:47:02 +03:00
bors[bot]
11e0851dcf Merge #927
927: allow aliases in underscores r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-04 13:40:34 +00:00
Aleksey Kladov
0a19f4f1b4 allow aliases in underscores
this helps with

    use foo::Trait as _;

syntax
2019-03-04 16:40:08 +03:00
Jeremy Kolb
79f61dcb0e Format 2019-03-04 08:34:41 -05:00
Jeremy Kolb
e1b59bfe0b Add NavigationTarget::from_impl_item 2019-03-04 08:27:08 -05:00
Jeremy Kolb
ad2da5b1da Remove commented out code 2019-03-04 08:27:08 -05:00
Jeremy Kolb
3d8d880c59 Use ImplItems instead of just Function 2019-03-04 08:27:08 -05:00
kjeremy
49da9a3e81 Make goto definition/hover resolve constructors 2019-03-04 08:27:08 -05:00
bors[bot]
dc8bcc1e42 Merge #926
926: allow vararg functions r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-04 12:49:37 +00:00
bors[bot]
8a5d48b6c6 Merge #925
925: improve error recovery r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-03-04 12:42:21 +00:00
Aleksey Kladov
77f2381eea improve error recovery
parse the contents of error block as an expression
2019-03-04 15:31:18 +03:00
Aleksey Kladov
a99b1db49f allow vararg functions 2019-03-04 14:34:59 +03:00
Aleksey Kladov
3000b13df2 extract block contents into a function 2019-03-04 14:17:31 +03:00
bors[bot]
5197e16648 Merge #916
916: Error handling for macros r=matklad a=detrumi

Part of #720 

Co-authored-by: Wilco Kusee <wilcokusee@gmail.com>
2019-03-04 10:58:08 +00:00
bors[bot]
698aa9b3f6 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>
2019-03-04 10:50:40 +00:00
Ville Penttinen
1ef2c06131 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.
2019-03-04 09:19:46 +02:00
Ville Penttinen
16ecd276f0 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.
2019-03-04 09:02:01 +02:00
Ville Penttinen
0db95fc812 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.
2019-03-03 22:03:37 +02:00
Ville Penttinen
1b4e0ec1c8 Rename syntaxtree text provider to SyntaxTreeContentProvider 2019-03-03 22:02:19 +02:00
Ville Penttinen
c2d3203d0c 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.
2019-03-03 21:43:40 +02:00
Wilco Kusee
c9d6efc468 Add expander unit tests 2019-03-03 20:33:50 +01:00
Ville Penttinen
ac52d9a1f1 Add optional range parameter to SyntaxTreeParams
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-03 19:49:50 +02:00
Wilco Kusee
d149bb885b Add parser unit tests 2019-03-03 12:45:30 +01:00
bors[bot]
17aaece6b3 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.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-03-03 11:44:01 +00:00
Florian Diebold
2e8f258845 Inline type inference test snapshots 2019-03-03 12:41:42 +01:00
Wilco Kusee
725805dc79 Split parse and expand errors 2019-03-03 10:40:03 +01:00
Florian Diebold
d7f113e7a6 emacs: Fix (void-variable rust-analyzer--last-runnable) 2019-03-03 03:00:17 +01:00
Florian Diebold
affaf7700a Represent unknown types as {unknown} instead of [unknown]
Since the latter could actually be a real type...
2019-03-03 03:00:17 +01:00
Wilco Kusee
dffe318701 Formatting 2019-03-02 20:49:13 +01:00
Wilco Kusee
d3a252b559 Replace option with result in mbe 2019-03-02 20:30:13 +01:00
Florian Diebold
b7fdad8448 Add a bunch of tests for type inference involving traits
None of them works correctly yet, of course.
2019-03-02 16:42:51 +01:00