about summary refs log tree commit diff
path: root/crates/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2020-03-13Use WorkDoneProgress LSP API for initial loadSteffen Lyngbaek-6/+65
Addresses #3283 Rather than using custom UI for showing the loaded state. Rely on the WorkDoneProgress API in 3.15.0 https://microsoft.github.io/language-server-protocol/specification#workDoneProgress. No client-side work was necessary. The UI is not exactly what is described in the issue but afaict that's how VS Code implements the LSP API. - The WorkDoneProgressEnd does not appear to display its message contents (controlled by vscode)
2020-03-13Merge #3561 #3577bors[bot]-33/+59
3561: feat: add debug code lens r=matklad a=hdevalke Refs #3539 3577: Protect against infinite macro expansion in def collector r=edwin0cheng a=flodiebold Something I noticed while trying to make macro expansion more resilient against errors. There was a test for this, but it wasn't actually working because the first recursive expansion failed. (The comma...) Even with this limit, that test (when fixed) still takes some time to pass because of the exponential growth of the expansions, so I disabled it and added a different one without growth. CC @edwin0cheng Co-authored-by: Hannes De Valkeneer <hannes@de-valkeneer.be> Co-authored-by: hdevalke <2261239+hdevalke@users.noreply.github.com> Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-03-12fixup! feat: add debug code lensHannes De Valkeneer-16/+24
autodetect vscode-lldb
2020-03-12fixup! feat: add debug code lensHannes De Valkeneer-12/+12
avoid repetition of `--no-run`
2020-03-12Update crates/rust-analyzer/src/main_loop/handlers.rs hdevalke-1/+1
use `Vec::new` instead of `Vec::with_capacity(0)` Co-Authored-By: Veetaha <veetaha2@gmail.com>
2020-03-12Simpler deserializationAleksey Kladov-27/+32
2020-03-12Make naming more uniformAleksey Kladov-5/+5
2020-03-12Merge #3543bors[bot]-12/+25
3543: Parameter inlay hint separate from variable type inlay? #2876 r=matklad a=slyngbaek Add setting to allow enabling either type inlay hints or parameter inlay hints or both. Group the the max inlay hint length option into the object. - Add a new type for the inlayHint options. - Add tests to ensure the inlays don't happen on the server side Co-authored-by: Steffen Lyngbaek <steffenlyngbaek@gmail.com>
2020-03-11Switch from Vec<InlayKind> to object with propsSteffen Lyngbaek-22/+9
- Instead of a single object type, use several individual nested types to allow toggling from the settings GUI - Remove unused struct definitions - Install and test that the toggles work
2020-03-11feat: add debug code lensHannes De Valkeneer-27/+45
Refs #3539
2020-03-11Merge #3549bors[bot]-5/+43
3549: Implement env! macro r=matklad a=edwin0cheng This PR implements `env!` macro by adding following things: 1. Added `additional_outdirs` settings in vscode. (naming to be bikeshed) 2. Added `ExternSourceId` which is a wrapping for SourceRootId but only used in extern sources. It is because `OUT_DIR` is not belonged to any crate and we have to access it behind an `AstDatabase`. 3. This PR does not implement the `OUT_DIR` parsing from `cargo check`. I don't have general design about this, @kiljacken could we reuse some cargo watch code for that ? ~~Block on [#3536]~~ PS: After this PR , we (kind of) completed the `include!(concat!(env!('OUT_DIR'), "foo.rs")` macro call combo. [Exodia Obliterate!](https://www.youtube.com/watch?v=RfqNH3FoGi0) Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-10Deduplicate some Inlay definitionsSteffen Lyngbaek-36/+31
- Remove match conversion for InlayKind since we're using remote
2020-03-10Address Issues from GithubSteffen Lyngbaek-7/+37
- Updated naming of config - Define struct in ra_ide and use remote derive in rust-analyzer/config - Make inlayConfig type more flexible to support more future types - Remove constructor only used in tests
2020-03-10Parameter inlay hint separate from variable type inlay? #2876Steffen Lyngbaek-5/+6
Add setting to allow enabling either type inlay hints or parameter inlay hints or both. Group the the max inlay hint length option into the object. - Add a new type for the inlayHint options. - Add tests to ensure the inlays don't happen on the server side
2020-03-10Move FeatureFlagsAleksey Kladov-22/+95
2020-03-10Pull completion options up to the rust-analyzerAleksey Kladov-8/+20
2020-03-11Setup Env in worldEdwin Cheng-5/+37
2020-03-11Add additional_outdirs in configEdwin Cheng-0/+6
2020-03-09Fix SelectionRange return typekjeremy-4/+6
2020-03-09Merge #3526bors[bot]-3/+12
3526: Silence "file out of workspace" errors r=matklad a=matklad We really should fix this limitation of the VFS, but it's some way off at the moment, so let's just silence the user-visible error for now. Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-09Silence "file out of workspace" errorsAleksey Kladov-3/+12
We really should fix this limitation of the VFS, but it's some way off at the moment, so let's just silence the user-visible error for now.
2020-03-09Merge #3519bors[bot]-13/+11
3519: Show mod path on hover r=matklad a=SomeoneToIgnore Closes #1064 Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-03-09Ignore client-specific notificationsAleksey Kladov-0/+3
closes #3523
2020-03-08Consider crate declaration namesKirill Bulatov-13/+11
2020-03-06Concise mode for parameter hintsAleksey Kladov-15/+22
This works around VS Code bug where it tries to cram everything in a tiny popup, and brings experience closer to Intellij.
2020-03-06Trigger parameter info automaticallyAleksey Kladov-0/+10
See https://github.com/Microsoft/vscode/issues/64023
2020-03-06Source map returns a resultAleksey Kladov-2/+2
cc #2236
2020-03-06Unfold groups with single assists into plain assistsKirill Bulatov-58/+67
2020-03-05Merge #3475bors[bot]-2/+4
3475: Fix options for analysis-bench r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-05Fix options for analysis-benchAleksey Kladov-2/+4
2020-03-05Prime open files on loadAleksey Kladov-0/+5
2020-03-02Simplify by using to_veckjeremy-2/+2
2020-03-02lsp-types 0.72kjeremy-13/+10
2020-03-02Tighten up an assertAleksey Kladov-0/+4
2020-02-29Rename ast::ImplBlock -> ast::ImplDefAleksey Kladov-3/+3
2020-02-29Merge #3309bors[bot]-1/+4
3309: Find cargo toml up the fs r=matklad a=not-much-io Currently rust-analyzer will look for Cargo.toml in the root of the project and if failing that then go down the filesystem until root. This unfortunately wouldn't work automatically with (what I imagine is) a fairly common project structure. As an example with multiple languages like: ``` js/ .. rust/ Cargo.toml ... ``` Added this small change so rust-analyzer would glance one level up if not found in root or down the filesystem. ## Why not go deeper? Could be problematic with large project vendored dependencies etc. ## Why not add a Cargo.toml manual setting option? Loosely related and a good idea, however the convenience of having this automated also is hard to pass up. ## Testing? Build a binary with various logs and checked it in a project with such a structure: ``` [ERROR ra_project_model] find_cargo_toml() [ERROR ra_project_model] find_cargo_toml_up_the_fs() [ERROR ra_project_model] entities: ReadDir("/workspaces/my-project") [ERROR ra_project_model] candidate: "/workspaces/my-project/rust/Cargo.toml", exists: true ``` ## Edge Cases? If you have multiple Cargo.toml files one level deeper AND not in the root, will get whatever comes first (order undefined), example: ``` crate1/ Cargo.toml crate2/ Cargo.toml ... (no root Cargo.toml) ``` However this is quite unusual and wouldn't have worked before either. This is only resolvable via manually choosing. Co-authored-by: nmio <kristo.koert@gmail.com>
2020-02-29Fix a common false-positive type mismatchFlorian Diebold-9/+15
E.g. for `&{ some_string() }` in a context where a `&str` is expected, we reported a mismatch inside the block. The problem is that we're passing an expectation of `str` down, but the expectation is more of a hint in this case. There's a long comment in rustc about this, which I just copied. Also, fix reported location for type mismatches in macros.
2020-02-29lint warn fixnmio-4/+2
2020-02-29keep one CargoTomlNotFoundErrornmio-1/+6
2020-02-28Cleanup highlighting tagsAleksey Kladov-27/+35
2020-02-28add more tagsAleksey Kladov-4/+6
2020-02-27fixes and improvementsnmio-1/+1
2020-02-27Ensure that semantic tokens are single-lineAleksey Kladov-2/+9
2020-02-27Merge #3335bors[bot]-89/+89
3335: Refactor highlighting a bit r=matklad a=matklad bors r+ Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-27Color constantsAleksey Kladov-2/+4
2020-02-27Better highlightign APIAleksey Kladov-89/+87
2020-02-27Remove unused dependenciesShotaro Yamada-1/+0
2020-02-26Update lsp-typeskjeremy-1/+1
2020-02-26FixAleksey Kladov-1/+1
2020-02-26Fix bitset opsAleksey Kladov-2/+3