File tree Expand file tree Collapse file tree 4 files changed +44
-1
lines changed Expand file tree Collapse file tree 4 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 24
24
25
25
### Fixed
26
26
27
+ - Fixed bug where completion of interfaces in USE ONLY would produce the snippet
28
+ ([ #150 ] ( https://github.com/fortran-lang/fortls/issues/150 ) )
27
29
- Fixed bug where diagnostic messages were raised for non-existent variables
28
30
([ #173 ] ( https://github.com/fortran-lang/fortls/issues/173 ) )
29
31
([ #175 ] ( https://github.com/fortran-lang/fortls/issues/175 ) )
Original file line number Diff line number Diff line change @@ -660,7 +660,7 @@ def build_comp(
660
660
continue
661
661
#
662
662
name_replace = rename_list [i ]
663
- if candidate_type == INTERFACE_TYPE_ID :
663
+ if candidate_type == INTERFACE_TYPE_ID and not line_context == "mod_mems" :
664
664
tmp_list = []
665
665
if name_replace is None :
666
666
name_replace = candidate .name
Original file line number Diff line number Diff line change @@ -377,3 +377,20 @@ def test_comp_documentation():
377
377
]
378
378
assert len (exp_results ) == len (results [1 ])
379
379
assert exp_results == results [1 ]
380
+
381
+
382
+ def test_comp_use_only_interface ():
383
+ """Test completion of interfaces when using USE ONLY give the right signature."""
384
+ string = write_rpc_request (
385
+ 1 , "initialize" , {"rootPath" : str (test_dir / "completion" )}
386
+ )
387
+ file_path = test_dir / "completion" / "use_only_interface.f90"
388
+ string += comp_request (file_path , 21 , 29 )
389
+ errcode , results = run_request (
390
+ string ,
391
+ )
392
+ assert errcode == 0
393
+ exp_results = [[1 , "some_sub" , "INTERFACE" ]]
394
+ assert len (exp_results ) == len (results ) - 1
395
+ for i , ref in enumerate (exp_results ):
396
+ validate_comp (results [i + 1 ], ref )
Original file line number Diff line number Diff line change
1
+ module some_mod
2
+ implicit none
3
+ private
4
+ public :: some_sub
5
+ interface some_sub
6
+ module procedure a_subroutine
7
+ module procedure b_subroutine
8
+ end interface
9
+ contains
10
+ subroutine a_subroutine (x )
11
+ integer , intent (in ) :: x
12
+ write (* ,* ) ' x = ' , x
13
+ end subroutine a_subroutine
14
+ subroutine b_subroutine (x , y )
15
+ integer , intent (in ) :: x, y
16
+ write (* ,* ) ' x = ' , x
17
+ write (* ,* ) ' y = ' , y
18
+ end subroutine b_subroutine
19
+ end module some_mod
20
+
21
+ program main
22
+ use some_mod, only: some_sub
23
+ implicit none
24
+ end program main
You can’t perform that action at this time.
0 commit comments