My codebase already depended on lsp-server and introducing a dependency
on rust-analyzer failed at first because it assumes some functions that
were first present in lsp-server 0.3.2.
Without this change:
error[E0599]: no method named `initialize_start` found for struct `lsp_server::Connection` in the current scope
--> crates/rust-analyzer/./src/bin/main.rs:83:57
|
83 | let (initialize_id, initialize_params) = connection.initialize_start()?;
| ^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`
error[E0599]: no method named `initialize_finish` found for struct `lsp_server::Connection` in the current scope
--> crates/rust-analyzer/./src/bin/main.rs:99:16
|
99 | connection.initialize_finish(initialize_id, initialize_result)?;
| ^^^^^^^^^^^^^^^^^ method not found in `lsp_server::Connection`
4660: Enable hover and autocomplete docs on macro generated items r=aloucks a=aloucks
Enable hover and autocomplete docs on macro generated items. This de-sugars doc comments into `doc` attributes in some cases, but not all. Comments and `doc` attributes are then merged together.
This PR is essentially a partial implementation of what's being suggested #3182, but it's not all the way there yet. ~I still need to add unit tests~, but I wanted to first get feedback on whether or not this was an acceptable path forward.
Fixes#4564Fixes#3984Fixes#3180
Related #3182
![macro_item_docs](https://user-images.githubusercontent.com/221559/83336760-15012200-a284-11ea-8d0d-b6a615850044.gif)
Co-authored-by: Aaron Loucks <aloucks@cofront.net>
Removes the duplicated `expand_doc_attrs` and `merge_doc_comments_and_attrs`
functions from `ra_ide` and exposes the same functionality via
`ra_hir::Documentation::from_ast`.
Eventually, we should support "just open random rust file" use case,
we don't really do this now, so let's avoid spending time on it until
we fix it properly.
4721: Hide squiggly for unused and unnecessary diagnostics r=matklad a=GabbeV
Fixes#4229
When working with JavaScript or TypeScript in VSCode unused valiables are faded but don't have a squiggle. This PR makes rust-analyzer work similarly by setting the severity to hint when applying the unnecessary tag.
VSCode usually shows a squiggle for error, warning and information and shows three dots for hint. When the unnecessary tag is present the squiggles will still show up but the three dots will not.
This is my first contribution to open source. Please tell me if i need to do anything more to get this PR considered.
Co-authored-by: Gabriel Valfridsson <gabriel.valfridsson@gmail.com>
4720: Add highlight support for unsafe fn calls and raw ptr deref r=matklad a=Nashenas88
Addresses ide highlighting for #190
Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>