File tree 2 files changed +7
-10
lines changed
language_server/src/robotcode/language_server/robotframework/diagnostics
robot/src/robotcode/robot/config
2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 17
17
AbstractSet ,
18
18
Any ,
19
19
Callable ,
20
- ClassVar ,
21
20
Dict ,
22
21
Iterable ,
23
22
Iterator ,
@@ -615,6 +614,9 @@ class LibraryType(Enum):
615
614
616
615
ROBOT_DEFAULT_SCOPE = "TEST"
617
616
617
+ RE_INLINE_LINK = re .compile (r"([\`])((?:\1|.)+?)\1" , re .VERBOSE )
618
+ RE_HEADERS = re .compile (r"^(#{2,9})\s+(\S.*)$" , re .MULTILINE )
619
+
618
620
619
621
@dataclass
620
622
class LibraryDoc :
@@ -747,22 +749,15 @@ def source_or_origin(self) -> Optional[str]:
747
749
748
750
return None
749
751
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
-
757
752
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 )]
759
754
760
755
def repl (m : re .Match ) -> str : # type: ignore
761
756
if m .group (2 ) in headers :
762
757
return f"[{ str (m .group (2 ))} ](\\ #{ str (m .group (2 )).lower ().replace (' ' , '-' )} )"
763
758
return str (m .group (0 ))
764
759
765
- return str (self . _inline_link .sub (repl , text ))
760
+ return str (RE_INLINE_LINK .sub (repl , text ))
766
761
767
762
def _get_doc_for_keywords (self , header_level : int = 2 ) -> str :
768
763
result = ""
Original file line number Diff line number Diff line change
1
+ # ruff: noqa: RUF009
2
+
1
3
import dataclasses
2
4
import datetime
3
5
import fnmatch
You can’t perform that action at this time.
0 commit comments