about summary refs log tree commit diff
path: root/crates/rust-analyzer/src
AgeCommit message (Collapse)AuthorLines
2021-01-12fix as suggestion.ShuiRuTian-9/+5
2021-01-12Update crates/rust-analyzer/src/handlers.rsSong Gao-3/+1
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-01-12Update crates/rust-analyzer/src/handlers.rsSong Gao-4/+2
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-01-11move logic from client to server.ShuiRuTian-1/+9
2021-01-10Merge #7241bors[bot]-52/+71
7241: Honor client's dynamic registration caps r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-10Honor client's dynamic registration capsAleksey Kladov-52/+71
cc https://github.com/rust-analyzer/rust-analyzer/pull/5516#issuecomment-757520828
2021-01-10Merge #7218bors[bot]-6/+6
7218: Fix typos r=Veykril a=regexident Apart from the very last commit on this PR (which fixes a public type's name) all changes are non-breaking. Co-authored-by: Vincent Esche <regexident@gmail.com>
2021-01-10Make default memory stats less verboseAleksey Kladov-1/+1
2021-01-10Fix progress token is already registered crashAleksey Kladov-12/+57
After we started reporting progress when running cargo check during loading, it is possible to crash the client with two identical progress tokens. This points to a deeper issue: we might be running several cargo checks concurrently, which doesn't make sense. This commit linearizes all workspace fetches, making sure no updates are lost. As an additional touch, it also normalizes progress & result reporting, to make sure they stand in sync.
2021-01-10Split punctuation semantic highlighting up into more tagsLukas Wirth-4/+22
2021-01-10update rs formatShuiRuTian-1/+2
2021-01-10fix condition.ShuiRuTian-1/+1
2021-01-10fix issue.ShuiRuTian-14/+14
2021-01-10beta version for folder renameShuiRuTian-4/+22
2021-01-09Fixed typos in testsVincent Esche-5/+5
2021-01-09Fixed typos in code commentsVincent Esche-1/+1
2021-01-09Shorten namesAleksey Kladov-4/+4
2021-01-09Shorten frequent namesAleksey Kladov-35/+30
2021-01-09Rename dummy -> noneAleksey Kladov-1/+1
2021-01-08Simplify highlighting infraAleksey Kladov-0/+3
This also fixes the killer whale bug
2021-01-08support folder rename for initial request.ShuiRuTian-8/+16
2021-01-07Merge #7193bors[bot]-4/+43
7193: Show progress for fetching workspace (cargo-metadata and loadOutDirsFromCheck) r=matklad a=edwin0cheng ![Peek 2021-01-07 21-57](https://user-images.githubusercontent.com/11014119/103902132-0db4c780-5135-11eb-94d3-32429445be87.gif) Fixes #7188 Fixes #3300 Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-01-08Report progress for cargo metadata and output-dirEdwin Cheng-4/+43
2021-01-07Merge #7184bors[bot]-1/+1
7184: Changes Cursor Marker To $0 r=matklad a=kevaundray Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
2021-01-07Change <|> to $0 - RebaseKevaundray Wedderburn-1/+1
2021-01-07Use american spelling for configAleksey Kladov-9/+22
As per https://github.com/rust-analyzer/rust-analyzer/blob/171c3c08fe245938fb25321394233de5fe2abc7c/docs/dev/style.md#variable-naming Also implement config aliasing, for pain-free settings migrations in the future
2021-01-07Remove some stale deprecationsAleksey Kladov-5/+5
2021-01-06Align config's API with usageAleksey Kladov-36/+59
The config now is mostly immutable, optimize for that.
2021-01-06YAGNI active_resolve_capabilitiesAleksey Kladov-47/+27
This leaks a lot of LSP details into ide layer, which we want to avoid: https://github.com/rust-analyzer/rust-analyzer/tree/c9cec381bcfd97e5f3536e31a9c546ab5c0665e6/docs/dev#lsp-independence Additionally, all what this infra does is providing a toggle for auto-import completion, but we already have one!
2021-01-06Speed up snapshotingAleksey Kladov-6/+6
Config can be fairly big, no need to deep clone it frequently
2021-01-06More maintainable configAleksey Kladov-356/+337
Rather than eagerly converting JSON, we losslessly keep it as is, and change the shape of user-submitted data at the last moment. This also allows us to remove a bunch of wrong Defaults
2021-01-06Merge #7174bors[bot]-3/+15
7174: Normalize line endings when formatting r=matklad a=Jesse-Bakker Fixes #7166 Co-authored-by: Jesse Bakker <github@jessebakker.com>
2021-01-05Normalize line endings when formattingJesse Bakker-3/+15
2021-01-05More maintainable caps configAleksey Kladov-78/+105
The idea here is that we preserve client's config as is, without changes. This gets rid of state!
2021-01-05Allow `#anchor` linking of config optionsAleksey Kladov-3/+2
2021-01-04Fix HoverAction::Implementation typoLukas Wirth-1/+1
2021-01-03Merge #7068bors[bot]-0/+19
7068: Add VSCode command to view the hir of a function body r=theotherphil a=theotherphil Will fix https://github.com/rust-analyzer/rust-analyzer/issues/7061. Very rough initial version just to work out where I needed to wire everything up. @matklad would you be happy merging a hir visualiser of some kind? If so, do you have any thoughts on what you'd like it show, and how? I've spent very little time on this thus far, so I'm fine with throwing away the contents of this PR, but I want to avoid taking the time to make this more polished/interactive/useful only to discover that no-one else has any interest in this functionality. ![image](https://user-images.githubusercontent.com/1974256/103236081-bb58f700-493b-11eb-9d12-55ae1b870f8f.png) Co-authored-by: Phil Ellison <phil.j.ellison@gmail.com>
2021-01-03Merge #7115bors[bot]-5/+6
7115: Migrate HasSource::source to return Option r=matklad a=nick96 I've made a start on fixing #6913 based on the provided work plan, migrating `HasSource::source` to return an `Option`. The simple cases are migrated but there are a few that I'm unsure exactly how they should be handled: - Logging the processing of functions in `AnalysisStatsCmd::run`: In verbose mode it includes the path to the module containing the function and the syntax range. I've handled this with an if-let but would it be better to blow up here with `expect`? I'm not 100% on the code paths but if we're processing a function definition then the source should exist. I've handled `source()` in all code paths as `None` being a valid return value but are there some cases where we should just blow up? Also, all I've done is bubble up the returned `None`s, there may be some places where we can recover and still provide something. Co-authored-by: Nick Spain <nicholas.spain@stileeducation.com> Co-authored-by: Nick Spain <nicholas.spain96@gmail.com>
2021-01-02Fix warnings on rust-nightlycynecx-1/+1
2021-01-02Only log path and syntax range when processing function if source existsNick Spain-6/+6
2021-01-02Mark HasSource::source_old as deprecated but allow at all call sitesNick Spain-0/+1
2021-01-02HasSource::source -> HasSource::source_oldNick Spain-1/+1
To start migrating HasSource::source to return an Option.
2021-01-01Formatting.Mara Bos-2/+11
2021-01-01Add support for Rust 2021.Mara Bos-1/+1
2021-01-01Merge #7080bors[bot]-0/+3
7080: Implement ConstParams for HIR r=Veykril a=Veykril r? @flodiebold Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-01-01Add ConstParams to the ide layerLukas Wirth-0/+3
2020-12-31Merge #7106bors[bot]-5/+61
7106: Split textDocument/formatting TextEdit with diff r=matklad a=Jesse-Bakker #7044 Co-authored-by: Jesse Bakker <github@jessebakker.com>
2020-12-31Split textDocument/formatting TextEdit with diffJesse Bakker-5/+61
2020-12-31handle_formatting: Notice if rustfmt is missing and reportDaniel Silverstone-4/+7
In an attempt to fix #6052 and #4249 this attempts to detect if rustfmt is a rustup proxy which isn't installed, and reports the error message to the user for them to fix. In theory this ought to be memoised but for now it'll do as-is. Future work might be to ask the user if they would like us to trigger the installation (if possible). Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-12-29Avoid a couple of allocationsLaurențiu Nicola-1/+1