aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge #3998 #4006bors[bot]2020-04-2412-95/+940
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]> Co-authored-by: Leander Tentrup <[email protected]> Co-authored-by: Leander Tentrup <[email protected]>
| | * Adapt format specifier highlighting to support escaped squences and unicode ↵Leander Tentrup2020-04-224-144/+209
| | | | | | | | | | | | identifiers
| | * Apply suggestions from code reviewLeander Tentrup2020-04-222-34/+32
| | | | | | | | | | | | Co-Authored-By: bjorn3 <[email protected]>
| | * Implement syntax highlighting for format stringsLeander Tentrup2020-04-204-3/+532
| | | | | | | | | | | | | | | | | | | | | Detailed changes: 1) Implement a lexer for string literals that divides the string in format specifier `{}` including the format specifier modifier. 2) Adapt syntax highlighting to add ranges for the detected sequences. 3) Add a test case for the format string syntax highlighting.
| | * Refactor flattening logic for highlighted syntax rangesLeander Tentrup2020-04-181-54/+85
| | |
| * | Add `pub(crate)` to functions generated in other moduleTimo Freiberg2020-04-212-46/+27
| | |
| * | Jump to sourceChanges in other filesTimo Freiberg2020-04-213-16/+15
| | |
| * | Add target file information to AssistActionTimo Freiberg2020-04-214-16/+82
| | |
| * | Make add_function generate functions in other modules via qualified pathTimo Freiberg2020-04-214-29/+205
| | |
* | | Merge #4127bors[bot]2020-04-241-0/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4127: More helpful error message if toolchain is not in PATH r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | More helpful error message if toolchain is not in PATHAleksey Kladov2020-04-241-0/+5
| | | |
* | | | Merge #4126bors[bot]2020-04-241-6/+38
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | 4126: Don't omit methods with self from path completion r=matklad a=jonas-schievink It's sometimes useful to create a reference to these items (eg. for use as a function pointer). Perhaps these should be given lower score though, if that's possible? Co-authored-by: Jonas Schievink <[email protected]>
| * | | Don't omit methods with self from path completionJonas Schievink2020-04-241-6/+38
|/ / /
* | | Merge #4105bors[bot]2020-04-245-0/+595
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4105: Adds attribute completions (#3941) r=matklad a=jrvidal I've hacked together some basic completions for a few builtin attributes. * I have no idea what `CompletionItemKind` we should set for them. * There's plenty of fancy stuff we could do by detecting the item the attribute is being added to. Nothing of that here. * Maybe we could complete as soon as you type `#` or `#!`? I'm not sure what info exactly we can dump on `CompletionContext` and what we should query during the completion calculation itself. I've assumed adding an `is_attribute` field is OK, since it allows to discard the completion quickly if it doesn't apply. Later we inspect the AST to find out whether it is an inner attribute or not. Co-authored-by: Roberto Vidal <[email protected]>
| * | | Adds attribute completions (#3941)Roberto Vidal2020-04-245-0/+595
|/ / /
* | | Merge #4121bors[bot]2020-04-245-48/+59
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4121: Better label for macros completion r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | Better label for macros completionAleksey Kladov2020-04-245-48/+59
|/ / /
* | | Merge #4101bors[bot]2020-04-242-12/+5
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4101: Panic proc macro srv if read request failed r=matklad a=edwin0cheng This PR fixed a bug when the rust-analyzer is killed suddenly, the `rust-analyzer proc-macro` will become stale. Co-authored-by: Edwin Cheng <[email protected]>
| * | | Refactor a bitEdwin Cheng2020-04-241-8/+3
| | | |
| * | | Bubble up errorEdwin Cheng2020-04-232-10/+7
| | | |
| * | | Fix typoEdwin Cheng2020-04-231-1/+1
| | | |
| * | | Panic proc macro srv if read request failedEdwin Cheng2020-04-231-2/+3
| | | |
* | | | Merge #4118bors[bot]2020-04-241-10/+10
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4118: :arrow_up: crates (to bust the caches) r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | :arrow_up: crates (to bust the caches)Aleksey Kladov2020-04-241-10/+10
|/ / / /
* | | | Merge #4117bors[bot]2020-04-242-0/+14
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4117: Honor snippet capability r=matklad a=matklad closes #2518 bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | Honor snippet capabilityAleksey Kladov2020-04-242-0/+14
| | | | | | | | | | | | | | | | | | | | closes #2518
* | | | | Merge #4116bors[bot]2020-04-249-63/+141
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4116: Make sure that adding a snippet requires corresponding capability r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | Make sure that adding a snippet requires corresponding capabilityAleksey Kladov2020-04-246-44/+107
| | | | |
| * | | | Introduce internal snippet capAleksey Kladov2020-04-242-0/+14
| | | | |
| * | | | Move CompletionConfig to a separate moduleAleksey Kladov2020-04-242-19/+20
| | | | |
* | | | | Merge #4114bors[bot]2020-04-2410-333/+329
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4114: Refactor completion sorting r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | Don't set sortTextAleksey Kladov2020-04-242-18/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I might be reading this wrong, but it looks like we are setting it to essentially arbitrary string at the moment, as there are no defined order on the items in the *set* of completions.
| * | | | Add test marksAleksey Kladov2020-04-242-0/+6
| | | | |
| * | | | Introduce ActiveParameterAleksey Kladov2020-04-245-30/+35
| | | | |
| * | | | Move tests to where they belongAleksey Kladov2020-04-242-231/+231
| | | | |
| * | | | RefactorAleksey Kladov2020-04-241-24/+18
| | | | |
| * | | | Restore CompletionItem immutabilityAleksey Kladov2020-04-242-31/+23
| | | | |
| * | | | More functionalAleksey Kladov2020-04-242-11/+18
| | | | |
| * | | | MoveAleksey Kladov2020-04-231-9/+9
|/ / / /
* | | | Merge #4106bors[bot]2020-04-232-1/+42
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4106: Fix wrong substitution code r=matklad a=flodiebold We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow that also occurs on the Diesel codebase though). Co-authored-by: Florian Diebold <[email protected]>
| * | | | Fix wrong substitution codeFlorian Diebold2020-04-232-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to shift in when we're substituting inside a binder. This should fix #4053 (it doesn't fix the occasional overflow that also occurs on the Diesel codebase though).
* | | | | Merge #3954bors[bot]2020-04-239-40/+412
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3954: Improve autocompletion by looking on the type and name r=matklad a=bnjjj This tweet (https://twitter.com/tjholowaychuk/status/1248918374731714560) gaves me the idea to implement that in rust-analyzer. Basically for this first example I made some examples when we are in a function call definition. I look on the parameter list to prioritize autocompletions for the same types and if it's the same type + the same name then it's displayed first in the completion list. So here is a draft, first step to open a discussion and know what you think about the implementation. It works (cf tests) but maybe I can make a better implementation at some places. Be careful the code needs some refactoring to be better and concise. PS: It was lot of fun writing this haha Co-authored-by: Benjamin Coenen <[email protected]>
| * | | | | Improve autocompletion by looking on the type and nameBenjamin Coenen2020-04-212-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Benjamin Coenen <[email protected]>
| * | | | | Improve autocompletion by looking on the type and nameBenjamin Coenen2020-04-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Benjamin Coenen <[email protected]>
| * | | | | Merge branch 'master' of github.com:rust-analyzer/rust-analyzerBenjamin Coenen2020-04-2160-422/+1076
| |\ \ \ \ \
| * | | | | | Improve autocompletion by looking on the type and nameBenjamin Coenen2020-04-214-48/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Benjamin Coenen <[email protected]>
| * | | | | | Merge branch 'master' of github.com:rust-analyzer/rust-analyzerBenjamin Coenen2020-04-1830-183/+705
| |\ \ \ \ \ \ | | | |_|_|_|/ | | |/| | | |
| * | | | | | feat: improve dot completions with scoringBenjamin Coenen2020-04-171-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Benjamin Coenen <[email protected]>
| * | | | | | revert tidy tests changesBenjamin Coenen2020-04-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Benjamin Coenen <[email protected]>
| * | | | | | Merge branch 'master' of github.com:rust-analyzer/rust-analyzerBenjamin Coenen2020-04-1751-364/+1126
| |\ \ \ \ \ \