13 import sys |
13 import sys |
14 import uuid |
14 import uuid |
15 |
15 |
16 from PyQt6.QtCore import pyqtSlot, QCoreApplication, QTimer |
16 from PyQt6.QtCore import pyqtSlot, QCoreApplication, QTimer |
17 |
17 |
18 from EricWidgets.EricApplication import ericApp |
18 from eric7 import Globals, Preferences |
19 from EricWidgets import EricMessageBox |
19 from eric7.EricNetwork.EricJsonServer import EricJsonServer |
20 |
20 from eric7.EricWidgets.EricApplication import ericApp |
21 from EricNetwork.EricJsonServer import EricJsonServer |
21 from eric7.EricWidgets import EricMessageBox |
22 |
22 from eric7.QScintilla.Editor import Editor |
23 from QScintilla.Editor import Editor |
|
24 |
|
25 import Globals |
|
26 import Preferences |
|
27 |
23 |
28 |
24 |
29 class CodeAssistServer(EricJsonServer): |
25 class CodeAssistServer(EricJsonServer): |
30 """ |
26 """ |
31 Class implementing the autocompletion interface to rope. |
27 Class implementing the autocompletion interface to rope. |
209 @type str |
205 @type str |
210 """ |
206 """ |
211 configfile = self.__ropeConfigFile(idString) |
207 configfile = self.__ropeConfigFile(idString) |
212 if configfile: |
208 if configfile: |
213 if os.path.exists(configfile): |
209 if os.path.exists(configfile): |
214 from QScintilla.MiniEditor import MiniEditor |
210 from eric7.QScintilla.MiniEditor import MiniEditor |
215 |
211 |
216 editor = MiniEditor(configfile) |
212 editor = MiniEditor(configfile) |
217 editor.show() |
213 editor.show() |
218 editor.editorSaved.connect(lambda: self.__configChanged(idString)) |
214 editor.editorSaved.connect(lambda: self.__configChanged(idString)) |
219 self.__editors[idString] = editor |
215 self.__editors[idString] = editor |
593 |
589 |
594 @param result dictionary containing the result data |
590 @param result dictionary containing the result data |
595 @type dict |
591 @type dict |
596 """ |
592 """ |
597 with contextlib.suppress(ImportError): |
593 with contextlib.suppress(ImportError): |
598 from QScintilla.Editor import ReferenceItem |
594 from eric7.QScintilla.Editor import ReferenceItem |
599 |
595 |
600 if "Error" not in result: |
596 if "Error" not in result: |
601 # ignore errors silently |
597 # ignore errors silently |
602 references = result["GotoReferencesList"] |
598 references = result["GotoReferencesList"] |
603 euuid = result["Uuid"] |
599 euuid = result["Uuid"] |