Various hover improvements (#5617)
* Show more info on hover for variables Signed-off-by: Nick Cameron <nrc@ncameron.org> * Move hover impls to lsp module Signed-off-by: Nick Cameron <nrc@ncameron.org> * Make hover work on names inside calls, fix doc line breaking, trim docs in tool tips Signed-off-by: Nick Cameron <nrc@ncameron.org> * Test the new hovers; fix signature syntax Signed-off-by: Nick Cameron <nrc@ncameron.org> * Hover tips for kwargs Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -124,10 +124,6 @@ fn test_stdlib_line_to() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// lineTo
|
||||
///
|
||||
/// ```
|
||||
/// This is another code block.
|
||||
/// yes sirrr.
|
||||
@ -144,7 +140,7 @@ fn test_stdlib_line_to() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/lineTo.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -158,10 +154,6 @@ fn test_stdlib_min() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// min
|
||||
///
|
||||
/// ```
|
||||
/// This is another code block.
|
||||
/// yes sirrr.
|
||||
@ -185,7 +177,7 @@ fn test_stdlib_min() {
|
||||
.unwrap();
|
||||
let _expected = quote! {};
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/min.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -199,9 +191,11 @@ fn test_stdlib_show() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// show
|
||||
/// ```
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// show
|
||||
/// ```
|
||||
fn inner_show(
|
||||
/// The args to do shit to.
|
||||
_args: Vec<f64>
|
||||
@ -212,7 +206,7 @@ fn test_stdlib_show() {
|
||||
.unwrap();
|
||||
let _expected = quote! {};
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/show.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -226,9 +220,11 @@ fn test_stdlib_box() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// show
|
||||
/// ```
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// show
|
||||
/// ```
|
||||
fn inner_show(
|
||||
/// The args to do shit to.
|
||||
args: Box<f64>
|
||||
@ -240,7 +236,7 @@ fn test_stdlib_box() {
|
||||
.unwrap();
|
||||
let _expected = quote! {};
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/box.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -254,9 +250,11 @@ fn test_stdlib_option() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// show
|
||||
/// ```
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// show
|
||||
/// ```
|
||||
fn inner_show(
|
||||
/// The args to do shit to.
|
||||
args: Option<f64>
|
||||
@ -267,7 +265,7 @@ fn test_stdlib_option() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/option.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -281,10 +279,6 @@ fn test_stdlib_array() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// show
|
||||
///
|
||||
/// ```
|
||||
/// This is another code block.
|
||||
/// yes sirrr.
|
||||
@ -300,7 +294,7 @@ fn test_stdlib_array() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/array.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -314,9 +308,11 @@ fn test_stdlib_option_input_format() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// import
|
||||
/// ```
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// import
|
||||
/// ```
|
||||
fn inner_import(
|
||||
/// The args to do shit to.
|
||||
args: Option<kittycad::types::InputFormat>
|
||||
@ -327,7 +323,7 @@ fn test_stdlib_option_input_format() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/option_input_format.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -341,9 +337,11 @@ fn test_stdlib_return_vec_sketch() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// import
|
||||
/// ```
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// import
|
||||
/// ```
|
||||
fn inner_import(
|
||||
/// The args to do shit to.
|
||||
args: Option<kittycad::types::InputFormat>
|
||||
@ -354,7 +352,7 @@ fn test_stdlib_return_vec_sketch() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/return_vec_sketch.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -368,9 +366,11 @@ fn test_stdlib_return_vec_box_sketch() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// import
|
||||
/// ```
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// import
|
||||
/// ```
|
||||
fn inner_import(
|
||||
/// The args to do shit to.
|
||||
args: Option<kittycad::types::InputFormat>
|
||||
@ -381,7 +381,7 @@ fn test_stdlib_return_vec_box_sketch() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/return_vec_box_sketch.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -395,10 +395,6 @@ fn test_stdlib_doc_comment_with_code() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
/// myFunc
|
||||
///
|
||||
/// ```
|
||||
/// This is another code block.
|
||||
/// yes sirrr.
|
||||
@ -414,7 +410,7 @@ fn test_stdlib_doc_comment_with_code() {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
assert!(errors.is_empty());
|
||||
assert!(errors.is_empty(), "{errors:?}");
|
||||
expectorate::assert_contents("tests/doc_comment_with_code.gen", &get_text_fmt(&item).unwrap());
|
||||
}
|
||||
|
||||
@ -428,9 +424,6 @@ fn test_stdlib_fail_non_camel_case() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
///
|
||||
/// ```
|
||||
/// This is another code block.
|
||||
/// yes sirrr.
|
||||
@ -486,9 +479,6 @@ fn test_stdlib_fail_name_not_in_code_block() {
|
||||
/// This is some function.
|
||||
/// It does shit.
|
||||
///
|
||||
/// This is code.
|
||||
/// It does other shit.
|
||||
///
|
||||
/// ```
|
||||
/// This is another code block.
|
||||
/// yes sirrr.
|
||||
|
Reference in New Issue
Block a user