diff --git a/fortls/langserver.py b/fortls/langserver.py index bb9b01bf..54de9d44 100644 --- a/fortls/langserver.py +++ b/fortls/langserver.py @@ -882,7 +882,7 @@ def get_all_references(self, def_obj, type_mem, file_obj=None): # Search through all files def_name = def_obj.name.lower() def_fqsn = def_obj.FQSN - NAME_REGEX = re.compile(fr"(?:\W|^)({def_name})(?:\W|$)", re.I) + NAME_REGEX = re.compile(rf"(?:\W|^)({def_name})(?:\W|$)", re.I) if file_obj is None: file_set = self.workspace.items() else: diff --git a/fortls/parse_fortran.py b/fortls/parse_fortran.py index 044eee83..5e463dfe 100644 --- a/fortls/parse_fortran.py +++ b/fortls/parse_fortran.py @@ -1381,7 +1381,7 @@ def replace_vars(line: str): for def_tmp, value in defs_tmp.items(): def_regex = def_regexes.get(def_tmp) if def_regex is None: - def_regex = re.compile(fr"\b{def_tmp}\b") + def_regex = re.compile(rf"\b{def_tmp}\b") def_regexes[def_tmp] = def_regex line_new, nsubs = def_regex.subn(value, line) if nsubs > 0: diff --git a/fortls/regex_patterns.py b/fortls/regex_patterns.py index 2abe594e..10df02d1 100644 --- a/fortls/regex_patterns.py +++ b/fortls/regex_patterns.py @@ -157,4 +157,4 @@ def src_file_exts(input_exts: list[str] = []) -> Pattern[str]: FORTRAN_FILE_EXTS.append(e.replace(".", "")) # Cast into a set to ensure uniqueness of extensions & sort for consistency # Create a regular expression from this - return re.compile(fr"\.({'|'.join(sorted(set(FORTRAN_FILE_EXTS)))})?$") + return re.compile(rf"\.({'|'.join(sorted(set(FORTRAN_FILE_EXTS)))})?$")