--- a/src/eric7/QScintilla/Lexers/LexerCSharp.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/QScintilla/Lexers/LexerCSharp.py Wed Jul 13 14:55:47 2022 +0200 @@ -17,26 +17,20 @@ """ Subclass to implement some additional lexer dependant methods. """ + def __init__(self, parent=None): """ Constructor - + @param parent parent widget of this lexer """ QsciLexerCSharp.__init__(self, parent) Lexer.__init__(self) - + self.commentString = "//" - self.streamCommentString = { - 'start': '/* ', - 'end': ' */' - } - self.boxCommentString = { - 'start': '/* ', - 'middle': ' * ', - 'end': ' */' - } - + self.streamCommentString = {"start": "/* ", "end": " */"} + self.boxCommentString = {"start": "/* ", "middle": " * ", "end": " */"} + self.keywordSetDescriptions = [ self.tr("Primary keywords and identifiers"), self.tr("Secondary keywords and identifiers"), @@ -45,7 +39,7 @@ self.tr("Preprocessor definitions"), self.tr("Task marker and error marker keywords"), ] - + def initProperties(self): """ Public slot to initialize the properties. @@ -60,44 +54,48 @@ indentStyle |= QsciScintilla.AiClosing self.setAutoIndentStyle(indentStyle) self.setFoldCompact(Preferences.getEditor("AllFoldCompact")) - + def isCommentStyle(self, style): """ Public method to check, if a style is a comment style. - + @param style style to check (integer) @return flag indicating a comment style (boolean) """ - return style in [QsciLexerCSharp.Comment, - QsciLexerCSharp.CommentDoc, - QsciLexerCSharp.CommentLine, - QsciLexerCSharp.CommentLineDoc] - + return style in [ + QsciLexerCSharp.Comment, + QsciLexerCSharp.CommentDoc, + QsciLexerCSharp.CommentLine, + QsciLexerCSharp.CommentLineDoc, + ] + def isStringStyle(self, style): """ Public method to check, if a style is a string style. - + @param style style to check (integer) @return flag indicating a string style (boolean) """ - return style in [QsciLexerCSharp.DoubleQuotedString, - QsciLexerCSharp.SingleQuotedString, - QsciLexerCSharp.UnclosedString, - QsciLexerCSharp.VerbatimString] - + return style in [ + QsciLexerCSharp.DoubleQuotedString, + QsciLexerCSharp.SingleQuotedString, + QsciLexerCSharp.UnclosedString, + QsciLexerCSharp.VerbatimString, + ] + def defaultKeywords(self, kwSet): """ Public method to get the default keywords. - + @param kwSet number of the keyword set (integer) @return string giving the keywords (string) or None """ return QsciLexerCSharp.keywords(self, kwSet) - + def maximumKeywordSet(self): """ Public method to get the maximum keyword set. - + @return maximum keyword set (integer) """ return 4