about summary refs log tree commit diff
path: root/crates/rust-analyzer/src
AgeCommit message (Collapse)AuthorLines
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-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-19remove debug printsAleksey Kladov-2/+0
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-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
2021-07-11better nameAleksey Kladov-1/+1
2021-07-11Let the client care about presentationAleksey Kladov-8/+18
2021-07-11prepare to move run/debug splitting to handlersAleksey Kladov-32/+50
2021-07-11Merge #9449bors[bot]-9/+5
9449: feat: Emit test names in `Run test` runnables if they come from a macro expansion r=matklad a=Veykril Fixes #8964 Before: ![Code_D1Tu5Iuh5I](https://user-images.githubusercontent.com/3757771/124174685-f552b380-daac-11eb-9086-c97db014b77c.png) After: ![image](https://user-images.githubusercontent.com/3757771/124174493-bb81ad00-daac-11eb-96c7-3de6545a62e1.png) Basically when a macro emits more than one test we name the test functions/modules name in the runnable instead to not emit a bunch of equally named `Run Test` annotations which don't really tell much. Note that the `Run fibonacci_test Tests` line is below the attributes due to the fact that the function name span is being reused for the generated module in rstest's expansion. Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-11Do not erase Cargo diagnostics from the closed documentsKirill Bulatov-15/+2
2021-07-09Emit test name in Run test runnables if it comes from a macro expansionLukas Wirth-9/+5
2021-07-06internal: ensure consistent passing for config paramsAleksey Kladov-4/+4
We pass "context" parametes first, so configs should be on the left. "Bigger" context wins, so configs goes after db.
2021-07-05feat: make join lines behavior configurableAleksey Kladov-4/+21
closes #9492
2021-07-05refactor logger flushingmahdi-frms-2/+3
2021-07-05make the logs line bufferedmahdi-frms-9/+8
2021-07-04feat: always prefer postfix snippets if there's exact textual matchAleksey Kladov-4/+11
Note that, while we don't currently have a fuzzy-matching score, it makes sense to special-case postfix templates -- it's very annoying when `.not()` gets sorted before `.not`. We might want to move this infra to fuzzy matching, once we have that!
2021-07-04internal: make CompletionItem and SourceChange consistentAleksey Kladov-12/+5
Before this PR, SourceChange used a bool and CompletionItem used an enum to signify if edit is a snippet. It makes sense to use the same pattern in both cases. `bool` feels simpler, as there's only one consumer of this API, and all producers are encapsulated anyway (we check the capability at the production site).
2021-07-04internal: better factoring for to_proto::completionAleksey Kladov-84/+97
One source completion can produce up to two lsp completions. Additionally, `preselct` and `sort_text` are global properties of the whole set of completions, so the right granularity here is to convert many completions. As a side-benefit, we no loger allocate intermediate vec.
2021-07-04minor: styleAleksey Kladov-35/+39
2021-07-02Add "View Crate Graph (Full)"Jonas Schievink-4/+14
2021-06-29Merge #9269bors[bot]-7/+11
9269: Recreate status page r=lnicola a=Milo123459 I'm working on redesigning the status page. Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
2021-06-29Watch for Cargo.toml and .lock changesLaurențiu Nicola-1/+7
2021-06-28Resolve attribute paths in attribute highlightingLukas Wirth-0/+2
2021-06-24Merge #9375bors[bot]-28/+17
9375: feat: Highlight exit and yield points r=Veykril a=Veykril ![Code_YBHOCF3DbU](https://user-images.githubusercontent.com/3757771/123128986-e1270a80-d44b-11eb-9854-065459a2dd50.png) ![Code_YyMhqES0LX](https://user-images.githubusercontent.com/3757771/123128988-e1bfa100-d44b-11eb-9c81-6a6031aad740.png) Fixes #4691 Fixes #9365 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-24SimplifyLukas Wirth-1/+1
2021-06-23Merge #9380bors[bot]-2/+18
9380: feat: Implement goto_declaration support r=matklad a=Veykril This is just a simple implementation that falls back to `goto_definition` for everything but modules where it goes to the actual module declaration if possible. Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-06-24move goto_declaration fall back into handlersLukas Wirth-2/+2
2021-06-23Rename 'document_highlight' to 'highlight_related'Lukas Wirth-1/+1
2021-06-23Move document highlighting computation from rust-analyzer to ideLukas Wirth-28/+17