File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -162,11 +162,11 @@ impl ChangeFixture {
162162 meta. env ,
163163 Default :: default ( ) ,
164164 ) ;
165- let crate_name = CrateName :: new ( & krate) . unwrap ( ) ;
165+ let crate_name = CrateName :: normalize_dashes ( & krate) ;
166166 let prev = crates. insert ( crate_name. clone ( ) , crate_id) ;
167167 assert ! ( prev. is_none( ) ) ;
168168 for dep in meta. deps {
169- let dep = CrateName :: new ( & dep) . unwrap ( ) ;
169+ let dep = CrateName :: normalize_dashes ( & dep) ;
170170 crate_deps. push ( ( crate_name. clone ( ) , dep) )
171171 }
172172 } else if meta. path == "/main.rs" || meta. path == "/lib.rs" {
Original file line number Diff line number Diff line change @@ -3163,4 +3163,34 @@ fn main() { let s<|>t = test().get(); }
31633163 "# ] ] ,
31643164 ) ;
31653165 }
3166+
3167+ #[ test]
3168+ fn hover_displays_normalized_crate_names ( ) {
3169+ check (
3170+ r#"
3171+ //- /lib.rs crate:name-with-dashes
3172+ pub mod wrapper {
3173+ pub struct Thing { x: u32 }
3174+
3175+ impl Thing {
3176+ pub fn new() -> Thing { Thing { x: 0 } }
3177+ }
3178+ }
3179+
3180+ //- /main.rs crate:main deps:name-with-dashes
3181+ fn main() { let foo_test = name_with_dashes::wrapper::Thing::new<|>(); }
3182+ "# ,
3183+ expect ! [ [ r#"
3184+ *new*
3185+
3186+ ```rust
3187+ name_with_dashes::wrapper::Thing
3188+ ```
3189+
3190+ ```rust
3191+ pub fn new() -> Thing
3192+ ```
3193+ "# ] ] ,
3194+ )
3195+ }
31663196}
You can’t perform that action at this time.
0 commit comments