The invisible kind of characters, like zero-width space, can create bugs that are impossible to trace in the code. This change enables the detection of such unwanted characters and possibly a warning/blocking their usage in code to guarantee the quality of source code.
Diagnostic Messages Add following two diagnostic messages:
"Whitespace detected.": Whenever whitespace is detected.
"Invisible character detected.": When invisible characters are detected.
This PR will add in invisible character detection functionality in code-expressions to the Cairo plugin.
Invisible Character and Whitespaces detection:
check_invisible_characters
is implemented and performs the following checks in theExpr
:Severity::Warning
) if present.Severity::Error
) on C-style string literals like\u{200B}
,\u{00AD}
,\u{200C}
,\u{200D}
,\u{202C}
,\u{FEFF}
.Motivation:
zero-width space
, can create bugs that are impossible to trace in the code. This change enables the detection of such unwanted characters and possibly a warning/blocking their usage in code to guarantee the quality of source code.Diagnostic Messages Add following two diagnostic messages: