Skip to content

Commit

Permalink
hover test
Browse files Browse the repository at this point in the history
  • Loading branch information
glehmann committed May 3, 2024
1 parent 1d29516 commit 5a56a47
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/hover.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
mod common;

use core::panic;

use tower_lsp::lsp_types::*;

use crate::common::*;

#[tokio::test]
async fn should_hover_with_keyword() {
let mut ctx = TestContext::new();
ctx.initialize().await;
let res = ctx
.request::<request::HoverRequest>(HoverParams {
text_document_position_params: TextDocumentPositionParams {
position: Position { line: 0, character: 0 },
text_document: TextDocumentIdentifier { uri: ctx.doc_uri("Earthfile") },
},
work_done_progress_params: WorkDoneProgressParams { work_done_token: None },
})
.await
.unwrap();
let HoverContents::Markup(markup) = res.contents else { panic!("not a markup content!") };
assert!(markup.value.contains("VERSION"));
// panic!("Don’t panic!");
}

0 comments on commit 5a56a47

Please sign in to comment.