mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
Merge #65
65: simplify r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
4f64709666
2 changed files with 11 additions and 7 deletions
16
README.md
16
README.md
|
@ -37,24 +37,28 @@ doesn't hurt too much :-)
|
||||||
|
|
||||||
* syntax highlighting (LSP does not have API for it, so impl is hacky
|
* syntax highlighting (LSP does not have API for it, so impl is hacky
|
||||||
and sometimes fall-backs to the horrible built-in highlighting)
|
and sometimes fall-backs to the horrible built-in highlighting)
|
||||||
|
|
||||||
* commands (`ctrl+shift+p` or keybindings)
|
* commands (`ctrl+shift+p` or keybindings)
|
||||||
- **Show Rust Syntax Tree** (use it to verify that plugin works)
|
- **Show Rust Syntax Tree** (use it to verify that plugin works)
|
||||||
- **Rust Extend Selection** (works with multiple cursors)
|
- **Rust Extend Selection** (works with multiple cursors)
|
||||||
- **Rust Matching Brace** (knows the difference between `<` and `<`)
|
- **Rust Matching Brace** (knows the difference between `<` and `<`)
|
||||||
- **Rust Parent Module**
|
- **Rust Parent Module**
|
||||||
- **Rust Join Lines** (deals with trailing commas)
|
- **Rust Join Lines** (deals with trailing commas)
|
||||||
|
|
||||||
* **Go to symbol in file**
|
* **Go to symbol in file**
|
||||||
|
|
||||||
* **Go to symbol in workspace** (no support for Cargo deps yet)
|
* **Go to symbol in workspace**
|
||||||
|
- `#Foo` searches for `Foo` type in the current workspace
|
||||||
|
- `#foo#` searches for `foo` function in the current workspace
|
||||||
|
- `#Foo*` searches for `Foo` type among dependencies, excluding `stdlib`
|
||||||
|
- Sorry for a weired UI, neither LSP, not VSCode have any sane API for filtering! :)
|
||||||
|
|
||||||
* code actions:
|
* code actions:
|
||||||
- Flip `,` in comma separated lists
|
- Flip `,` in comma separated lists
|
||||||
- Add `#[derive]` to struct/enum
|
- Add `#[derive]` to struct/enum
|
||||||
- Add `impl` block to struct/enum
|
- Add `impl` block to struct/enum
|
||||||
- Run tests at caret
|
- Run tests at caret
|
||||||
|
|
||||||
* **Go to definition** ("correct" for `mod foo;` decls, index-based for functions).
|
* **Go to definition** ("correct" for `mod foo;` decls, index-based for functions).
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,7 +75,7 @@ doesn't hurt too much :-)
|
||||||
space tree traversal (this is cool) and `visit` for type-driven
|
space tree traversal (this is cool) and `visit` for type-driven
|
||||||
visiting the nodes (this is double plus cool, if you understand how
|
visiting the nodes (this is double plus cool, if you understand how
|
||||||
`Visitor` works, you understand libsyntax2).
|
`Visitor` works, you understand libsyntax2).
|
||||||
|
|
||||||
|
|
||||||
### `crates/libeditor`
|
### `crates/libeditor`
|
||||||
|
|
||||||
|
@ -84,7 +88,7 @@ single-file and is basically a bunch of pure functions.
|
||||||
A stateful library for analyzing many Rust files as they change.
|
A stateful library for analyzing many Rust files as they change.
|
||||||
`WorldState` is a mutable entity (clojure's atom) which holds current
|
`WorldState` is a mutable entity (clojure's atom) which holds current
|
||||||
state, incorporates changes and handles out `World`s --- immutable
|
state, incorporates changes and handles out `World`s --- immutable
|
||||||
consistent snapshots of `WorldState`, which actually power analysis.
|
consistent snapshots of `WorldState`, which actually power analysis.
|
||||||
|
|
||||||
|
|
||||||
### `crates/server`
|
### `crates/server`
|
||||||
|
|
|
@ -118,7 +118,7 @@ impl<'t> Parser<'t> {
|
||||||
pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) {
|
pub(crate) fn err_recover(&mut self, message: &str, recovery: TokenSet) {
|
||||||
if self.at(SyntaxKind::L_CURLY)
|
if self.at(SyntaxKind::L_CURLY)
|
||||||
|| self.at(SyntaxKind::R_CURLY)
|
|| self.at(SyntaxKind::R_CURLY)
|
||||||
|| recovery.contains(self.current()) {
|
|| self.at_ts(recovery) {
|
||||||
self.error(message);
|
self.error(message);
|
||||||
} else {
|
} else {
|
||||||
let m = self.start();
|
let m = self.start();
|
||||||
|
|
Loading…
Reference in a new issue