MCPcopy
hub / github.com/oraios/serena / has_malformed_name

Function has_malformed_name

test/solidlsp/conftest.py:26–50  ·  view source on GitHub ↗
(
    symbol: UnifiedSymbolInformation,
    whitespace_allowed: bool = False,
    period_allowed: bool = False,
    colon_allowed: bool = False,
    brace_allowed: bool = False,
    parenthesis_allowed: bool = False,
    comma_allowed: bool = False,
)

Source from the content-addressed store, hash-verified

24
25
26def has_malformed_name(
27 symbol: UnifiedSymbolInformation,
28 whitespace_allowed: bool = False,
29 period_allowed: bool = False,
30 colon_allowed: bool = False,
31 brace_allowed: bool = False,
32 parenthesis_allowed: bool = False,
33 comma_allowed: bool = False,
34) -> bool:
35 forbidden_chars: list[str] = []
36
37 if not whitespace_allowed:
38 forbidden_chars.append(" ")
39 if not period_allowed:
40 forbidden_chars.append(".")
41 if not colon_allowed:
42 forbidden_chars.append(":")
43 if not brace_allowed:
44 forbidden_chars.append("{")
45 if not parenthesis_allowed:
46 forbidden_chars.append("(")
47 if not comma_allowed:
48 forbidden_chars.append(",")
49
50 return any(separator in symbol["name"] for separator in forbidden_chars)
51
52
53def request_all_symbols(language_server: SolidLanguageServer) -> list[UnifiedSymbolInformation]:

Callers 15

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected