13 from PyQt4.Qsci import QsciLexerRuby |
13 from PyQt4.Qsci import QsciLexerRuby |
14 |
14 |
15 from .CompleterBase import CompleterBase |
15 from .CompleterBase import CompleterBase |
16 |
16 |
17 import Preferences |
17 import Preferences |
|
18 |
18 |
19 |
19 class CompleterRuby(CompleterBase): |
20 class CompleterRuby(CompleterBase): |
20 """ |
21 """ |
21 Class implementing typing completer for Ruby. |
22 Class implementing typing completer for Ruby. |
22 """ |
23 """ |
23 def __init__(self, editor, parent = None): |
24 def __init__(self, editor, parent=None): |
24 """ |
25 """ |
25 Constructor |
26 Constructor |
26 |
27 |
27 @param editor reference to the editor object (QScintilla.Editor) |
28 @param editor reference to the editor object (QScintilla.Editor) |
28 @param parent reference to the parent object (QObject) |
29 @param parent reference to the parent object (QObject) |
173 |
174 |
174 def __inDoubleQuotedString(self): |
175 def __inDoubleQuotedString(self): |
175 """ |
176 """ |
176 Private method to check, if the cursor is within a double quoted string. |
177 Private method to check, if the cursor is within a double quoted string. |
177 |
178 |
178 @return flag indicating, if the cursor is inside a double |
179 @return flag indicating, if the cursor is inside a double |
179 quoted string (boolean) |
180 quoted string (boolean) |
180 """ |
181 """ |
181 return self.editor.currentStyle() == QsciLexerRuby.DoubleQuotedString |
182 return self.editor.currentStyle() == QsciLexerRuby.DoubleQuotedString |
182 |
183 |
183 def __inSingleQuotedString(self): |
184 def __inSingleQuotedString(self): |
184 """ |
185 """ |
185 Private method to check, if the cursor is within a single quoted string. |
186 Private method to check, if the cursor is within a single quoted string. |
186 |
187 |
187 @return flag indicating, if the cursor is inside a single |
188 @return flag indicating, if the cursor is inside a single |
188 quoted string (boolean) |
189 quoted string (boolean) |
189 """ |
190 """ |
190 return self.editor.currentStyle() == QsciLexerRuby.SingleQuotedString |
191 return self.editor.currentStyle() == QsciLexerRuby.SingleQuotedString |
191 |
192 |
192 def __inHereDocument(self): |
193 def __inHereDocument(self): |