diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-09-08 17:24:24 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-09-08 17:24:24 +0100 |
commit | 4f647096665b2ca3725ba1f7415a21fbc46044bb (patch) | |
tree | c62319bde31a42a49152b6ebb187c873702dcdbf | |
parent | 8c3720d4b843808b7c8de2ac87642611c993fc44 (diff) | |
parent | bae5938682978cff84826cee300d6cfad1b9dbd0 (diff) |
Merge #65
65: simplify r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
-rw-r--r-- | README.md | 16 | ||||
-rw-r--r-- | crates/libsyntax2/src/parser_api.rs | 2 |
2 files changed, 11 insertions, 7 deletions
@@ -37,24 +37,28 @@ doesn't hurt too much :-) | |||
37 | 37 | ||
38 | * syntax highlighting (LSP does not have API for it, so impl is hacky | 38 | * syntax highlighting (LSP does not have API for it, so impl is hacky |
39 | and sometimes fall-backs to the horrible built-in highlighting) | 39 | and sometimes fall-backs to the horrible built-in highlighting) |
40 | 40 | ||
41 | * commands (`ctrl+shift+p` or keybindings) | 41 | * commands (`ctrl+shift+p` or keybindings) |
42 | - **Show Rust Syntax Tree** (use it to verify that plugin works) | 42 | - **Show Rust Syntax Tree** (use it to verify that plugin works) |
43 | - **Rust Extend Selection** (works with multiple cursors) | 43 | - **Rust Extend Selection** (works with multiple cursors) |
44 | - **Rust Matching Brace** (knows the difference between `<` and `<`) | 44 | - **Rust Matching Brace** (knows the difference between `<` and `<`) |
45 | - **Rust Parent Module** | 45 | - **Rust Parent Module** |
46 | - **Rust Join Lines** (deals with trailing commas) | 46 | - **Rust Join Lines** (deals with trailing commas) |
47 | 47 | ||
48 | * **Go to symbol in file** | 48 | * **Go to symbol in file** |
49 | 49 | ||
50 | * **Go to symbol in workspace** (no support for Cargo deps yet) | 50 | * **Go to symbol in workspace** |
51 | - `#Foo` searches for `Foo` type in the current workspace | ||
52 | - `#foo#` searches for `foo` function in the current workspace | ||
53 | - `#Foo*` searches for `Foo` type among dependencies, excluding `stdlib` | ||
54 | - Sorry for a weired UI, neither LSP, not VSCode have any sane API for filtering! :) | ||
51 | 55 | ||
52 | * code actions: | 56 | * code actions: |
53 | - Flip `,` in comma separated lists | 57 | - Flip `,` in comma separated lists |
54 | - Add `#[derive]` to struct/enum | 58 | - Add `#[derive]` to struct/enum |
55 | - Add `impl` block to struct/enum | 59 | - Add `impl` block to struct/enum |
56 | - Run tests at caret | 60 | - Run tests at caret |
57 | 61 | ||
58 | * **Go to definition** ("correct" for `mod foo;` decls, index-based for functions). | 62 | * **Go to definition** ("correct" for `mod foo;` decls, index-based for functions). |
59 | 63 | ||
60 | 64 | ||
@@ -71,7 +75,7 @@ doesn't hurt too much :-) | |||
71 | space tree traversal (this is cool) and `visit` for type-driven | 75 | space tree traversal (this is cool) and `visit` for type-driven |
72 | visiting the nodes (this is double plus cool, if you understand how | 76 | visiting the nodes (this is double plus cool, if you understand how |
73 | `Visitor` works, you understand libsyntax2). | 77 | `Visitor` works, you understand libsyntax2). |
74 | 78 | ||
75 | 79 | ||
76 | ### `crates/libeditor` | 80 | ### `crates/libeditor` |
77 | 81 | ||
@@ -84,7 +88,7 @@ single-file and is basically a bunch of pure functions. | |||
84 | A stateful library for analyzing many Rust files as they change. | 88 | A stateful library for analyzing many Rust files as they change. |
85 | `WorldState` is a mutable entity (clojure's atom) which holds current | 89 | `WorldState` is a mutable entity (clojure's atom) which holds current |
86 | state, incorporates changes and handles out `World`s --- immutable | 90 | state, incorporates changes and handles out `World`s --- immutable |
87 | consistent snapshots of `WorldState`, which actually power analysis. | 91 | consistent snapshots of `WorldState`, which actually power analysis. |
88 | 92 | ||
89 | 93 | ||
90 | ### `crates/server` | 94 | ### `crates/server` |
diff --git a/crates/libsyntax2/src/parser_api.rs b/crates/libsyntax2/src/parser_api.rs index 7d97159dd..772d753af 100644 --- a/crates/libsyntax2/src/parser_api.rs +++ b/crates/libsyntax2/src/parser_api.rs | |||
@@ -118,7 +118,7 @@ impl<'t> Parser<'t> { | |||
118 | pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) { | 118 | pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) { |
119 | if self.at(SyntaxKind::L_CURLY) | 119 | if self.at(SyntaxKind::L_CURLY) |
120 | || self.at(SyntaxKind::R_CURLY) | 120 | || self.at(SyntaxKind::R_CURLY) |
121 | || recovery.contains(self.current()) { | 121 | || self.at_ts(recovery) { |
122 | self.error(message); | 122 | self.error(message); |
123 | } else { | 123 | } else { |
124 | let m = self.start(); | 124 | let m = self.start(); |