aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Use pub(crate)Jonas Schievink2021-03-151-3/+3
| | | |
| * | | Redo it properly and add a quickfixJonas Schievink2021-03-152-7/+308
| | | |
| * | | Diagnose files that aren't in the module treeJonas Schievink2021-03-101-3/+13
| | | |
* | | | Don't drop type params in doc-test pathsLukas Wirth2021-03-141-4/+51
| |/ / |/| |
* | | Merge #7799bors[bot]2021-03-132-6/+347
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7799: Related tests r=matklad a=vsrs ![tests](https://user-images.githubusercontent.com/62505555/109397453-a9013680-7947-11eb-8b11-ac03079f7645.gif) This adds an ability to look for tests for the item under the cursor: function, constant, data type, etc The LSP part is bound to change. But the feature itself already works and I'm looking for a feedback :) Co-authored-by: vsrs <[email protected]>
| * | Add `Feature: Related Tests` commentvsrs2021-03-111-0/+13
| | |
| * | Apply review suggestionsvsrs2021-03-111-2/+5
| | |
| * | Remove erroneous commentvsrs2021-02-271-10/+0
| | |
| * | Add runnables::related_testsvsrs2021-02-272-6/+341
| | |
* | | remove unused CompletionScore enumJosh Mcguigan2021-03-121-2/+2
| | |
* | | add completion relevance scoreJosh Mcguigan2021-03-121-2/+2
| | |
* | | Return original text range in PrepareRename responses when inside macroLukas Wirth2021-03-101-7/+47
| |/ |/|
* | Merge #7958bors[bot]2021-03-101-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 7958: Avoid double text edits when renaming mod declaration r=matklad a=Veykril Closes https://github.com/rust-analyzer/rust-analyzer/issues/7916 See https://github.com/microsoft/vscode-languageserver-node/issues/752 for context Co-authored-by: Lukas Wirth <[email protected]>
| * | Avoid double text edits when renaming mod declarationLukas Wirth2021-03-101-0/+1
| | |
* | | add apply ssr assistJosh Mcguigan2021-03-102-1/+266
|/ /
* | Show whether a binding is mutable or not on hoverLukas Wirth2021-03-092-21/+46
| |
* | Don't show const items initializer expressions on hoverLukas Wirth2021-03-091-5/+1
| |
* | Work towards better import labelsKirill Bulatov2021-03-081-2/+0
| |
* | Use upstream cov-markLaurențiu Nicola2021-03-087-52/+50
| |
* | Fix some warningsLaurențiu Nicola2021-03-051-1/+1
| |
* | Prevent renaming SelfType and BuiltinTypeLukas Wirth2021-03-031-0/+2
| |
* | Reorder functions in rename.rsLukas Wirth2021-03-031-189/+187
| |
* | Merge #7850bors[bot]2021-03-021-12/+62
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | 7850: Don't add space when joining line to opening quote r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Don't add space when joining line to opening quoteAleksey Kladov2021-03-021-12/+62
| | |
* | | Merge #7795bors[bot]2021-03-021-13/+122
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7795: Show docs on hover for keywords and primitives r=matklad a=Veykril ![lAWFadkziX](https://user-images.githubusercontent.com/3757771/109369534-eeb4f500-789c-11eb-8f2b-2f9c4e129de3.gif) It's a bit annoying that this requires the `SyntaxNode` and `Semantics` to be pulled through `hover_for_definition` just so we can get the `std` crate but I couldn't think of a better way. Co-authored-by: Lukas Wirth <[email protected]>
| * | | Show docs on hover for keywords and primitivesLukas Wirth2021-03-021-13/+122
| |/ /
* | | Merge #7335 #7691bors[bot]2021-03-021-8/+47
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7335: added region folding r=matklad a=LucianoBestia Regions of code that you'd like to be folded can be wrapped with `// #region` and `// #endregion` line comments. This is called "Region Folding". It is originally available for many languages in VSCode. But Rust-analyzer has its own folding function and this is missing. With this Pull Request I am suggesting a simple solution. The regions are a special kind of comments, so I added a bit of code in the comment folding function. The regex to match are: `^\s*//\s*#?region\b` and `^\s*//\s*#?endregion\b`. The number of space characters is not important. There is an optional # character. The line can end with a name of the region. Example: ```rust // 1. some normal comment // region: test // 2. some normal comment calling_function(x,y); // endregion: test ``` I added a test for this new functionality in `folding_ranges.rs`. Please, take a look and comment. I found that these exact regexes are already present in the file `language-configuration.json`, but I don't find a way to read this configuration. So my regex is hardcoded in the code. 7691: Suggest name in extract variable r=matklad a=cpud36 Generate better default name in extract variable assist as was mentioned in issue #1587 # Currently supported (in order of declining precedence) 1. Expr is argument to a function; use corresponding parameter name 2. Expr is result of a function or method call; use this function/method's name 3. Use expr type name (if possible) 4. Fallback to `var_name` otherwise # Showcase ![generate_derive_variable_name_from_method](https://user-images.githubusercontent.com/4218373/108013304-72105400-701c-11eb-9f13-eec52e74d0cc.gif) ![generate_derive_variable_name_from_param](https://user-images.githubusercontent.com/4218373/108013305-72a8ea80-701c-11eb-957e-2214f7f005de.gif) # Questions * Should we more aggressively strip known types? E.g. we already strip `&T -> T`; should we strip `Option<T> -> T`, `Result<T, E> -> T`, and others? * Integers and floats use `var_name` by default. Should we introduce a name, like `i`, `f` etc? * Can we return a list and suggest a name when renaming(like IntelliJ does)? * Should we add counters to remove duplicate variables? E.g. `type`, `type1`, type2`, etc. Co-authored-by: Luciano Bestia <[email protected]> Co-authored-by: Luciano <[email protected]> Co-authored-by: Vladyslav Katasonov <[email protected]>
| * | removed logging stuffLuciano Bestia2021-02-131-7/+0
| | |
| * | Update crates/ide/src/folding_ranges.rsLuciano2021-02-131-2/+2
| | | | | | | | | Co-authored-by: Lukas Wirth <[email protected]>
| * | simple comparison instead of regexLuciano Bestia2021-02-051-21/+7
| | |
| * | added region foldingLuciano Bestia2021-01-181-8/+68
| | |
* | | Merge #7778bors[bot]2021-03-011-0/+29
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7778: Fix lowering trailing self paths in UseTrees r=Veykril a=Veykril Noticed that hovering over `self` in a use tree like `use foo::bar::{self}` showing documentation and such for the current module instead of `bar`. Co-authored-by: Lukas Wirth <[email protected]>
| * | | Fix lowering trailing self paths in UseTreesLukas Wirth2021-02-281-0/+29
| | |/ | |/|
* | | Update vscode README with a small features listLukas Wirth2021-03-012-0/+18
| | |
* | | For unresolved macros, hightlight only the last segmentAleksey Kladov2021-02-281-11/+56
|/ /
* | Pickup ConstReference patterns in FindUsagesLukas Wirth2021-02-231-0/+25
| |
* | 7526: Renamed create ssr to ide_ssr.Chetan Khilosiya2021-02-221-3/+4
| |
* | 7526: Rename crate assists to ide_assists.Chetan Khilosiya2021-02-224-4/+4
| |
* | Merge #7732bors[bot]2021-02-201-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7732: Don't lower TypeBound::Lifetime as GenericPredicate::Error r=flodiebold a=Veykril Basically we just discard the typebound for now instead when lowering to `GenericPredicate`. I think this shouldn't have any other side effects? Fixes #7683(hopefully for real this time) I also played around with introducing `GenericPredicate::LifetimeOutlives` and `GenericPredicate::TypeOutlives`(see https://github.com/Veykril/rust-analyzer/commit/b9d69048451a5f2e9c5a72c800369bbeef36fdcf) but that won't fix this issue(at least not for now) due to lifetime predicate mismatches when resolving methods so I figure this is a good way to fix it for now. Co-authored-by: Lukas Wirth <[email protected]>
| * | Don't lower TypeBound::Lifetime as GenericPredicate::ErrorLukas Wirth2021-02-201-2/+2
| | |
* | | Remove documentation of obsolete extend selection commandLaurențiu Nicola2021-02-201-3/+5
|/ /
* | rename completion -> ide_completionAleksey Kladov2021-02-171-4/+4
| | | | | | | | We don't have completion-related PRs in flight, so lets do it
* | Merge #7699bors[bot]2021-02-172-58/+31
|\ \ | | | | | | | | | | | | | | | | | | | | | 7699: Implement ast::AstNode for NameLike and move it to node_ext r=matklad a=Veykril With this `search`(and 2 other modules) don't necessarily go through 3 calls of `find_node_at_offset_with_descend` to find the correct node. Also makes the code that searches for NameLikes a bit easier on the eyes imo, though that can be fixed with just a helper function as well so its not that relevant. Co-authored-by: Lukas Wirth <[email protected]>
| * | Implement ast::AstNode for NameLike and move it to node_extLukas Wirth2021-02-162-58/+31
| | |
* | | Merge #7705bors[bot]2021-02-171-2/+38
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7705: Show hover info of the definition of ConstReference patterns instead of its type r=Veykril a=Veykril Closes #7671 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * | | Show hover info of the definition of ConstReference patterns instead of its typeLukas Wirth2021-02-171-2/+38
| |/ /
* / / Allow comments between newlines in chaining hintsPaco Soberón2021-02-161-16/+22
|/ /
* | Merge #7657bors[bot]2021-02-161-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7657: utf8 r=matklad a=matklad - Prepare for utf-8 offsets - reduce code duplication in tests - Make utf8 default, implement utf16 in terms of it - Make it easy to add additional context for offset conversion - Implement utf8 offsets closes #7453 Co-authored-by: Aleksey Kladov <[email protected]>
| * | Make utf8 default, implement utf16 in terms of itAleksey Kladov2021-02-161-1/+1
| | |
| * | Prepare for utf-8 offsetsAleksey Kladov2021-02-161-1/+1
| | |