aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
Commit message (Collapse)AuthorAgeFilesLines
* Merge #8973bors[bot]2021-05-251-20/+45
|\ | | | | | | | | | | | | | | 8973: internal: move diagnostics to hir r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * internal: move diagnostics to hirAleksey Kladov2021-05-251-20/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea here is to eventually get rid of `dyn Diagnostic` and `DiagnosticSink` infrastructure altogether, and just have a `enum hir::Diagnostic` instead. The problem with `dyn Diagnostic` is that it is defined in the lowest level of the stack (hir_expand), but is used by the highest level (ide). As a first step, we free hir_expand and hir_def from `dyn Diagnostic` and kick the can up to `hir_ty`, as an intermediate state. The plan is then to move DiagnosticSink similarly to the hir crate, and, as final third step, remove its usage from the ide. One currently unsolved problem is testing. You can notice that the test which checks precise diagnostic ranges, unresolved_import_in_use_tree, was moved to the ide layer. Logically, only IDE should have the infra to render a specific range. At the same time, the range is determined with the data produced in hir_def and hir crates, so this layering is rather unfortunate. Working on hir_def shouldn't require compiling `ide` for testing.
* | Also do goto implementation on assoc constsJade2021-05-251-2/+26
| | | | | | | | | | | | | | | | I forgot to put this into #8988, sorry. Goto implementation on a const on the trait will go to the implementations with their respective definitions of the const, if present.
* | feat: go to implementation on trait functionsJade2021-05-251-1/+45
|/ | | | | | | Fix #8537. GIF: https://user-images.githubusercontent.com/6652840/119501981-45a45c00-bd1e-11eb-8336-9145f2888643.gif
* Add go to type definition for struct fields within structJade2021-05-251-0/+32
| | | | | | | | | | | | | | | Example: ```rust struct A; struct B { a/*<- cursor*/: A, } ``` Go to type definition used to not work on this position. It now goes to `A` as expected.
* Merge #8942bors[bot]2021-05-257-30/+121
|\ | | | | | | | | | | | | | | | | | | | | | | | | 8942: Add `library` semantic token modifier to items from other crates r=arzg a=arzg Closes #5772. A lot of code here is pretty repetitive; please let me know if you have any ideas how to improve it, or whether it’s fine as-is. Side-note: How can I add tests for this? I don’t see a way for the test Rust code in `test_highlighting` to reference other crates to observe the new behaviour. Co-authored-by: Aramis Razzaghipour <[email protected]>
| * Refactor application of `library` semantic token modifierAramis Razzaghipour2021-05-251-62/+15
| |
| * Remove superfluous early-returnsAramis Razzaghipour2021-05-241-18/+22
| |
| * Rename ‘foreign’ semantic token modifier to ‘library’Aramis Razzaghipour2021-05-243-18/+18
| |
| * Add testing of foreign item highlightingAramis Razzaghipour2021-05-242-1/+55
| |
| * Highlight foreign modules as suchAramis Razzaghipour2021-05-241-1/+9
| |
| * Remove hir krate methodsAramis Razzaghipour2021-05-243-11/+11
| |
| * Add highlighting of items from other cratesAramis Razzaghipour2021-05-243-12/+84
| |
* | Bump misc depsLaurențiu Nicola2021-05-241-3/+3
| |
* | Correctly resolve crate name in use paths when import shadows itselfLukas Tobias Wirth2021-05-231-0/+20
| |
* | Minor: fix comment styleAleksey Kladov2021-05-231-1/+3
|/ | | | See https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/style.md#documentation
* Give ‘unsafe’ semantic token modifier to unsafe traitsAramis Razzaghipour2021-05-234-3/+16
|
* Add more docsAleksey Kladov2021-05-222-3/+5
|
* Add a "Debug ItemTree" LSP requestJonas Schievink2021-05-212-0/+21
|
* Fix prepare_rename failing for modulesLukas Tobias Wirth2021-05-191-5/+7
|
* Add pub mod option for UnlinkedFilerainy-me2021-05-1812-121/+158
|
* fix: don't add extra whitespace around fieldsAleksey Kladov2021-05-171-0/+25
| | | | closes #8785
* minor: add missing testsAleksey Kladov2021-05-172-0/+52
|
* internal: scalable module structure for fixitsAleksey Kladov2021-05-178-766/+693
|
* minor: extract fix to fileAleksey Kladov2021-05-172-44/+196
|
* Merge #8853bors[bot]2021-05-162-4/+4
|\ | | | | | | | | | | | | | | | | 8853: Tag Self in impls as a TypeAlias r=matklad a=Veykril bors r+ Fixes #4398 Co-authored-by: Lukas Wirth <[email protected]>
| * Tag Self in impls as a TypeAliasLukas Wirth2021-05-162-4/+4
| |
* | internal: use mutable syntax trees when filling fieldsAleksey Kladov2021-05-162-6/+7
| |
* | Merge #8813bors[bot]2021-05-162-2/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8813: Get some more array lengths! r=lf- a=lf- This is built on #8799 and thus contains its changes. I'll rebase it onto master when that one gets merged. It adds support for r-a understanding the length of: * `let a: [u8; 2] = ...` * `let a = b"aaa"` * `let a = [0u8; 4]` I have added support for getting the values of byte strings, which was not previously there. I am least confident in the correctness of this part and it probably needs some more tests, as we currently have only one test that exercised that part (!). Fixes #2922. Co-authored-by: Jade <[email protected]>
| * | Support length for ByteStringsJade2021-05-132-2/+2
| | | | | | | | | | | | I am not confident that my added byte string parsing is right.
* | | Attach comments to ast::ImplLukas Wirth2021-05-152-1/+25
| | |
* | | simplifyLukas Wirth2021-05-152-10/+8
| |/ |/|
* | Address commentshi-rustin2021-05-143-3/+25
| |
* | Apply async semantic token modifier to async/await keywordshi-rustin2021-05-142-0/+11
| | | | | | | | Only async semantic token modifier
* | Merge #8823bors[bot]2021-05-131-4/+4
|\ \ | |/ |/| | | | | | | | | | | 8823: Enable OPTION::ENABLE_TASKLISTS in pulldown_cmark r=Veykril a=Veykril Closes #8821 Co-authored-by: Lukas Wirth <[email protected]>
| * Enable OPTION::ENABLE_TASKLISTS in pulldown_cmarkLukas Wirth2021-05-131-4/+4
| |
* | Merge #8799bors[bot]2021-05-121-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8799: Add basic support for array lengths in types r=flodiebold a=lf- This recognizes `let a = [1u8, 2, 3]` as having type `[u8; 3]` instead of the previous `[u8; _]`. Byte strings and `[0u8; 2]` kinds of range array declarations are unsupported as before. I don't know why a bunch of our rustc tests had single quotes inside strings un-escaped by `UPDATE_EXPECT=1 cargo t`, but I don't think it's bad? Maybe something in a nightly? Co-authored-by: Jade <[email protected]>
| * | Add basic support for array lengths in typesJade2021-05-111-1/+1
| |/ | | | | | | | | | | | | | | | | | | This recognizes `let a = [1u8, 2, 3]` as having type `[u8; 3]` instead of the previous `[u8; _]`. Byte strings and `[0u8; 2]` kinds of range array declarations are unsupported as before. I don't know why a bunch of our rustc tests had single quotes inside strings un-escaped by `UPDATE_EXPECT=1 cargo t`, but I don't think it's bad? Maybe something in a nightly?
* | Move `dot` invocation to rust-analyzer crateJonas Schievink2021-05-112-23/+3
| |
* | Better node label/shapesJonas Schievink2021-05-111-3/+11
| |
* | Only include workspace cratesJonas Schievink2021-05-111-8/+30
| |
* | Update crates/ide/src/view_crate_graph.rsJonas Schievink2021-05-111-2/+2
| | | | | | Co-authored-by: bjorn3 <[email protected]>
* | Distinguish crates with identical nameJonas Schievink2021-05-111-1/+1
| |
* | Allow viewing the crate graph in a webviewJonas Schievink2021-05-113-0/+87
|/
* feat: auto-indent use tree listsJonas Schievink2021-05-101-0/+115
|
* feat: auto-insert `}` when typing `{` in use itemJonas Schievink2021-05-091-19/+131
|
* minor: fix test styleAleksey Kladov2021-05-091-12/+0
|
* fix: join lines doesn't add space before closing quoteAleksey Kladov2021-05-091-0/+30
|
* fix: join lines doesn't add space before closing quoteAleksey Kladov2021-05-091-9/+32
|
* Don't handle Self as a usage for TraitDefsLukas Wirth2021-05-081-22/+27
|