aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge #6280bors[bot]2020-10-191-6/+6
|\ | | | | | | | | | | | | | | | | 6280: :arrow_up: crates r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * :arrow_up: cratesAleksey Kladov2020-10-191-6/+6
|/
* Merge #6277bors[bot]2020-10-182-5/+19
|\ | | | | | | | | | | | | | | | | 6277: Change visibility works for type aliases r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * Change visibility works for type aliasesAleksey Kladov2020-10-182-5/+19
|/
* Merge #6276bors[bot]2020-10-1834-227/+337
|\ | | | | | | | | | | | | | | | | | | | | | | | | 6276: Extract call_info and completion into separate crates r=matklad a=popzxc As it was discussed in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Completion.20refactoring), we need to move `completions` into a separate crate. Unfortunately, the dependency on `call_info::ActiveParameter` doesn't look easy to get rid of, and it seems to be a topic for a separate PR, thus I also extracted `call_info` into a separate crate (on which both `ide` and `completion` crates depend). Additionally, a few `FIXME`s in doc-comments were resolved in order to make `tidy` happy. Co-authored-by: Igor Aleksanov <[email protected]>
| * Extract call_info and completion into separate cratesIgor Aleksanov2020-10-1834-227/+337
|/
* Merge #6275bors[bot]2020-10-181-14/+6
|\ | | | | | | | | | | | | | | | | | | | | 6275: Textmate grammar: prevent unwanted interpolation scopes r=matklad a=dustypomerleau Fixes the issues noted by @matklad after merging #6248. 1. prevent accidental interpolation scopes when `{` is used in a string 1. prevent interpolations from extending beyond the end of a string Co-authored-by: Dusty Pomerleau <[email protected]>
| * fix: prevent unwanted interpolation scopesDusty Pomerleau2020-10-181-14/+6
|/
* Merge #6272bors[bot]2020-10-182-9/+9
|\ | | | | | | | | | | | | | | | | 6272: :arrow_up: xshell r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * update depsAleksey Kladov2020-10-182-5/+5
| |
| * :arrow_up: xshellAleksey Kladov2020-10-181-4/+4
|/
* Merge #6271bors[bot]2020-10-173-2/+20
|\ | | | | | | | | | | | | | | | | 6271: Complete methods when receiver is a macro r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * Complete methods when receiver is a macroAleksey Kladov2020-10-172-0/+16
| |
| * Improve readabilityAleksey Kladov2020-10-171-2/+4
| |
* | Merge #6248bors[bot]2020-10-171-3/+22
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6248: Textmate grammar: prevent early termination of raw strings with hash (closes #6042) r=matklad a=dustypomerleau Problematic sample code from #6042: ```rust #[derive(Debug, Clone, Logos)] enum Quoted<'source> { #[regex(r#"[^\\"']+"#)] Text(&'source str), #[token("\\")] StartEscape, #[token("\'", |_| Quote::Single)] #[token("\"", |_| Quote::Double)] End(Quote), #[error] Error, } ``` Before fix: <img width="400" alt="Screen Shot 2020-10-16 at 10 45 59" src="https://user-images.githubusercontent.com/6304651/96198390-6a726d00-0fa0-11eb-8428-e76b2866836b.png"> After fix: <img width="400" alt="Screen Shot 2020-10-16 at 10 45 33" src="https://user-images.githubusercontent.com/6304651/96198408-7a8a4c80-0fa0-11eb-9104-ca708009fe63.png"> Co-authored-by: Dusty Pomerleau <[email protected]>
| * fix: prevent early termination of raw strings with hashDusty Pomerleau2020-10-161-3/+22
| |
* | Merge #6265bors[bot]2020-10-171-8/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 6265: :arrow_up: xshell r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | :arrow_up: xshellAleksey Kladov2020-10-171-8/+8
|/ /
* | Merge #6262bors[bot]2020-10-174-5/+131
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6262: Do not spawn redundant hints r=SomeoneToIgnore a=popzxc Closes #5206 This is a second part of the fix (first was #5997). This PR adds a new method to the `CompletionContext`: `no_completion_required`. If this method returns `true`, it essentially means that user is unlikely to expect any hints from the IDE at this cursor position. Currently, checks for the following cases were added: - Previous item is `fn`: user creates a new function, names of existing functions won't be helpful. Exception for this case is `impl Foo for Bar` -- we must suggest trait function names. - User entered `for _ i<|>`: it's obviously going to be `in` keyword, any hints here will be confusing. More checks may be added there later, but currently I've only figured two cases. ![no_redundant_hints](https://user-images.githubusercontent.com/12111581/96332088-da4d2a00-106a-11eb-89a1-1159ece18f9d.png) Co-authored-by: Igor Aleksanov <[email protected]>
| * | Scan all ancestors for the impl trait block checkIgor Aleksanov2020-10-172-14/+17
| | |
| * | Allow hints after 'fn' keyword if it's an impl trait blockIgor Aleksanov2020-10-173-4/+37
| | |
| * | Add test for new pattern functionsIgor Aleksanov2020-10-171-0/+8
| | |
| * | Improve test_no_completions_required testIgor Aleksanov2020-10-171-1/+17
| | |
| * | Remove redundant completionsIgor Aleksanov2020-10-173-4/+70
|/ /
* | Merge #6260bors[bot]2020-10-1714-325/+181
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 6260: xshell r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Switch from not_bash to xshellAleksey Kladov2020-10-1714-325/+181
|/ /
* | Merge #6253bors[bot]2020-10-161-0/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 6253: Document change of 'cargo' Runnable kind in lsp-extensions.md r=lnicola a=popzxc As was requested in https://github.com/rust-analyzer/rust-analyzer/pull/5954#issuecomment-708325521 Co-authored-by: Igor Aleksanov <[email protected]>
| * | Document change of 'cargo' Runnable kind in lsp-extensions.mdIgor Aleksanov2020-10-161-0/+3
| | |
* | | Merge #6255bors[bot]2020-10-164-10/+13
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | 6255: Improve compile time a tiny bit r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Improve compile time a tiny bitAleksey Kladov2020-10-164-10/+13
|/ /
* | Merge #6245bors[bot]2020-10-161-10/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | 6245: Update GNOME Builder docs r=lnicola a=lnicola Co-authored-by: Laurențiu Nicola <[email protected]>
| * | Update GNOME Builder docsLaurențiu Nicola2020-10-151-10/+1
| | |
* | | Merge #6246bors[bot]2020-10-161-8/+9
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6246: Follow symlinks when walking project trees r=lnicola a=dfoxfranke Fixes #3691. ~~WIP pending further testing~~: - [X] Verify that symlinked files get indexed. - [x] Verify that files in symlinked directories get indexed. - [x] Verify that inotify events are properly received and handled when the target of a symlink resides outside the project tree. Co-authored-by: Daniel Fox Franke <[email protected]>
| * | | Follow symlinks when walking project treesDaniel Fox Franke2020-10-151-8/+9
| | | | | | | | | | | | | | | | Fixes #3691
* | | | Merge #6250bors[bot]2020-10-161-11/+50
|\ \ \ \ | |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | 6250: Expand code order section r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | Expand code order sectionAleksey Kladov2020-10-161-11/+50
| | |/ | |/|
* | | Merge #6220bors[bot]2020-10-153-5/+126
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6220: implement binary operator overloading type inference r=flodiebold a=ruabmbua Extend type inference of *binary operator expression*, by adding support for operator overloads. Before this merge request, the type inference of binary expressions could only resolve operations done on built-in primitive types. This merge requests adds a code path, which is executed in case the built-in inference could not get any results. It resolves the proper operator overload trait in *core::ops* via lang items, and then resolves the associated *Output* type. ```rust struct V2([f32; 2]); #[lang = "add"] pub trait Add<Rhs = Self> { /// The resulting type after applying the `+` operator. type Output; /// Performs the `+` operation. #[must_use] fn add(self, rhs: Rhs) -> Self::Output; } impl Add<V2> for V2 { type Output = V2; fn add(self, rhs: V2) -> V2 { let x = self.0[0] + rhs.0[0]; let y = self.0[1] + rhs.0[1]; V2([x, y]) } } fn test() { let va = V2([0.0, 1.0]); let vb = V2([0.0, 1.0]); let r = va + vb; // This infers to V2 now } ``` There is a problem with operator overloads, which do not explicitly set the *Rhs* type parameter in the respective impl block. **Example:** ```rust impl Add for V2 { type Output = V2; fn add(self, rhs: V2) -> V2 { let x = self.0[0] + rhs.0[0]; let y = self.0[1] + rhs.0[1]; V2([x, y]) } } ``` In this case, the trait solver does not realize, that the *Rhs* type parameter is actually self in the context of the impl block. This stops type inference in its tracks, and it can not resolve the associated *Output* type. I guess we can still merge this back, because it increases the amount of resolved types, and does not regress anything (in the tests). Somewhat blocked by https://github.com/rust-analyzer/rust-analyzer/issues/5685 Resolves https://github.com/rust-analyzer/rust-analyzer/issues/5544 Co-authored-by: Roland Ruckerbauer <[email protected]>
| * | binary operator overload type inference: add test markRoland Ruckerbauer2020-10-142-0/+6
| | |
| * | Implement binary operator overloading type inferenceRoland Ruckerbauer2020-10-133-5/+120
| | |
* | | Merge #6244bors[bot]2020-10-151-0/+12
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6244: Document awkward names r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | Document awkward namesAleksey Kladov2020-10-151-0/+12
|/ / /
* | | Merge #6243bors[bot]2020-10-1511-215/+228
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6243: Clarify classification API r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | Clarify the names one more timeAleksey Kladov2020-10-157-17/+26
| | | |
| * | | More idiomatic classification APIAleksey Kladov2020-10-1511-196/+196
| | | |
| * | | More clarificationsAleksey Kladov2020-10-156-17/+17
| | | |
| * | | Unconfuse expression and pattern field init shorthandsAleksey Kladov2020-10-153-8/+12
| | | |
| * | | Clarify NameClass names a bitAleksey Kladov2020-10-156-7/+7
|/ / /
* | | Merge #6242bors[bot]2020-10-152-91/+210
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 6242: Diagnost shorthand in patterns r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | | Move field_shorthand to a separate moduleAleksey Kladov2020-10-152-196/+211
| | | |
| * | | Diagnose shorthand in patterns as wellAleksey Kladov2020-10-151-5/+94
| | | |