@@ -300,3 +300,73 @@ def test_doc_multiline_type_bound_procedure_arg_list():
300300 ),
301301 True ,
302302 )
303+
304+
305+ def test_doxygen_doc_for_module_use ():
306+ string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir / "docs" )})
307+ file_path = test_dir / "docs" / "test_module_and_type_doc.f90"
308+ string += hover_request (file_path , 24 , 14 )
309+ errcode , results = run_request (string )
310+ assert errcode == 0
311+
312+ ref = (
313+ (0 , "```fortran90" ),
314+ (1 , "MODULE doxygen_doc_mod" ),
315+ (2 , "```" ),
316+ (3 , "-----" ),
317+ (4 , "module doc for doxygen_doc_mod" ),
318+ (5 , "" ),
319+ (6 , "with info" ),
320+ )
321+ check_return (results [1 ], ref )
322+
323+
324+ def test_ford_doc_for_module_use ():
325+ string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir / "docs" )})
326+ file_path = test_dir / "docs" / "test_module_and_type_doc.f90"
327+ string += hover_request (file_path , 25 , 14 )
328+ errcode , results = run_request (string )
329+ assert errcode == 0
330+
331+ ref = (
332+ (0 , "```fortran90" ),
333+ (1 , "MODULE ford_doc_mod" ),
334+ (2 , "```" ),
335+ (3 , "-----" ),
336+ (4 , "Doc for ford_doc_mod" ),
337+ )
338+ check_return (results [1 ], ref )
339+
340+
341+ def test_doxygen_doc_for_type ():
342+ string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir / "docs" )})
343+ file_path = test_dir / "docs" / "test_module_and_type_doc.f90"
344+ string += hover_request (file_path , 27 , 11 )
345+ errcode , results = run_request (string )
346+ assert errcode == 0
347+
348+ ref = (
349+ (0 , "```fortran90" ),
350+ (1 , "TYPE :: a_t" ),
351+ (2 , "```" ),
352+ (3 , "-----" ),
353+ (4 , "Doc for a_t" ),
354+ )
355+ check_return (results [1 ], ref )
356+
357+
358+ def test_ford_doc_for_type ():
359+ string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir / "docs" )})
360+ file_path = test_dir / "docs" / "test_module_and_type_doc.f90"
361+ string += hover_request (file_path , 28 , 11 )
362+ errcode , results = run_request (string )
363+ assert errcode == 0
364+
365+ ref = (
366+ (0 , "```fortran90" ),
367+ (1 , "TYPE :: b_t" ),
368+ (2 , "```" ),
369+ (3 , "-----" ),
370+ (4 , "Doc for b_t" ),
371+ )
372+ check_return (results [1 ], ref )
0 commit comments