aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src
Commit message (Collapse)AuthorAgeFilesLines
* Add new LSP extension for workspace symbol lookupalcroito2021-05-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new extension allows filtering of workspace symbool lookup results by search scope or search kind. Filtering can be configured in 3 different ways: - The '#' or '*' markers can be added inline with the symbol lookup query. The '#' marker means symbols should be looked up in the current workspace and any dependencies. If not specified, only current workspace is considered. The '*' marker means all kinds of symbols should be looked up (types, functions, etc). If not specified, only type symbols are returned. - Each LSP request can take an optional search_scope or search_kind argument query parameter. - Finally there are 2 global config options that can be set for all requests served by the active RA instance. Add support for setting the global config options to the VSCode extension. The extension does not use the per-request way, but it's useful for other IDEs. The latest version of VSCode filters out the inline markers, so currently the only reasonable way to use the new functionality is via the global config.
* internal: remove SyntaxRewriterAleksey Kladov2021-05-141-1/+3
|
* internal: remove one more immutable treeAleksey Kladov2021-05-141-14/+20
|
* Give MergeBehaviour variants better namesLukas Wirth2021-05-102-45/+53
|
* internal: introduce `ast::make::ext` module with common shortcutsAleksey Kladov2021-05-092-4/+4
| | | | | | | | | | There's a tension between keeping a well-architectured minimal orthogonal set of constructs, and providing convenience functions. Relieve this pressure by introducing an dedicated module for non-orthogonal shortcuts. This is inspired by the django.shortcuts module which serves a similar purpose architecturally.
* Don't handle Self as a usage for TraitDefsLukas Wirth2021-05-081-1/+0
|
* Fix builtintype def_to_tyLukas Wirth2021-05-081-8/+14
|
* Correctly support SelfType when searching for usagesLukas Wirth2021-05-081-70/+102
|
* internal: use API stabilized in 1.52Aleksey Kladov2021-05-061-4/+3
|
* Split out merge_imports module from helpers::insert_useLukas Wirth2021-04-243-318/+318
|
* Merge #8591 #8638bors[bot]2021-04-232-179/+142
|\ | | | | | | | | | | | | | | | | | | | | | | 8591: Remove SyntaxRewriter usage in insert_use in favor of mutable syntax trees r=matklad a=Veykril Unfortunately changing `insert_use` to not use `SyntaxRewriter` creates a lot of changes since so much relies on that. But on the other hand this should be the biggest usage of `SyntaxRewriter` I believe. 8638: Remove SyntaxRewriter::from_fn r=Veykril a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
* \ Merge #8317bors[bot]2021-04-231-7/+51
|\ \ | | | | | | | | | | | | | | | | | | | | | 8317: Convert tuple struct to named struct assist r=Veykril a=unexge Closes https://github.com/rust-analyzer/rust-analyzer/issues/8192 Co-authored-by: unexge <[email protected]>
| * | Use multiple loops instead of `Iterator::chain` in `FindUsages`unexge2021-04-211-13/+22
| | |
| * | Add convert tuple struct to named struct assistunexge2021-04-041-9/+9
| | |
| * | Allow including `Self` kw references to `FindUsages`unexge2021-04-041-4/+39
| | |
| | * Add cov_marks to insert_use testsLukas Wirth2021-04-202-1/+39
| | |
| | * Remove SyntaxRewriter usage in insert_use in favor of tedLukas Wirth2021-04-202-178/+103
| |/ |/|
* | Check for rust doc code attributes like rustdoc doesLukas Wirth2021-04-192-0/+35
| |
* | Merge #8467bors[bot]2021-04-192-0/+12
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8467: Adds impl Deref assist r=jhgg a=jhgg This PR adds a new `generate_deref` assist that automatically generates a deref impl for a given struct field. Check out this gif: ![2021-04-11_00-33-33](https://user-images.githubusercontent.com/5489149/114296006-b38e1000-9a5d-11eb-9112-807c01b8fd0a.gif) -- I have a few Q's: - [x] Should I write more tests, if so, what precisely should I test for? - [x] I have an inline question on line 65, can someone provide guidance? :) - [x] I can implement this for `ast::TupleField` too. But should it be a separate assist fn, or should I try and jam both into the `generate_deref`? - [x] I want to follow this up with an assist on `impl $0Deref for T {` which would automatically generate a `DerefMut` impl that mirrors the Deref as well, however, I could probably use some pointers on how to do that, since I'll have to reach into the ast of `fn deref` to grab the field that it's referencing for the `DerefMut` impl. Co-authored-by: jake <[email protected]>
| * | Adds impl Deref assistjake2021-04-112-0/+12
| | |
* | | Merge #8546bors[bot]2021-04-162-2/+35
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8546: Return CallInfo for unclosed call expressions r=Veykril a=Veykril Closes #8522 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * | | Return CallInfo for unclosed call expressionsLukas Wirth2021-04-162-2/+35
| | | |
* | | | Exclude inherent traits from flyimportsKirill Bulatov2021-04-161-6/+16
|/ / /
* / / Profile trait solving for all invocationsKirill Bulatov2021-04-141-1/+1
|/ /
* / Avoid O(n²) when constructing AttrSourceMapJonas Schievink2021-04-061-0/+4
|/
* Convert Into to From assistGraeme Coupar2021-04-032-1/+9
| | | | | | | | | | | | This adds a "Convert Into to From" assist, useful since clippy has recently started adding lints on every `Into`. It covers converting the signature, and converting any `self`/`Self` references within the body to the correct types. It does assume that every instance of `Into` can be converted to a `From`, which I _think_ is the case now. Let me know if there's something I'm not thinking of and I can try and make it smarter.
* Merge #8267bors[bot]2021-03-311-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8267: Adding gifs and screenshots for features in manual r=matklad a=MozarellaMan For #6539 This includes most of gif or screenshot examples of most items in the "Features" header. With the exceptions of: - **On Typing Assists** - couldn't get it to work for a demo, I'm probably missing something? - **Structural search and replace** - looked to be already a visual example of the feature - **Workspace symbol** - wasn't sure how best to show this, all of the examples maybe? Also wasn't sure of the best code example to show it off - **Semantic Syntax Highlighting** - seemed obvious enough to not need a screenshot, but I could easily add this All the gifs/pngs are hosted in this [comment](https://github.com/rust-analyzer/rust-analyzer/issues/6539#issuecomment-809574840). Please let me know if any of them aren't suitable (and why) and I'll improve it! Or if you don't like the theme/font Co-authored-by: Ayomide Bamidele <[email protected]>
| * Gifs and screenshots for features in manualAyomide Bamidele2021-03-311-0/+1
| |
* | Merge #8186bors[bot]2021-03-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | 8186: Lower traits to `TraitRef` instead of `TypeRef` r=matklad a=Veykril Co-authored-by: Lukas Wirth <[email protected]>
| * | Rename target_ty to self_tyLukas Wirth2021-03-291-1/+1
| |/
* / Accurately classify assoc. types in pathsJonas Schievink2021-03-301-18/+23
|/
* Merge #8212bors[bot]2021-03-282-2/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | 8212: Basic support macro 2.0 r=jonas-schievink a=edwin0cheng Turn out it is quite straight forward :) r @jonas-schievink ![m2](https://user-images.githubusercontent.com/11014119/112712565-6eb99380-8f0b-11eb-88de-5d7f974dfe6d.png) Co-authored-by: Edwin Cheng <[email protected]>
| * Unleash macro 2.0 in hightlight and moreEdwin Cheng2021-03-272-2/+3
| |
* | Cleanup ide_db importsLukas Wirth2021-03-278-10/+15
|/
* syntax: return owned string instead of leaking stringcynecx2021-03-263-3/+3
|
* Sweep the new TraitEnvironmentQueryJonas Schievink2021-03-241-0/+1
|
* Cleanup Definition::search_scopeLukas Wirth2021-03-231-83/+94
|
* Merge hir::MacroDef::is_* into hir::MacroDef::kindLukas Wirth2021-03-231-1/+1
|
* Set up a search scope when searching for mbe macro referencesLukas Wirth2021-03-231-4/+21
|
* Compute more mathematically well-rounded notion of transitive depsAleksey Kladov2021-03-231-3/+1
| | | | | | | | By including the crate itself, we make the resulting set closed with respect to `transitve_reveres_dependencies` operation, as it becomes a proper transitive closure. This just feels more proper and mathy. And, indeed, this actually allows us to simplify call sites somewhat.
* rewrite merge use trees assist to use muatable syntax treesAleksey Kladov2021-03-221-2/+2
| | | | changelog internal
* Reexport PrefixKind to remove deps to hirEdwin Cheng2021-03-221-1/+3
|
* Fix the profile stringKirill Bulatov2021-03-211-1/+1
|
* Less reallocationsKirill Bulatov2021-03-212-19/+12
|
* Use smart case in flyimport items lookupKirill Bulatov2021-03-212-3/+22
|
* Merge #8123bors[bot]2021-03-212-199/+179
|\ | | | | | | | | | | | | | | | | | | | | | | 8123: Do not display unqualified assoc item completions r=SomeoneToIgnore a=SomeoneToIgnore Part of https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/autoimport.20weirdness Removes all flyimport completions for any unqualified associated type, effectively reverting https://github.com/rust-analyzer/rust-analyzer/pull/8095 I've explained the reasoning in the corresponding FIXME and open to discussions. As an alternative way, we could add yet another parameter in the method that's used by the `qualify_path` and enable it for the qualify assists only. Co-authored-by: Kirill Bulatov <[email protected]>
| * Disable unqualified assoc items completion for nowKirill Bulatov2021-03-201-1/+8
| |
| * DocsKirill Bulatov2021-03-202-10/+16
| |
| * Do not query item search by name eagerlyKirill Bulatov2021-03-202-197/+162
| |
| * Do not propose assoc items without qualifiersKirill Bulatov2021-03-201-3/+5
| |