@@ -42,7 +42,11 @@ async fn when_the_client_asks_for_the_existing_code_actions_it_receives_the_avai
4242 CodeActionOrCommand :: Command ( Command {
4343 title: "Scan base image" . to_string( ) ,
4444 command: "sysdig-lsp.execute-scan" . to_string( ) ,
45- arguments: Some ( vec![ json!( "file://dockerfile/" ) , json!( 0 ) , json!( "alpine" ) ] )
45+ arguments: Some ( vec![
46+ json!( "file://dockerfile/" ) ,
47+ json!( { "start" : { "line" : 0 , "character" : 0 } , "end" : { "line" : 0 , "character" : 11 } } ) ,
48+ json!( "alpine" ) ,
49+ ] )
4650 } )
4751 ]
4852 ) ;
@@ -77,7 +81,11 @@ async fn when_the_client_asks_for_the_existing_code_actions_but_the_dockerfile_c
7781 CodeActionOrCommand :: Command ( Command {
7882 title: "Scan base image" . to_string( ) ,
7983 command: "sysdig-lsp.execute-scan" . to_string( ) ,
80- arguments: Some ( vec![ json!( "file://dockerfile/" ) , json!( 1 ) , json!( "ubuntu" ) ] )
84+ arguments: Some ( vec![
85+ json!( "file://dockerfile/" ) ,
86+ json!( { "start" : { "line" : 1 , "character" : 0 } , "end" : { "line" : 1 , "character" : 11 } } ) ,
87+ json!( "ubuntu" ) ,
88+ ] )
8189 } )
8290 ]
8391 ) ;
@@ -102,7 +110,7 @@ async fn when_the_client_asks_for_the_existing_code_lens_it_receives_the_availab
102110 response. unwrap( ) ,
103111 vec![
104112 CodeLens {
105- range: Range :: new( Position :: new( 0 , 0 ) , Position :: new( 0 , 0 ) ) ,
113+ range: Range :: new( Position :: new( 0 , 0 ) , Position :: new( 0 , 11 ) ) ,
106114 command: Some ( Command {
107115 title: "Build and scan" . to_string( ) ,
108116 command: "sysdig-lsp.execute-build-and-scan" . to_string( ) ,
@@ -111,11 +119,15 @@ async fn when_the_client_asks_for_the_existing_code_lens_it_receives_the_availab
111119 data: None
112120 } ,
113121 CodeLens {
114- range: Range :: new( Position :: new( 0 , 0 ) , Position :: new( 0 , 0 ) ) ,
122+ range: Range :: new( Position :: new( 0 , 0 ) , Position :: new( 0 , 11 ) ) ,
115123 command: Some ( Command {
116124 title: "Scan base image" . to_string( ) ,
117125 command: "sysdig-lsp.execute-scan" . to_string( ) ,
118- arguments: Some ( vec![ json!( "file://dockerfile/" ) , json!( 0 ) , json!( "alpine" ) ] )
126+ arguments: Some ( vec![
127+ json!( "file://dockerfile/" ) ,
128+ json!( { "start" : { "line" : 0 , "character" : 0 } , "end" : { "line" : 0 , "character" : 11 } } ) ,
129+ json!( "alpine" ) ,
130+ ] )
119131 } ) ,
120132 data: None
121133 }
@@ -139,7 +151,7 @@ async fn when_the_client_asks_for_the_existing_code_lens_but_the_dockerfile_cont
139151 response. unwrap( ) ,
140152 vec![
141153 CodeLens {
142- range: Range :: new( Position :: new( 1 , 0 ) , Position :: new( 1 , 0 ) ) ,
154+ range: Range :: new( Position :: new( 1 , 0 ) , Position :: new( 1 , 11 ) ) ,
143155 command: Some ( Command {
144156 title: "Build and scan" . to_string( ) ,
145157 command: "sysdig-lsp.execute-build-and-scan" . to_string( ) ,
@@ -148,11 +160,15 @@ async fn when_the_client_asks_for_the_existing_code_lens_but_the_dockerfile_cont
148160 data: None
149161 } ,
150162 CodeLens {
151- range: Range :: new( Position :: new( 1 , 0 ) , Position :: new( 1 , 0 ) ) ,
163+ range: Range :: new( Position :: new( 1 , 0 ) , Position :: new( 1 , 11 ) ) ,
152164 command: Some ( Command {
153165 title: "Scan base image" . to_string( ) ,
154166 command: "sysdig-lsp.execute-scan" . to_string( ) ,
155- arguments: Some ( vec![ json!( "file://dockerfile/" ) , json!( 1 ) , json!( "ubuntu" ) ] )
167+ arguments: Some ( vec![
168+ json!( "file://dockerfile/" ) ,
169+ json!( { "start" : { "line" : 1 , "character" : 0 } , "end" : { "line" : 1 , "character" : 11 } } ) ,
170+ json!( "ubuntu" ) ,
171+ ] )
156172 } ) ,
157173 data: None
158174 }
@@ -184,7 +200,7 @@ async fn when_the_client_asks_for_code_lens_in_a_compose_file_it_receives_them()
184200 command: "sysdig-lsp.execute-scan" . to_string( ) ,
185201 arguments: Some ( vec![
186202 json!( "file://docker-compose.yml/" ) ,
187- json!( 2 ) ,
203+ json!( { "start" : { "line" : 2 , "character" : 11 } , "end" : { "line" : 2 , "character" : 23 } } ) ,
188204 json!( "nginx:latest" )
189205 ] )
190206 } ) ,
@@ -197,7 +213,7 @@ async fn when_the_client_asks_for_code_lens_in_a_compose_file_it_receives_them()
197213 command: "sysdig-lsp.execute-scan" . to_string( ) ,
198214 arguments: Some ( vec![
199215 json!( "file://docker-compose.yml/" ) ,
200- json!( 4 ) ,
216+ json!( { "start" : { "line" : 4 , "character" : 11 } , "end" : { "line" : 4 , "character" : 22 } } ) ,
201217 json!( "postgres:13" )
202218 ] )
203219 } ) ,
@@ -228,8 +244,8 @@ async fn when_the_client_asks_for_code_actions_in_a_compose_file_it_receives_the
228244 command: "sysdig-lsp.execute-scan" . to_string( ) ,
229245 arguments: Some ( vec![
230246 json!( "file://docker-compose.yml/" ) ,
231- json!( 2 ) ,
232- json!( "nginx:latest" )
247+ json!( { "start" : { "line" : 2 , "character" : 11 } , "end" : { "line" : 2 , "character" : 23 } } ) ,
248+ json!( "nginx:latest" ) ,
233249 ] )
234250 } ) ]
235251 ) ;
@@ -256,7 +272,7 @@ async fn when_the_client_asks_for_code_lens_in_a_complex_compose_yaml_file_it_re
256272 command: "sysdig-lsp.execute-scan" . to_string( ) ,
257273 arguments: Some ( vec![
258274 json!( "file://compose.yaml/" ) ,
259- json!( 4 ) ,
275+ json!( { "start" : { "line" : 4 , "character" : 13 } , "end" : { "line" : 4 , "character" : 25 } } ) ,
260276 json!( "nginx:latest" )
261277 ] )
262278 } ) ,
@@ -269,7 +285,7 @@ async fn when_the_client_asks_for_code_lens_in_a_complex_compose_yaml_file_it_re
269285 command: "sysdig-lsp.execute-scan" . to_string( ) ,
270286 arguments: Some ( vec![
271287 json!( "file://compose.yaml/" ) ,
272- json!( 9 ) ,
288+ json!( { "start" : { "line" : 9 , "character" : 6 } , "end" : { "line" : 9 , "character" : 17 } } ) ,
273289 json!( "postgres:13" )
274290 ] )
275291 } ) ,
@@ -282,7 +298,7 @@ async fn when_the_client_asks_for_code_lens_in_a_complex_compose_yaml_file_it_re
282298 command: "sysdig-lsp.execute-scan" . to_string( ) ,
283299 arguments: Some ( vec![
284300 json!( "file://compose.yaml/" ) ,
285- json!( 13 ) ,
301+ json!( { "start" : { "line" : 13 , "character" : 11 } , "end" : { "line" : 13 , "character" : 21 } } ) ,
286302 json!( "my-api:1.0" )
287303 ] )
288304 } ) ,
0 commit comments