Repository: fortran-lang/fortls (language: python)

Issue:
Extending default configuration file names
Allow for more default config files `.fortlsrc`, `.fortls.json` and `.fortls` in that order.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3600a9e7..52b5b652 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,9 @@
 - Fixes Fortran line continuation definitions intermingled with preprocessor directives
   ([#203](https://github.com/hansec/fortran-language-server/issues/203))
   ([gnikit/fortls#4](https://github.com/gnikit/fortls/issues/4))
+- Fixes `USE` directive ordering issues
+  ([#184](https://github.com/hansec/fortran-language-server/issues/184))
+  ([gnikit/fortls#7](https://github.com/gnikit/fortls/issues/7))
 
 ## 1.16.0
 


Test patch:
diff --git a/test/test_server.py b/test/test_server.py
index cd326911..7a7414b3 100644
--- a/test/test_server.py
+++ b/test/test_server.py
@@ -195,6 +195,7 @@ def check_return(result_array):
             ["test_str1", 13, 5],
             ["test_str2", 13, 5],
             ["test_sub", 6, 8],
+            ["test_use_ordering", 2, 9],
             ["test_vis_mod", 2, 0],
         )
         assert len(result_array) == len(objs)
@@ -642,6 +643,11 @@ def check_return(results, ref_results):
     string += write_rpc_notification(
         "textDocument/didOpen", {"textDocument": {"uri": file_path}}
     )
+    # Test USE directive ordering errors
+    file_path = os.path.join(test_dir, "diag", "test_use_ordering.f90")
+    string += write_rpc_notification(
+        "textDocument/didOpen", {"textDocument": {"uri": file_path}}
+    )
     errcode, results = run_request(string)
     assert errcode == 0
     file_path = os.path.join(test_dir, "diag", "test_external.f90")
@@ -693,6 +699,7 @@ def check_return(results, ref_results):
             },
         ],
         [],
+        [],
     ]
     check_return(results[1:], ref_results)
 
diff --git a/test/test_source/diag/test_use_ordering.f90 b/test/test_source/diag/test_use_ordering.f90
new file mode 100644
index 00000000..65a13211
--- /dev/null
+++ b/test/test_source/diag/test_use_ordering.f90
@@ -0,0 +1,16 @@
+module mod_a
+   integer, parameter   :: q_a = 4
+end module
+
+module mod_b
+   use mod_a
+   integer, parameter   :: q_b = 8
+end module
+
+program test_use_ordering
+   use mod_b,  only: q_b
+   use mod_a
+
+   real(q_a) :: r_a
+   real(q_b) :: r_b
+end program test_use_ordering