Commit graph

277 commits

Author SHA1 Message Date
Benjamin Coenen
51c02ab84f add Ok wrapping
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-05-06 17:45:55 +02:00
bors[bot]
d1c1c01309
Merge #4306 #4308
4306: Make incremental sync opt-out and fix line index rebuild r=matklad a=lnicola



4308: Update server binary paths in docs r=matklad a=Coder-256

Fixed incorrect macOS path and converted to a list. Also, should the Windows path include `matklad.rust-analyzer`? (I can't check)

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: Jacob Greenfield <jacob@jacobgreenfield.me>
2020-05-05 10:02:56 +00:00
Jacob Greenfield
bcc1717378
Update server binary paths
Fixed macOS path and converted to a list
2020-05-04 13:16:29 -04:00
Francisco Lopes
18ba86b1c5
[manual] Improve requirements and editor wording 2020-05-04 14:12:32 -03:00
bors[bot]
805c0b92ac
Merge #4287
4287: Update debugging.md r=matklad a=lonesometraveler



Co-authored-by: KENTARO OKUDA <lonesometraveler@mac.com>
2020-05-04 02:54:49 +00:00
KENTARO OKUDA
42e2eca921 Update debugging.md 2020-05-03 15:14:56 -04:00
bors[bot]
17bd79f497
Merge #4272
4272: Fix Typos r=jonas-schievink a=lonesometraveler



Co-authored-by: KENTARO OKUDA <lonesometraveler@mac.com>
2020-05-02 22:56:52 +00:00
KENTARO OKUDA
4f4d0fd9ac Update syntax.md 2020-05-02 18:55:04 -04:00
KENTARO OKUDA
9914f7fbb2 Fix Typos 2020-05-02 17:45:46 -04:00
Benjamin Coenen
0b40876b99 Merge branch 'master' of github.com:rust-analyzer/rust-analyzer 2020-05-02 12:25:04 +02:00
Aleksey Kladov
b73dbbfbf2 Add missing members generates indented blocks 2020-05-02 11:53:07 +02:00
bors[bot]
d79a699f8e
Merge #4236
4236: Document Gnome Builder support r=matklad a=lnicola

Closes #3758.

CC @gwutz

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2020-05-01 20:09:12 +00:00
KENTARO OKUDA
f5d20b6525 Fix Typos on guide.md 2020-05-01 14:00:06 -04:00
Benjamin Coenen
dc34162450 Merge branch 'master' of github.com:rust-analyzer/rust-analyzer 2020-05-01 16:26:30 +02:00
KENTARO OKUDA
eafb2107dd Fix Typos 2020-05-01 09:43:08 -04:00
Laurențiu Nicola
c185e482e9 Document Gnome Builder support 2020-05-01 11:20:58 +03:00
bors[bot]
c96b2180c1
Merge #4228
4228: Fix typo in language server binary docs r=matklad a=ayazhafiz



Co-authored-by: hafiz <20735482+ayazhafiz@users.noreply.github.com>
2020-04-30 20:45:19 +00:00
Ömer Sinan Ağacan
742055e29f
Update Roslyn link in syntax.md
Eric Lippert has a new blog that he keeps updating, update the link to that
2020-04-30 23:27:06 +03:00
hafiz
d185cbd99e
Update readme.adoc 2020-04-30 11:29:21 -07:00
hafiz
a00647cefe
Fix typo in language server binary docs 2020-04-30 11:21:16 -07:00
Heyward Fann
2e4ce5390c docs(user): method chaining hints support
https://github.com/fannheyward/coc-rust-analyzer/issues/177#issuecomment-621109410
2020-04-30 11:38:20 +08:00
KENTARO OKUDA
9ff566212e Fix Typos on features.md 2020-04-29 16:00:52 -04:00
Benjamin Coenen
bbe22640b8 Add unwrap block assist #4156
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-29 14:53:47 +02:00
Benjamin Coenen
76733f0cd4 Add unwrap block assist #4156
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2020-04-29 14:08:30 +02:00
Boris Staletic
6b0be2f67f Fix YouComplteMe instructions link 2020-04-29 12:50:54 +02:00
Simon Cruanes
7edd293e5c
add ale to the nvim setup section of the readme 2020-04-28 21:01:10 -04:00
Youngsuk Kim
b40a237baf
tiny fix in markdown ordered list
`.3` => `3.`
2020-04-28 10:18:12 -04:00
Günter Zöchbauer
999e3312e0
Add missing . 2020-04-26 19:40:13 +02:00
Günter Zöchbauer
5df4a79951
Change install directory suggestion to ~/.local/bin
instead of `~/.cargo/bin`
2020-04-26 17:11:44 +02:00
Günter Zöchbauer
482e912fa0
xtask does not need to be installed
because it's contained in the dart-analyzer repo.
2020-04-26 17:08:15 +02:00
Günter Zöchbauer
49d494c033
Clarify rust-analyzer binary install 2020-04-26 15:44:05 +02:00
Aleksey Kladov
8843588fca Convert tests to text-size 2020-04-25 11:59:18 +02:00
Aleksey Kladov
b1d5817dd1 Convert code to text-size 2020-04-25 11:59:18 +02:00
bors[bot]
51a0058d4c
Merge #3998 #4006
3998: Make add_function generate functions in other modules via qualified path r=matklad a=TimoFreiberg

Additional feature for #3639 

- [x] Add tests for paths with more segments
- [x] Make generating the function in another file work
- [x] Add `pub` or `pub(crate)` to the generated function if it's generated in a different module
- [x] Make the assist jump to the edited file
- [x] Enable file support in the `check_assist` helper

4006: Syntax highlighting for format strings r=matklad a=ltentrup

I have an implementation for syntax highlighting for format string modifiers `{}`.
The first commit refactors the changes in #3826 into a separate struct.
The second commit implements the highlighting: first we check in a macro call whether the macro is a format macro from `std`. In this case, we remember the format string node. If we encounter this node during syntax highlighting, we check for the format modifiers `{}` using regular expressions.

There are a few places which I am not quite sure:
- Is the way I extract the macro names correct?
- Is the `HighlightTag::Attribute` suitable for highlighting the `{}`?

Let me know what you think, any feedback is welcome!

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com>
Co-authored-by: Leander Tentrup <ltentrup@users.noreply.github.com>
2020-04-24 20:10:54 +00:00
Weihang Lo
313409af9e
Add YouCompleteMe as a LSP option for vim/neovim 2020-04-23 17:09:37 +08:00
Timo Freiberg
317fc650d5 Make add_function generate functions in other modules via qualified path 2020-04-21 23:04:44 +02:00
Heyward Fann
0f49fd818b docs(readme): improve user docs
cleanup unavailable configurations/commands
2020-04-21 17:54:13 +08:00
Nikolai Morin
427f634de3
Move the PATH issue up to the non-editor specific section 2020-04-21 11:17:12 +02:00
Nikolai Morin
c0e9a1a476
Delete comma 2020-04-21 10:16:30 +02:00
Nikolai Morin
d22349de0a
Update docs/user/readme.adoc
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-04-21 10:15:49 +02:00
Nikolai Morin
22fd891d45
Update docs/user/readme.adoc
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-04-21 10:13:33 +02:00
Nikolai Morin
f964bbd735
More detailed Sublime Text install instructions
* People might typically jump directly to their editor and wonder where the part about installing rust-analyzer is – at least I did. I added a link to the relevant section for ST.
* Make ST instructions more detailed and user friendly (especially beginners), include troubleshooting tips.
* Minor grammar improvements throughout.
2020-04-21 09:20:14 +02:00
Timo Freiberg
1231418f31 Change add_function assist to use todo!() 2020-04-13 22:17:06 +02:00
bors[bot]
fd06fe7b13
Merge #3925
3925: Implement assist "Reorder field names" r=matklad a=geoffreycopin

This PR implements the "Reorder record fields" assist as discussed in issue #3821 .

Adding a `RecordFieldPat` variant to the `Pat` enum seemed like the easiest way to handle the `RecordPat` children as a single sequence of elements, maybe there is a better way ?

Co-authored-by: Geoffrey Copin <copin.geoffrey@gmail.com>
2020-04-11 18:40:46 +00:00
Geoffrey Copin
d9089245fe Generate doc 2020-04-11 20:32:58 +02:00
Chris Hopman
af04d45d32 Change missing impl assist to use todo!() instead of unimplemented()
todo!() "Indicates unfinished code" (https://doc.rust-lang.org/std/macro.todo.html)

Rust documentation provides further clarification:

> The difference between unimplemented! and todo! is that while todo!
> conveys an intent of implementing the functionality later and the
> message is "not yet implemented", unimplemented! makes no such claims.

todo!() seems more appropriate for assists that insert missing impls.
2020-04-10 13:56:12 -07:00
Elinvynia
eb1ca5f448 Better Sublime documentation 2020-04-09 00:32:56 +02:00
bors[bot]
77462bba62
Merge #3746
3746: Add create_function assist r=flodiebold a=TimoFreiberg

The function part of #3639, creating methods will come later

- [X] Function arguments
     - [X] Function call arguments
     - [x] Method call arguments
     - [x] Literal arguments
     - [x] Variable reference arguments
- [X] Migrate to `ast::make` API
    Done, but there are some ugly spots.

Issues to handle in another PR:
- function reference arguments: Their type isn't printed properly right now.
    The "insert explicit type" assist has the same issue and this is probably a relatively rare usecase.

- generating proper names for all kinds of argument expressions (if, loop, ...?)
    Without this, it's totally possible for the assist to generate invalid argument names.
    I think the assist it's already helpful enough to be shipped as it is, at least for me the main usecase involves passing in named references.
    Besides, the Rust tooling ecosystem is immature enough that some janky behaviour in a new assist probably won't scare anyone off.

- select the generated placeholder body so it's a bit easier to overwrite it

- create method (`self.foo<|>(..)` or `some_foo.foo<|>(..)`) instead of create_function.
    The main difference would be finding (or creating) the impl block and inserting the `self` argument correctly

- more specific default arg names for literals.
    So far, every generated argument whose name can't be taken from the call site is called `arg` (with a number suffix if necessary).

- creating functions in another module of the same crate.
    E.g. when typing `some_mod::foo<|>(...)` when in `lib.rs`, I'd want to have `foo` generated in `some_mod.rs` and jump there.
    Issues: the mod could exist in `some_mod.rs`, in `lib.rs` as `mod some_mod`, or inside another mod but be imported via `use other_mod::some_mod`.

- refer to arguments of the generated function with a qualified path if the types aren't imported yet
    (alternative: run autoimport. i think starting with a qualified path is cleaner and there's already an assist to replace a qualified path with an import and an unqualified path)

- add type arguments of the arguments to the generated function

- Autocomplete functions with information from unresolved calls (see https://github.com/rust-analyzer/rust-analyzer/pull/3746#issuecomment-605281323)
    Issues: see https://github.com/rust-analyzer/rust-analyzer/pull/3746#issuecomment-605282542. The unresolved call could be anywhere. But just offering this autocompletion for unresolved calls in the same module would already be cool.

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
2020-04-03 08:23:44 +00:00
veetaha
dd5e4d4870 vscode: move docks about syntax tree to dev/README.md 2020-04-02 11:23:56 +03:00
veetaha
e4c69443e7 vscode: add docs about goto-definition for rust syntax tree 2020-04-02 11:13:38 +03:00