File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ pub fn get_it_call(element PsiElement) ?&CallExpression {
1919 methods_names := ['filter' , 'map' , 'any' , 'all' ]
2020 if mut parent_call is CallExpression {
2121 for ! is_array_method_call (* parent_call, ...methods_names) {
22- parent_call = parent_call. parent_of_type (.call_expression) or { break }
22+ return none
2323 }
2424 }
2525
Original file line number Diff line number Diff line change @@ -213,6 +213,23 @@ fn definitions() testing.Tester {
213213 t.assert_definition_name (first, 'name' )!
214214 })
215215
216+ t.test ('it as function parameter' , fn (mut t testing.Test, mut fixture testing.Fixture) ! {
217+ fixture.configure_by_text ('1.v' , "
218+ fn foo(it int) {
219+ if i/*caret*/t.str() == 1 {
220+ println('one')
221+ }
222+ }
223+ " .trim_indent ())!
224+
225+ locations := fixture.definition_at_cursor ()
226+ t.assert_has_definition (locations)!
227+
228+ first := locations.first ()
229+ t.assert_uri (first.target_uri, fixture.current_file_uri ())!
230+ t.assert_definition_name (first, 'it' )!
231+ })
232+
216233 t.slow_test ('shell script implicit os module' , fn (mut t testing.Test, mut fixture testing.Fixture) ! {
217234 fixture.configure_by_text ('1.vsh' , '
218235 abs_/*caret*/path()
You can’t perform that action at this time.
0 commit comments