File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
language_server/src/robotcode/language_server/robotframework/diagnostics
robot/src/robotcode/robot/config Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1717 AbstractSet ,
1818 Any ,
1919 Callable ,
20- ClassVar ,
2120 Dict ,
2221 Iterable ,
2322 Iterator ,
@@ -615,6 +614,9 @@ class LibraryType(Enum):
615614
616615ROBOT_DEFAULT_SCOPE = "TEST"
617616
617+ RE_INLINE_LINK = re .compile (r"([\`])((?:\1|.)+?)\1" , re .VERBOSE )
618+ RE_HEADERS = re .compile (r"^(#{2,9})\s+(\S.*)$" , re .MULTILINE )
619+
618620
619621@dataclass
620622class LibraryDoc :
@@ -747,22 +749,15 @@ def source_or_origin(self) -> Optional[str]:
747749
748750 return None
749751
750- _inline_link : ClassVar [re .Pattern ] = re .compile ( # type: ignore
751- r"([\`])((?:\1|.)+?)\1" ,
752- re .VERBOSE ,
753- )
754-
755- _headers : ClassVar [re .Pattern ] = re .compile (r"^(#{2,9})\s+(\S.*)$" , re .MULTILINE ) # type: ignore
756-
757752 def _link_inline_links (self , text : str ) -> str :
758- headers = [v .group (2 ) for v in self . _headers .finditer (text )]
753+ headers = [v .group (2 ) for v in RE_HEADERS .finditer (text )]
759754
760755 def repl (m : re .Match ) -> str : # type: ignore
761756 if m .group (2 ) in headers :
762757 return f"[{ str (m .group (2 ))} ](\\ #{ str (m .group (2 )).lower ().replace (' ' , '-' )} )"
763758 return str (m .group (0 ))
764759
765- return str (self . _inline_link .sub (repl , text ))
760+ return str (RE_INLINE_LINK .sub (repl , text ))
766761
767762 def _get_doc_for_keywords (self , header_level : int = 2 ) -> str :
768763 result = ""
Original file line number Diff line number Diff line change 1+ # ruff: noqa: RUF009
2+
13import dataclasses
24import datetime
35import fnmatch
You can’t perform that action at this time.
0 commit comments