src/eric7/QScintilla/Lexers/Lexer.py

branch
eric7
changeset 10431
64157aeb0312
parent 10069
435cc5875135
child 10439
21c28b0f9e41
equal deleted inserted replaced
10430:e440aaf179ce 10431:64157aeb0312
106 106
107 def alwaysKeepTabs(self): 107 def alwaysKeepTabs(self):
108 """ 108 """
109 Public method to check, if tab conversion is allowed. 109 Public method to check, if tab conversion is allowed.
110 110
111 @return flag indicating to keep tabs (boolean) 111 @return flag indicating to keep tabs
112 @rtype bool
112 """ 113 """
113 return self._alwaysKeepTabs 114 return self._alwaysKeepTabs
114 115
115 def hasSmartIndent(self): 116 def hasSmartIndent(self):
116 """ 117 """
117 Public method indicating whether lexer can do smart indentation. 118 Public method indicating whether lexer can do smart indentation.
118 119
119 @return flag indicating availability of smartIndentLine and 120 @return flag indicating availability of smartIndentLine and
120 smartIndentSelection methods (boolean) 121 smartIndentSelection methods
122 @rtype bool
121 """ 123 """
122 return hasattr(self, "getIndentationDifference") 124 return hasattr(self, "getIndentationDifference")
123 125
124 def smartIndentLine(self, editor): 126 def smartIndentLine(self, editor):
125 """ 127 """
126 Public method to handle smart indentation for a line. 128 Public method to handle smart indentation for a line.
127 129
128 @param editor reference to the QScintilla editor object 130 @param editor reference to the QScintilla editor object
131 @type Editor
129 """ 132 """
130 cline, cindex = editor.getCursorPosition() 133 cline, cindex = editor.getCursorPosition()
131 134
132 # get leading spaces 135 # get leading spaces
133 lead_spaces = editor.indentation(cline) 136 lead_spaces = editor.indentation(cline)
147 150
148 Note: The assumption is, that the first line determines the new 151 Note: The assumption is, that the first line determines the new
149 indentation level. 152 indentation level.
150 153
151 @param editor reference to the QScintilla editor object 154 @param editor reference to the QScintilla editor object
155 @type Editor
152 """ 156 """
153 if not editor.hasSelectedText(): 157 if not editor.hasSelectedText():
154 return 158 return
155 159
156 # get the selection 160 # get the selection
181 185
182 def autoCompletionWordSeparators(self): 186 def autoCompletionWordSeparators(self):
183 """ 187 """
184 Public method to return the list of separators for autocompletion. 188 Public method to return the list of separators for autocompletion.
185 189
186 @return list of separators (list of strings) 190 @return list of separators
191 @rtype list of str
187 """ 192 """
188 return [] 193 return []
189 194
190 def isCommentStyle(self, style): # noqa: U100 195 def isCommentStyle(self, style): # noqa: U100
191 """ 196 """
192 Public method to check, if a style is a comment style. 197 Public method to check, if a style is a comment style.
193 198
194 @param style style to check (integer) 199 @param style style to check
195 @return flag indicating a comment style (boolean) 200 @type int
201 @return flag indicating a comment style
202 @rtype bool
196 """ 203 """
197 return True 204 return True
198 205
199 def isStringStyle(self, style): # noqa: U100 206 def isStringStyle(self, style): # noqa: U100
200 """ 207 """
201 Public method to check, if a style is a string style. 208 Public method to check, if a style is a string style.
202 209
203 @param style style to check (integer) 210 @param style style to check
204 @return flag indicating a string style (boolean) 211 @type int
212 @return flag indicating a string style
213 @rtype bool
205 """ 214 """
206 return True 215 return True
207 216
208 def keywords(self, kwSet): 217 def keywords(self, kwSet):
209 """ 218 """
262 271
263 def lexerName(self): 272 def lexerName(self):
264 """ 273 """
265 Public method to return the lexer name. 274 Public method to return the lexer name.
266 275
267 @return lexer name (string) 276 @return lexer name
277 @rtype str
268 """ 278 """
269 return self.lexer() 279 return self.lexer()
270 280
271 def hasSubstyles(self): 281 def hasSubstyles(self):
272 """ 282 """

eric ide

mercurial