This repository was archived by the owner on May 9, 2021. It is now read-only.
Commit ffb9172 1 parent 1fd559a commit ffb9172 Copy full SHA for ffb9172
File tree 3 files changed +19
-8
lines changed
3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -4,9 +4,13 @@ All notable changes to the "rust-test-lens" extension will be documented in this
4
4
5
5
Check [ Keep a Changelog] ( https://keepachangelog.com/ ) for recommendations on how to structure this file.
6
6
7
+ ## 0.1.2
8
+
9
+ - Fixes issue [ #3 ] ( https://github.com/hdevalke/rust-test-lens/issues/3 ) where there is more than one target created.
10
+
7
11
## 0.1.1
8
12
9
- - Fixes issue [ #3 ] ( https://github.com/hdevalke/rust-test-lens/issues/3 ) where tests in binary crate were not launched.
13
+ - Fixes issue [ #3 ] ( https://github.com/hdevalke/rust-test-lens/issues/3 ) where tests in binary crate are not launched.
10
14
11
15
## 0.1.0
12
16
Original file line number Diff line number Diff line change 2
2
"name" : " rust-test-lens" ,
3
3
"displayName" : " Rust Test Lens" ,
4
4
"description" : " Adds a code lens to quickly run or debug a single test for your Rust code." ,
5
- "version" : " 0.1.1 " ,
5
+ "version" : " 0.1.2 " ,
6
6
"publisher" : " hdevalke" ,
7
7
"engines" : {
8
8
"vscode" : " ^1.30.2"
Original file line number Diff line number Diff line change @@ -59,14 +59,21 @@ export class RustTests {
59
59
// fast path
60
60
if ( targets . length === 1 ) {
61
61
target = targets [ 0 ] ;
62
- }
63
- // slow path
64
- for ( const t of pkg . targets ) {
65
- if ( t . src_path === uri ) {
66
- target = t ;
67
- break ;
62
+ } else {
63
+ // slow path
64
+ // sort in order to find longest path.
65
+ targets . sort ( ( a , b ) => {
66
+ return b . src_path . length - a . src_path . length ;
67
+ } ) ;
68
+ for ( const t of pkg . targets ) {
69
+ let target_dir = dirname ( t . src_path ) ;
70
+ if ( uri . startsWith ( target_dir ) ) {
71
+ target = t ;
72
+ break ;
73
+ }
68
74
}
69
75
}
76
+
70
77
let kind = undefined ;
71
78
let name = undefined ;
72
79
if ( target === undefined ) {
You can’t perform that action at this time.
0 commit comments