about summary refs log tree commit diff
path: root/crates/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2021-08-10internal: prepare to use standard .run pattern for subcommandsAleksey Kladov-4/+5
2021-08-10Add trait codegen to `add_missing_impl_members` assistYoshua Wuyts-0/+1
2021-08-09internal: drop latest requests trackingAleksey Kladov-53/+1
From the dawn of time, when dinosaurs roamed the and we didn't have hierarchical profiling, there was the `latest_requests` infra we used to track the time of ten last requests. Today, no one is actually using it and, what's more, it itself became pretty useless -- LSP grew way more chatty, and 10 requests don't really paint any kind of picture. Personally, it's been years since I last looked at latest requests in the status output. So, let's remove a tiny bit of state from the big ball of complexity that is `GlobalState` and `main_loop`!
2021-08-09internal: remove useless helpersAleksey Kladov-2/+2
We generally avoid "syntax only" helper wrappers, which don't do much: they make code easier to write, but harder to read. They also make investigations harder, as "find_usages" needs to be invoked both for the wrapped and unwrapped APIs
2021-08-08exclude files from tidy checkYoshua Wuyts-0/+2
2021-08-06Don't publish diagnostics in library source rootsJonas Schievink-1/+12
2021-08-06Bless testsJonas Schievink-15/+15
2021-08-06Don't include empty suggestionsJonas Schievink-1/+3
2021-08-06Include suggested replacement in diagnosticsJonas Schievink-3/+16
2021-08-04Merge #9734bors[bot]-0/+2
9734: semantic highlighting: add reference hlmod r=matklad a=jhgg This PR adds the "reference" highlight modifier! I basically went around and looked for `HlMod::Mutable` to find the callsites to add a reference. I think these all make sense! Co-authored-by: Jake Heinz <jh@discordapp.com> Co-authored-by: Jake <jh@discordapp.com>
2021-08-01Make `LoadCargoConfig`, `fn load_workspace_at` & `fn load_workspace` public ↵Vincent Esche-7/+16
again
2021-07-31semantic highlighting: add reference hlmodJake Heinz-0/+2
2021-07-30feat: gate custom clint-side commands behind capabilitiesAleksey Kladov-123/+86
Some features of rust-analyzer requires support for custom commands on the client side. Specifically, hover & code lens need this. Stock LSP doesn't have a way for the server to know which client-side commands are available. For that reason, we historically were just sending the commands, not worrying whether the client supports then or not. That's not really great though, so in this PR we add infrastructure for the client to explicitly opt-into custom commands, via `extensions` field of the ClientCapabilities. To preserve backwards compatability, if the client doesn't set the field, we assume that it does support all custom commands. In the future, we'll start treating that case as if the client doesn't support commands. So, if you maintain a rust-analyzer client and implement `rust-analyzer/runSingle` and such, please also advertise this via a capability.
2021-07-29Merge #9706bors[bot]-1/+1
9706: minor: perf and grammar fixes r=lnicola a=lnicola Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-07-28Merge #9693bors[bot]-6/+33
9693: feat: Add the Hover Range capability which enables showing the type of an expression r=matklad a=alexfertel Closes https://github.com/rust-analyzer/rust-analyzer/issues/389 This PR extends the `textDocument/hover` method to allow getting the type of an expression. It looks like this: ![type_of_expression](https://user-images.githubusercontent.com/22298999/126914293-0ce49a92-545d-4005-a59e-9294fa2330d6.gif) Edit: One thing I noticed is that when hovering a selection that includes a macro it doesn't work, so maybe this would need a follow-up issue discussing what problem that may have. (PS: What a great project! I am learning a lot! 🚀) Co-authored-by: Alexander Gonzalez <alexfertel97@gmail.com> Co-authored-by: Alexander González <alexfertel97@gmail.com>
2021-07-28minor: simplifyAleksey Kladov-14/+11
2021-07-27refactor: Reuse the from_proto call in handle_hoverAlexander Gonzalez-3/+1
2021-07-27feat: Add the Hover Range server capabilityAlexander Gonzalez-0/+1
2021-07-27refactor: Apply PR suggestionsAlexander Gonzalez-13/+6
2021-07-27refactor: Make handle_hover handle ranges tooAlexander Gonzalez-41/+33
2021-07-27chore: Remove unnecessary logAlexander Gonzalez-1/+0
2021-07-27feat: Completed the client side implementation of rust-analyzer/hoverRangeAlexander Gonzalez-19/+40
2021-07-27feat: Add the hover_range capabilityAlexander Gonzalez-3/+4
2021-07-27feat: Extend the server with the hover_range capabilityAlexander Gonzalez-6/+28
2021-07-27Remove some redundant clonesLaurențiu Nicola-1/+1
2021-07-27fix: add capability for "open cargo.toml" lsp extensionAleksey Kladov-0/+1
2021-07-26fix: correctly update diagnostics when files are opened and closedAleksey Kladov-73/+76
Basically, this tracks the changes to `subscriptions` we use when issuing a publish_diagnostics.
2021-07-26internal: prepare to track changes to mem_docsAleksey Kladov-28/+68
2021-07-26Merge #9558bors[bot]-15/+2
9558: Do not erase Cargo diagnostics from the closed documents r=matklad a=SomeoneToIgnore Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6850 The LSP specification at https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textDocument_publishDiagnostics states that > Diagnostics notification are sent from the server to the client to signal results of validation runs. > > Diagnostics are “owned” by the server so it is the server’s responsibility to clear them if necessary. The following rule is used for VS Code servers that generate diagnostics: > > * if a language is single file only (for example HTML) then diagnostics are cleared by the server when the file is closed. > * if a language has a project system (for example C#) diagnostics are not cleared when a file closes. When a project is opened all diagnostics for all files are recomputed (or read from a cache). > > When a file changes it is the server’s responsibility to re-compute diagnostics and push them to the client. If the computed set is empty it has to push the empty array to clear former diagnostics. Newly pushed diagnostics always replace previously pushed diagnostics. There is no merging that happens on the client side. So for projects we should not clear any diagnostics from cargo/json projects. Our "standalone file" mode is in a way a project too, with sysroot attached and a potential support for dynamic standalone files. Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2021-07-24Bump depsLaurențiu Nicola-1/+1
2021-07-22Updated docs.Kevin DeLorey-8/+9
2021-07-22Initial commit of highlight related configuration w/ implementation.Kevin DeLorey-3/+20
2021-07-22Merge #9634bors[bot]-1/+3
9634: minor update to excludeDirs doc r=lnicola a=dae I saw reference to globs in #7755, but it doesn't look like they're actually supported, and I had to dig through the source to discover that the folders are relative to the workspace root. Further digging was required to get VS Code from hanging for long periods trying to watch giant Bazel folders that had already been excluded from Rust Analyzer. Hopefully this tweak will save others the confusion :-) Co-authored-by: Damien Elmes <gpg@ankiweb.net> Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2021-07-22mention files.watcherExcludeDamien Elmes-1/+1
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-07-22Fix a couple of clippy nitsLaurențiu Nicola-2/+2
2021-07-19docs: publish Explaining Rust Analyzer seriesAleksey Kladov-4/+4
2021-07-19internal: use types to remove some unwrapsAleksey Kladov-2/+2
2021-07-19Merge #9625bors[bot]-136/+199
9625: internal: simplify handling of the build scripts r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-19remove debug printsAleksey Kladov-2/+0
2021-07-19fix testsAleksey Kladov-1/+12
2021-07-19Added some metadata for rust-analyser package sufficient to build it using ↵KOLANICH-1/+4
`cargo deb` Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-07-19minor update to excludeDirs docDamien Elmes-1/+3
I saw reference to globs in #7755, but it doesn't look like they're actually supported, and I had to dig through the source to discover that the folders are relative to the workspace root. Further digging was required to get VS Code from hanging for long periods trying to watch giant Bazel folders that had already been excluded from Rust Analyzer. Hopefully this tweak will save others the confusion :-)
2021-07-18fix: potential bugs when build scripts do not match the current projectAleksey Kladov-63/+105
2021-07-18internal: simplify handling of the build scriptsAleksey Kladov-112/+124
2021-07-17internal: a bit more of cwd safety for flycheckAleksey Kladov-35/+40
2021-07-14Show test mod runnable in outline modulesLukas Wirth-0/+43
2021-07-11drop unused fieldsAleksey Kladov-2/+0
2021-07-11simplifyAleksey Kladov-1/+1
2021-07-11drop unused fieldAleksey Kladov-1/+1
2021-07-11simplifyAleksey Kladov-1/+7