aboutsummaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge #998bors[bot]2019-03-191-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | 998: import resolution is immutable r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | import resolution is immutableAleksey Kladov2019-03-191-1/+1
| |/
* | Merge #996bors[bot]2019-03-1910-42/+305
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 996: Allow attributes on top level expressions r=matklad a=pcpthm This PR modifies parser to allow outer attributes on top level expression. Here, top level expression means either - Expression statement e.g. `foo();` - Last expression in a block without semicolon `bar()` in `{ foo(); bar() }`. Except for binary operation expressions and `if` expressions, which are errors (feature gated) in rustc. Attributes on inner expressions like `foo(#[a] 1)` are not implemented. I first tried to implement this by passing `Maker` to expression parsers. However, this implementation couldn't parse `#[attr] foo()` correctly as `CallExpr(Attr(..), PathExpr(..), ArgList(..))` and instead parsed incorrectly as `CallExpr(PathExpr(Attr(..), ..), ArgList(..))` due to the way left recursion is handled. In the end, I introduce `undo_completion` method. Which is not the suggested approach, but it seems not very bad. Fix #759. Co-authored-by: pcpthm <[email protected]>
| * Replace `contract_child` to a less ad-hoc APIpcpthm2019-03-192-40/+37
| |
| * Mark non-code block as textpcpthm2019-03-191-1/+1
| |
| * Error about attributes onpcpthm2019-03-193-12/+82
| | | | | | | | unallowed types of expression statement
| * Allow attributes on top level expressionpcpthm2019-03-198-35/+231
| | | | | | | | | | | | A top level expression is either - a expression statement or - the last expression in a block
* | Merge #993bors[bot]2019-03-181-1/+40
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 993: Fix installing vscode extension on MacOS r=matklad a=funkill VSCode often installed in MacOS as `Visual Studio Code.app` package and `code` binary located at `Contents/Resources/app/bin` in package. This path not exists in `$PATH` variable and we can't run `code`. In previous version of `do_run` function all before space was command and all after - arguments. If path or command has spaces, extracting command breaks. To fix this i extracted command to separated argument of function. All packages can be placed in system app dir (`/Applications`) or user app dir (`~/Applications`). I created helper function for find app in this directories. Co-authored-by: funkill2 <[email protected]>
| * | set code less genericfunkill22019-03-181-50/+24
| | |
| * | added setup environmentfunkill22019-03-181-1/+12
| | |
| * | added helper module for appending vscode pathfunkill22019-03-181-0/+54
| |/
* / Upgrade ra_vfs to use new FilteringVille Penttinen2019-03-184-6/+57
|/ | | | | Currently this matches the previous filtering, meaning all roots are filtered using the same rules.
* Merge #991bors[bot]2019-03-1814-81/+149
|\ | | | | | | | | | | | | | | | | | | | | | | 991: Use Marker argument for item parsers r=matklad a=pcpthm Before doing this for expressions, I found that the pattern (Marker argument) should be applied to the item parsers because visiblity and modifiers are parsed in a separate function. Fixed some parser bugs: - Fix pub_expr: `pub 42;` was allowed. - Fix incorrect parsing of crate::path: incorrectly parsed as `crate` as a visibility. Co-authored-by: pcpthm <[email protected]>
| * Use Marker argument for item parserspcpthm2019-03-1814-81/+149
| | | | | | | | | | - Fix pub_expr - Fix incorrect parsing of crate::path
* | Merge #989bors[bot]2019-03-182-0/+153
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 989: Implement naive version of fill_struct_fields assist r=matklad a=yanchith Fixes #964 This implements the `fill_struct_fields` assist. Currently only works for named struct fields, but not for tuple structs, because we seem to be missing a `TupleStructLit` (akin to `StructLit`, but for tuple structs). I am happy to implement `TupleStructLit` parsing given some guidance (provided it's really missing) and make the assist work for tuple structs as well. Could do so either in this PR, or another one 🙂 Sorry if I missed something important, this is my first PR for Rust Analyzer. Btw is there any way to run the assists in emacs? UPDATE: I just realized that parsing `TupleStructLit` would be quite difficult as it it really similar, if not identical to a function call... Co-authored-by: yanchith <[email protected]>
| * | Only replace NamedFieldList and add test for preserving Selfyanchith2019-03-181-13/+45
| | |
| * | Remove unachievable TODOyanchith2019-03-181-1/+0
| | |
| * | Implement naive version of fill_struct_fields assistyanchith2019-03-172-0/+122
| | |
* | | Merge #987bors[bot]2019-03-182-84/+70
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | 987: Refactor maybe_item to use Marker argument r=pcpthm a=pcpthm As suggested at <https://github.com/rust-analyzer/rust-analyzer/pull/980#issuecomment-473659745>. For expression paring functions, changing signature - from `fn(&mut Parser) -> Option<CompletedMarker>` to `fn(&mut Parser, Marker) -> Result<CompletedMarker, Marker>` - from `fn(&mut Parser) -> CompletedMarker` to `fn(&mut Parser, Marker) -> CompletedMarker` is my plan. Co-authored-by: pcpthm <[email protected]>
| * | Apply stylistic changes suggestedpcpthm2019-03-182-17/+14
| | |
| * | Refactor maybe_item to use Marker argumentpcpthm2019-03-172-86/+75
| | |
* | | Merge #982bors[bot]2019-03-173-17/+137
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 982: Implement BindingMode for pattern matching. r=flodiebold a=mjkillough Implement `BindingMode` for pattern matching, so that types can be correctly inferred using match ergonomics. The binding mode defaults to `Move` (referred to as 'BindingMode::BindByValue` in rustc), and is updated by automatic dereferencing of the value being matched. Fixes #888. - [Binding modes in The Reference](https://doc.rust-lang.org/reference/patterns.html#binding-modes) - [`rustc` implementation](https://github.com/rust-lang/rust/blob/e17c48e2f21eefd59748e364234efc7037a3ec96/src/librustc_typeck/check/_match.rs#L77) (and [definition of `BindingMode`](https://github.com/rust-lang/rust/blob/e957ed9d10ec589bdd523b88b4b44c41b1ecf763/src/librustc/ty/binding.rs)) - [Match Ergonomics RFC](https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#binding-mode-rules) Co-authored-by: Michael Killough <[email protected]>
| * | | Split test case and use tested_by!.Michael Killough2019-03-173-76/+103
| | | |
| * | | Simplify match statement.Michael Killough2019-03-171-6/+1
| | | |
| * | | impl Default for BindingMode.Michael Killough2019-03-171-5/+11
| | | | | | | | | | | | | | | | | | | | This decouples callers from knowing what the default binding mode of pattern matching is.
| * | | Implement BindingMode for pattern matching.Michael Killough2019-03-162-62/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement `BindingMode` for pattern matching, so that types can be correctly inferred using match ergonomics. The binding mode defaults to `Move` (referred to as 'BindingMode::BindByValue` in rustc), and is updated by automatic dereferencing of the value being matched.
* | | | Merge #983bors[bot]2019-03-173-0/+218
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 983: support remainder assignment operator r=matklad a=JeanMertz `%=` was returning errors for me, turns out it wasn't added as a valid assignment operation. I'm not sure what the best location would be to add a test for this. Please let me know and I'll add one. Co-authored-by: Jean Mertz <[email protected]>
| * | | | support remainder assignment operatorJean Mertz2019-03-173-0/+218
| | | | |
* | | | | Fix parse tree of attribute on match armpcpthm2019-03-174-133/+133
| |_|/ / |/| | |
* | | | Merge #985bors[bot]2019-03-171-57/+56
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 985: simplify parsing blocks a bit r=pcpthm a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | | | simplify parsing blocks a bitAleksey Kladov2019-03-171-57/+56
| | | | |
* | | | | Allow attribute on struct literal fieldpcpthm2019-03-173-1/+54
|/ / / /
* | | | docsAleksey Kladov2019-03-171-9/+15
| | | |
* | | | remove fixmeAleksey Kladov2019-03-171-2/+1
| | | |
* | | | remove old macro supportAleksey Kladov2019-03-178-261/+95
| | | |
* | | | rename ModuleId -> CrateModuleIdAleksey Kladov2019-03-178-39/+40
| | | |
* | | | fix error on wrong pathAleksey Kladov2019-03-174-12/+43
| | | |
* | | | log timeAleksey Kladov2019-03-171-0/+2
| | | |
* | | | Reorganize name resolutionAleksey Kladov2019-03-1714-522/+481
| | | |
* | | | hack around non-terminating macro expansionAleksey Kladov2019-03-171-0/+14
| | | |
* | | | remove lower moduleAleksey Kladov2019-03-1712-264/+48
| | | |
* | | | remove ItemMapAleksey Kladov2019-03-177-569/+59
| | | |
* | | | move tests over to crate-def-mapAleksey Kladov2019-03-179-850/+689
| | | |
* | | | Replace module_tree with CrateDefMapAleksey Kladov2019-03-1716-511/+333
| | | |
* | | | add name resolution from the old implAleksey Kladov2019-03-179-185/+739
| | | | | | | | | | | | | | | | unlike the old impl, this also handles macro imports across crates
* | | | add skeleton for macro-aware name resolutionsAleksey Kladov2019-03-178-9/+773
| | | |
* | | | Move the primary assist fn to the top of the fileIgor Matuszewski2019-03-161-30/+30
| | | |
* | | | Provide assist when cursor is immediately outside impl item blockIgor Matuszewski2019-03-161-14/+18
| | | |
* | | | Do a cleanup/legibility passIgor Matuszewski2019-03-161-21/+21
| | | |
* | | | Take into account parent indent when filling trait membersIgor Matuszewski2019-03-161-9/+41
| | | |