ebkalderon / tower-lsp

Language Server Protocol implementation written in Rust
Apache License 2.0
952 stars 54 forks source link

Won't Compile #405

Open Feel-ix-343 opened 6 months ago

Feel-ix-343 commented 6 months ago

After this pr was merged, the crate will not compile.

I am getting this error


    Checking tower-lsp v0.20.0 (https://github.com/ebkalderon/tower-lsp?rev=49e1ce5#49e1ce54)
error[E0412]: cannot find type `WorkspaceDiagnosticRefresh` in this scope
   --> /home/felix/.cargo/git/checkouts/tower-lsp-c76aca49ec8e037c/49e1ce5/src/service/client.rs:350:29
    |
350 |         self.send_request::<WorkspaceDiagnosticRefresh>(()).await
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: /home/felix/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lsp-types-0.94.1/src/workspace_diagnostic.rs:120:1
    |
120 | pub struct WorkspaceDiagnosticReport {
    | ------------------------------------ similarly named struct `WorkspaceDiagnosticReport` defined here
    |
help: a struct with a similar name exists
    |
350 |         self.send_request::<WorkspaceDiagnosticReport>(()).await
    |                             ~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider importing one of these items
    |
3   + use crate::request::WorkspaceDiagnosticRefresh;
    |
3   + use lsp_types::request::WorkspaceDiagnosticRefresh;
    |

For more information about this error, try `rustc --explain E0412`.
error: could not compile `tower-lsp` (lib) due to previous error
ebkalderon commented 6 months ago

Thanks for opening the ticket! Linking PR #385 over here for context, as a possible culprit. However, there are other build issues on main right now (CI is currently broken due to dashmap's recent change in MSRV, for instance), so I expect several build issues will be resolved at once.

Feel-ix-343 commented 6 months ago

First, that PR removed the use lsp_types::request::*; in client.rs. This removed use lsp_types::request::WorkspaceDiagnosticRefresh; which was needed in the workspace_diagnostic_refresh function

The other issue is that dashmap needed rust 1.65.0

I created a pr that fixes both of these in this pr #406