Skip to content

Commit abbe440

Browse files
committed
refactor: improve debug_server_parser code readability and consistency
1 parent 8faa730 commit abbe440

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

fortls/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,21 +554,23 @@ def locate_config(root: str) -> str | None:
554554
print(f"Error {e} while parsing '{args.config}' settings file")
555555

556556
print("\nTesting parser")
557-
print(' File = "{}"'.format(args.debug_filepath))
557+
separator()
558+
print(f' File = "{args.debug_filepath}"')
558559
file_obj = FortranFile(args.debug_filepath, pp_suffixes)
559560
err_str, _ = file_obj.load_from_disk()
560561
if err_str:
561562
raise DebugError(f"Reading file failed: {err_str}")
562563
print(f" Detected format: {'fixed' if file_obj.fixed else 'free'}")
563-
print("\n=========\nParser Output\n=========\n")
564+
print("\n" + "=" * 80 + "\nParser Output\n" + "=" * 80 + "\n")
564565
file_ast = file_obj.parse(debug=True, pp_defs=pp_defs, include_dirs=include_dirs)
565-
print("\n=========\nObject Tree\n=========\n")
566+
print("\n" + "=" * 80 + "\nObject Tree\n" + "=" * 80 + "\n")
566567
for obj in file_ast.get_scopes():
567-
print("{}: {}".format(obj.get_type(), obj.FQSN))
568+
print(f"{obj.get_type()}: {obj.FQSN}")
568569
print_children(obj)
569-
print("\n=========\nExportable Objects\n=========\n")
570+
print("\n" + "=" * 80 + "\nExportable Objects\n" + "=" * 80 + "\n")
570571
for _, obj in file_ast.global_dict.items():
571-
print("{}: {}".format(obj.get_type(), obj.FQSN))
572+
print(f"{obj.get_type()}: {obj.FQSN}")
573+
separator()
572574

573575

574576
def ensure_file_accessible(filepath: str):

0 commit comments

Comments
 (0)