PluginRefactoringRope.py

Sun, 31 May 2015 18:11:14 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 31 May 2015 18:11:14 +0200
changeset 125
e775b4f9d07c
parent 122
3696915ebc80
child 127
9b9bd5b7f100
permissions
-rw-r--r--

Adapted to the extended Editor API as of eric 6.1.0.

1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
1 # -*- coding: utf-8 -*-
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
2
94
03d6a17c66ac Updated copyright for 2015.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 87
diff changeset
3 # Copyright (c) 2010 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
4 #
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
5
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
6 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
7 Module implementing the Rope refactoring plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
8 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
9
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
10 from __future__ import unicode_literals
50
a29c3d2e6dc0 rope for Python2 projects enabled, if running on Python2
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 48
diff changeset
11
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
12 import os
50
a29c3d2e6dc0 rope for Python2 projects enabled, if running on Python2
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 48
diff changeset
13 import sys
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
14
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
15 from PyQt5.QtCore import QObject, QTranslator, QCoreApplication, QTimer
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
16
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
17 from E5Gui.E5Application import e5App
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
18
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
19 import Preferences
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
20 import Utilities
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
21
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
22 from Preferences.Shortcuts import readShortcuts
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
23
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
24 # Start-Of-Header
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
25 name = "Refactoring Rope Plugin"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
26 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
27 autoactivate = True
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
28 deactivateable = True
125
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
29 version = "4.1.0"
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
30 className = "RefactoringRopePlugin"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
31 packageName = "RefactoringRope"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
32 internalPackages = "rope"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
33 shortDescription = "Refactoring using the Rope library."
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
34 longDescription = """This plug-in implements refactoring functionality""" \
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
35 """ using the Rope refactoring library. Additonally it implements an """ \
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
36 """ alternative auto-completion and calltips provider. Only""" \
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
37 """ refactoring, completions and calltips in the same Python variant""" \
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
38 """ as Eric is running is allowed."""
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
39 pyqtApi = 2
52
abd297a94a55 Added the 'doNotCompile' plug-in module header entry to avoid attempting to compile the sources, which will raise errors due to the rope variants for both Python versions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 51
diff changeset
40 doNotCompile = True
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
41 python2Compatible = True
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
42 # End-Of-Header
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
43
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
44 error = ""
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
45
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
46 refactoringRopePluginObject = None
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
47
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
48
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
49 def createAutoCompletionPage(configDlg):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
50 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
51 Module function to create the autocompletion configuration page.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
52
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
53 @param configDlg reference to the configuration dialog
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
54 @return reference to the configuration page
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
55 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
56 global refactoringRopePluginObject
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
57 from RefactoringRope.ConfigurationPage.AutoCompletionRopePage \
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
58 import AutoCompletionRopePage
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
59 page = AutoCompletionRopePage(refactoringRopePluginObject)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
60 return page
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
61
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
62
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
63 def createCallTipsPage(configDlg):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
64 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
65 Module function to create the calltips configuration page.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
66
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
67 @param configDlg reference to the configuration dialog
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
68 @return reference to the configuration page
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
69 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
70 global refactoringRopePluginObject
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
71 from RefactoringRope.ConfigurationPage.CallTipsRopePage \
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
72 import CallTipsRopePage
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
73 page = CallTipsRopePage(refactoringRopePluginObject)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
74 return page
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
75
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
76
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
77 def getConfigData():
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
78 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
79 Module function returning data as required by the configuration dialog.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
80
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
81 @return dictionary containing the relevant data
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
82 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
83 return {
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
84 "ropeAutoCompletionPage": [
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
85 QCoreApplication.translate("RefactoringRopePlugin", "Rope"),
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
86 os.path.join("RefactoringRope", "ConfigurationPage",
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
87 "preferences-refactoring.png"),
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
88 createAutoCompletionPage, "editorAutocompletionPage", None],
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
89 "ropeCallTipsPage": [
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
90 QCoreApplication.translate("RefactoringRopePlugin", "Rope"),
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
91 os.path.join("RefactoringRope", "ConfigurationPage",
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
92 "preferences-refactoring.png"),
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
93 createCallTipsPage, "editorCalltipsPage", None],
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
94 }
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
95
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
96
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
97 def prepareUninstall():
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
98 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
99 Module function to prepare for an uninstallation.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
100 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
101 Preferences.Prefs.settings.remove(RefactoringRopePlugin.PreferencesKey)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
102
20
83b71483e198 Made the code PEP-8 compliant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1
diff changeset
103
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
104 class RefactoringRopePlugin(QObject):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
105 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
106 Class implementing the Rope refactoring plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
107 """
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
108 PreferencesKey = "RefactoringRope"
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
109
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
110 def __init__(self, ui):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
111 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
112 Constructor
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
113
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
114 @param ui reference to the user interface object (UI.UserInterface)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
115 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
116 QObject.__init__(self, ui)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
117 self.__ui = ui
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
118 self.__initialize()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
119
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
120 self.__defaults = {
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
121 "CodeAssistEnabled": False,
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
122 "MaxFixes": 10,
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
123 "CodeAssistTimeout": 100,
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
124 "ShowQScintillaCompletions": True,
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
125
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
126 "CodeAssistCalltipsEnabled": False,
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
127 "CalltipsMaxFixes": 10,
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
128 }
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
129
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
130 self.__translator = None
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
131 self.__loadTranslator()
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
132
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
133 self.__acTimer = QTimer(self)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
134 self.__acTimer.setSingleShot(True)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
135 self.__acTimer.setInterval(self.getPreferences("CodeAssistTimeout"))
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
136 self.__acTimer.timeout.connect(self.__codeAssist)
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
137
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
138 def __initialize(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
139 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
140 Private slot to (re)initialize the plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
141 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
142 self.__object = None
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
143 self.__caObject = None
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
144
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
145 self.__mainAct = None
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
146 self.__mainMenu = None
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
147 self.__projectIsOpen = False
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
148
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
149 self.__editors = []
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
150
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
151 self.__currentEditor = None
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
152 self.__savedEditorName = None
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
153 self.__oldEditorText = ""
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
154
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
155 def __checkUiVersion(self):
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
156 """
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
157 Private method to check, if the IDE has a suitable version.
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
158
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
159 @return flag indicating a suitable version (boolean)
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
160 """
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
161 global error
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
162
87
1fbf5fdbe721 Ported to PyQt5 and eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 83
diff changeset
163 suitable = self.__ui.versionIsNewer("5.99.99", "20140701")
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
164 if not suitable:
87
1fbf5fdbe721 Ported to PyQt5 and eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 83
diff changeset
165 error = self.tr("Your version of eric6 is not supported.")
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
166 return suitable
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
167
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
168 def activate(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
169 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
170 Public method to activate this plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
171
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
172 @return tuple of None and activation status (boolean)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
173 """
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
174 global error
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
175 error = "" # clear previous error
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
176
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
177 if not self.__checkUiVersion():
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
178 return None, False
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
179
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
180 global refactoringRopePluginObject
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
181 refactoringRopePluginObject = self
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
182
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
183 from RefactoringRope.Refactoring import Refactoring
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
184 from RefactoringRope.CodeAssist import CodeAssist
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
185
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
186 self.__caObject = CodeAssist(self, self)
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
187
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
188 self.__object = Refactoring(self, self.__ui)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
189 self.__object.initActions()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
190 e5App().registerPluginObject("RefactoringRope", self.__object)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
191 try:
20
83b71483e198 Made the code PEP-8 compliant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1
diff changeset
192 readShortcuts(pluginName="RefactoringRope")
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
193 except TypeError:
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
194 # backwards comaytibility, ignore
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
195 pass
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
196
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
197 self.__mainMenu = self.__object.initMenu()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
198 extrasAct = self.__ui.getMenuBarAction("extras")
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
199 self.__mainAct = self.__ui.menuBar().insertMenu(
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
200 extrasAct, self.__mainMenu)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
201
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
202 if e5App().getObject("Project").isOpen():
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
203 self.__projectOpened()
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
204
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
205 if self.__projectIsOpen:
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
206 self.__object.projectOpened()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
207
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
208 e5App().getObject("ViewManager").editorOpenedEd.connect(
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
209 self.__editorOpened)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
210 e5App().getObject("ViewManager").editorClosedEd.connect(
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
211 self.__editorClosed)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
212
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
213 e5App().getObject("Project").projectOpened.connect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
214 self.__object.projectOpened)
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
215 e5App().getObject("Project").projectPropertiesChanged.connect(
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
216 self.__object.projectOpened)
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
217 e5App().getObject("Project").projectClosed.connect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
218 self.__object.projectClosed)
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
219 e5App().getObject("Project").newProject.connect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
220 self.__object.projectOpened)
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
221
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
222 e5App().getObject("Project").projectOpened.connect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
223 self.__projectOpened)
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
224 e5App().getObject("Project").projectPropertiesChanged.connect(
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
225 self.__projectOpened)
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
226 e5App().getObject("Project").projectClosed.connect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
227 self.__projectClosed)
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
228 e5App().getObject("Project").newProject.connect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
229 self.__projectOpened)
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
230
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
231 if e5App().getObject("Project").isOpen():
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
232 for editor in e5App().getObject("ViewManager").getOpenEditors():
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
233 self.__editorOpened(editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
234
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
235 return None, True
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
236
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
237 def deactivate(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
238 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
239 Public method to deactivate this plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
240 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
241 e5App().unregisterPluginObject("RefactoringRope")
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
242
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
243 e5App().getObject("ViewManager").editorOpenedEd.disconnect(
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
244 self.__editorOpened)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
245 e5App().getObject("ViewManager").editorClosedEd.disconnect(
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
246 self.__editorClosed)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
247
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
248 e5App().getObject("Project").projectOpened.disconnect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
249 self.__object.projectOpened)
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
250 e5App().getObject("Project").projectPropertiesChanged.disconnect(
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
251 self.__object.projectOpened)
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
252 e5App().getObject("Project").projectClosed.disconnect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
253 self.__object.projectClosed)
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
254 e5App().getObject("Project").newProject.disconnect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
255 self.__object.projectOpened)
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
256
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
257 e5App().getObject("Project").projectOpened.disconnect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
258 self.__projectOpened)
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
259 e5App().getObject("Project").projectPropertiesChanged.disconnect(
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
260 self.__projectOpened)
31
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
261 e5App().getObject("Project").projectClosed.disconnect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
262 self.__projectClosed)
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
263 e5App().getObject("Project").newProject.disconnect(
0389d4a924cc Dropped support for eric 5.0.x.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 20
diff changeset
264 self.__projectOpened)
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
265
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
266 self.__ui.menuBar().removeAction(self.__mainAct)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
267
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
268 for editor in self.__editors[:]:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
269 self.__editorClosed(editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
270
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
271 self.__initialize()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
272
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
273 def __loadTranslator(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
274 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
275 Private method to load the translation file.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
276 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
277 if self.__ui is not None:
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
278 loc = self.__ui.getLocale()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
279 if loc and loc != "C":
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
280 locale_dir = \
20
83b71483e198 Made the code PEP-8 compliant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1
diff changeset
281 os.path.join(os.path.dirname(__file__),
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
282 "RefactoringRope", "i18n")
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
283 translation = "rope_%s" % loc
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
284 translator = QTranslator(None)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
285 loaded = translator.load(translation, locale_dir)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
286 if loaded:
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
287 self.__translator = translator
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
288 e5App().installTranslator(self.__translator)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
289 else:
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
290 print("Warning: translation file '{0}' could not"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
291 " be loaded.".format(translation))
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
292 print("Using default.")
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
293
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
294 def getPreferences(self, key):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
295 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
296 Public method to retrieve the various refactoring settings.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
297
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
298 @param key the key of the value to get
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
299 @return the requested refactoring setting
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
300 """
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
301 if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled",
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
302 "ShowQScintillaCompletions"]:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
303 return Preferences.toBool(Preferences.Prefs.settings.value(
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
304 self.PreferencesKey + "/" + key, self.__defaults[key]))
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
305 else:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
306 return int(Preferences.Prefs.settings.value(
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
307 self.PreferencesKey + "/" + key, self.__defaults[key]))
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
308
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
309 def setPreferences(self, key, value):
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
310 """
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
311 Public method to store the various refactoring settings.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
312
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
313 @param key the key of the setting to be set (string)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
314 @param value the value to be set
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
315 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
316 Preferences.Prefs.settings.setValue(
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
317 self.PreferencesKey + "/" + key, value)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
318
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
319 if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled"]:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
320 if value:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
321 if e5App().getObject("Project").isOpen():
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
322 for editor in e5App().getObject("ViewManager")\
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
323 .getOpenEditors():
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
324 if editor not in self.__editors:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
325 self.__editorOpened(editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
326 else:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
327 for editor in self.__editors[:]:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
328 self.__editorClosed(editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
329 elif key == "CodeAssistTimeout":
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
330 self.__acTimer.setInterval(value)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
331
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
332 def __determineLanguage(self):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
333 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
334 Private method to determine the valid language strings.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
335
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
336 @return list of valid language strings (list of string)
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
337 """
50
a29c3d2e6dc0 rope for Python2 projects enabled, if running on Python2
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 48
diff changeset
338 if sys.version_info[0] == 3:
114
b176e34cd6bd Fixed a few bugs related to changing an editor's language.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 112
diff changeset
339 lang = ["Python3", "Pygments|Python 3"]
50
a29c3d2e6dc0 rope for Python2 projects enabled, if running on Python2
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 48
diff changeset
340 elif sys.version_info[0] == 2:
114
b176e34cd6bd Fixed a few bugs related to changing an editor's language.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 112
diff changeset
341 lang = ["Python", "Python2", "Pygments|Python"]
50
a29c3d2e6dc0 rope for Python2 projects enabled, if running on Python2
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 48
diff changeset
342 else:
a29c3d2e6dc0 rope for Python2 projects enabled, if running on Python2
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 48
diff changeset
343 lang = []
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
344
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
345 return lang
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
346
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
347 def __projectOpened(self):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
348 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
349 Private slot to handle the projectOpened signal.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
350 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
351 lang = self.__determineLanguage()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
352
76
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
353 enabled = e5App().getObject("Project").getProjectLanguage() in lang
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
354 self.__mainAct.setEnabled(enabled)
936b2a98fe4e Merge with Py2 comp.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 74 63
diff changeset
355 self.__projectIsOpen = enabled
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
356
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
357 def __projectClosed(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
358 """
87
1fbf5fdbe721 Ported to PyQt5 and eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 83
diff changeset
359 Private slot to handle the projectClosed signal.
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
360 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
361 self.__mainAct.setEnabled(False)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
362 self.__projectIsOpen = False
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
363
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
364 def __editorOpened(self, editor):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
365 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
366 Private slot called, when a new editor was opened.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
367
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
368 @param editor reference to the new editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
369 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
370 lang = self.__determineLanguage()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
371
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
372 if editor.getLanguage() in lang:
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
373 self.__connectEditor(editor)
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
374
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
375 editor.languageChanged.connect(self.__editorLanguageChanged)
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
376 self.__editors.append(editor)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
377
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
378 def __editorClosed(self, editor):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
379 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
380 Private slot called, when an editor was closed.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
381
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
382 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
383 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
384 if editor in self.__editors:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
385 editor.languageChanged.disconnect(self.__editorLanguageChanged)
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
386 self.__disconnectEditor(editor)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
387 self.__editors.remove(editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
388
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
389 def __editorLanguageChanged(self, language):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
390 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
391 Private slot to handle the language change of an editor.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
392
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
393 @param language programming language of the editor (string)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
394 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
395 editor = self.sender()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
396 lang = self.__determineLanguage()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
397
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
398 if language in lang:
125
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
399 try:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
400 if editor.getCompletionListHook("rope") is None or \
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
401 editor.getCallTipHook("rope") is None:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
402 self.__connectEditor(editor)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
403 except AttributeError:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
404 # old interface (before 6.1.0)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
405 if editor.autoCompletionHook() != self.codeAssist or \
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
406 editor.callTipHook() != self.codeAssistCallTip:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
407 self.__connectEditor(editor)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
408 else:
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
409 self.__disconnectEditor(editor)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
410
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
411 def __connectEditor(self, editor):
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
412 """
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
413 Private method to connect an editor.
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
414
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
415 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
416 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
417 editor.editorAboutToBeSaved.connect(self.__editorAboutToBeSaved)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
418 editor.editorSaved.connect(self.__editorSaved)
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
419
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
420 if self.getPreferences("CodeAssistEnabled"):
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
421 self.__setAutoCompletionHook(editor)
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
422 if self.getPreferences("CodeAssistCalltipsEnabled"):
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
423 self.__setCalltipsHook(editor)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
424
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
425 def __disconnectEditor(self, editor):
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
426 """
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
427 Private method to disconnect an editor.
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
428
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
429 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
430 """
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
431 try:
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
432 editor.editorAboutToBeSaved.disconnect(self.__editorAboutToBeSaved)
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
433 editor.editorSaved.disconnect(self.__editorSaved)
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
434 except TypeError:
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
435 # just ignore it
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
436 pass
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
437
125
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
438 try:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
439 if editor.getCompletionListHook("rope"):
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
440 self.__unsetAutoCompletionHook(editor)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
441 except AttributeError:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
442 # old interface (before 6.1.0)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
443 if editor.autoCompletionHook() == self.codeAssist:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
444 self.__unsetAutoCompletionHook(editor)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
445 try:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
446 if editor.getCallTipHook("rope"):
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
447 self.__unsetCalltipsHook(editor)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
448 except AttributeError:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
449 # old interface (before 6.1.0)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
450 if editor.callTipHook() == self.codeAssistCallTip:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
451 self.__unsetCalltipsHook(editor)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
452
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
453 def __completionListSelected(self, id, txt):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
454 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
455 Private slot to handle the selection from the completion list.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
456
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
457 @param id the ID of the user list (should be 1) (integer)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
458 @param txt the selected text (QString)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
459 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
460 from QScintilla.Editor import EditorAutoCompletionListID
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
461
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
462 editor = self.sender()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
463 if id == EditorAutoCompletionListID:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
464 lst = txt.split()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
465 if len(lst) > 1:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
466 txt = lst[0]
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
467
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
468 if Preferences.getEditor("AutoCompletionReplaceWord"):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
469 editor.selectCurrentWord()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
470 editor.removeSelectedText()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
471 line, col = editor.getCursorPosition()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
472 else:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
473 line, col = editor.getCursorPosition()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
474 wLeft = editor.getWordLeft(line, col)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
475 if not txt.startswith(wLeft):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
476 editor.selectCurrentWord()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
477 editor.removeSelectedText()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
478 line, col = editor.getCursorPosition()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
479 elif wLeft:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
480 txt = txt[len(wLeft):]
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
481 editor.insert(txt)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
482 editor.setCursorPosition(line, col + len(txt))
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
483
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
484 def __setAutoCompletionHook(self, editor):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
485 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
486 Private method to set the autocompletion hook.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
487
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
488 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
489 """
125
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
490 try:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
491 editor.addCompletionListHook("rope", self.getCompletionsList)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
492 except AttributeError:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
493 # old interface (before 6.1.0)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
494 editor.userListActivated.connect(self.__completionListSelected)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
495 editor.setAutoCompletionHook(self.codeAssist)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
496
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
497 def __unsetAutoCompletionHook(self, editor):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
498 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
499 Private method to unset the autocompletion hook.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
500
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
501 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
502 """
125
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
503 try:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
504 editor.removeCompletionListHook("rope")
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
505 except AttributeError:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
506 # old interface (before 6.1.0)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
507 editor.unsetAutoCompletionHook()
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
508 editor.userListActivated.disconnect(self.__completionListSelected)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
509
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
510 def codeAssist(self, editor, context=False):
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
511 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
512 Public method to determine the autocompletion proposals.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
513
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
514 @param editor reference to the editor object, that called this method
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
515 QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
516 @param context flag indicating to autocomplete a context (boolean)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
517 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
518 self.__currentEditor = editor
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
519 if self.getPreferences("CodeAssistTimeout"):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
520 self.__acTimer.stop()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
521 self.__acTimer.start()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
522 else:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
523 self.__codeAssist()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
524
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
525 def __codeAssist(self):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
526 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
527 Private slot to show a list with completion proposals.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
528 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
529 from QScintilla.Editor import EditorAutoCompletionListID
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
530
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
531 if self.__currentEditor is not None:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
532 if self.__currentEditor.isListActive():
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
533 self.__currentEditor.cancelList()
119
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
534 completions = self.getCompletionsList(self.__currentEditor, False)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
535 if len(completions) == 0 and \
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
536 self.getPreferences("ShowQScintillaCompletions"):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
537 # try QScintilla autocompletion
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
538 self.__currentEditor.autoCompleteQScintilla()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
539 else:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
540 completions.sort()
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
541 self.__currentEditor.showUserList(EditorAutoCompletionListID,
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
542 completions)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
543
119
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
544 def getCompletionsList(self, editor, context):
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
545 """
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
546 Public method to get a list of possible completions.
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
547
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
548 @param editor reference to the editor object, that called this method
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
549 (QScintilla.Editor)
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
550 @param context flag indicating to autocomplete a context (boolean)
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
551 @return list of possible completions (list of strings)
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
552 """
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
553 completions = self.__caObject.getCompletions(editor)
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
554 return completions
a03f2be1997b Added some eye-candy and made the method to get a list of completions publicly available.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 118
diff changeset
555
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
556 def __editorAboutToBeSaved(self, filename):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
557 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
558 Private slot to get the old contents of the named file.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
559
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
560 @param filename name of the file about to be saved (string)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
561 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
562 if filename and os.path.exists(filename):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
563 try:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
564 self.__oldEditorText = Utilities.readEncodedFile(filename)[0]
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
565 except IOError:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
566 self.__oldEditorText = ""
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
567 self.__savedEditorName = filename
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
568 else:
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
569 self.__savedEditorName = ""
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
570 self.__oldEditorText = ""
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
571
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
572 def __editorSaved(self, filename):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
573 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
574 Private slot to activate SOA.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
575
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
576 @param filename name of the file that was saved (string)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
577 """
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
578 if filename == self.__savedEditorName and self.__oldEditorText:
106
b2b2107b8047 Little improvement to update the SOA database for refactoring upon saving a file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 104
diff changeset
579 self.__object.reportChanged(self.__savedEditorName,
b2b2107b8047 Little improvement to update the SOA database for refactoring upon saving a file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 104
diff changeset
580 self.__oldEditorText)
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
581 self.__caObject.reportChanged(self.__savedEditorName,
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
582 self.__oldEditorText)
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
583 else:
106
b2b2107b8047 Little improvement to update the SOA database for refactoring upon saving a file.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 104
diff changeset
584 self.__object.reportChanged(filename, "")
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
585 self.__caObject.reportChanged(filename, "")
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
586
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
587 def __setCalltipsHook(self, editor):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
588 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
589 Private method to set the calltip hook.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
590
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
591 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
592 """
125
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
593 try:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
594 editor.addCallTipHook("rope", self.codeAssistCallTip)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
595 except AttributeError:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
596 # old interface (before 6.1.0)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
597 editor.setCallTipHook(self.codeAssistCallTip)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
598
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
599 def __unsetCalltipsHook(self, editor):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
600 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
601 Private method to unset the calltip hook.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
602
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
603 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
604 """
125
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
605 try:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
606 editor.removeCallTipHook("rope")
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
607 except AttributeError:
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
608 # old interface (before 6.1.0)
e775b4f9d07c Adapted to the extended Editor API as of eric 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 122
diff changeset
609 editor.unsetCallTipHook()
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
610
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
611 def codeAssistCallTip(self, editor, pos, commas):
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
612 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
613 Public method to return a list of calltips.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
614
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
615 @param editor reference to the editor (QScintilla.Editor)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
616 @param pos position in the text for the calltip (integer)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
617 @param commas minimum number of commas contained in the calltip
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
618 (integer)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
619 @return list of possible calltips (list of strings)
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
620 """
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
621 cts = self.__caObject.getCallTips(pos, editor)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
622 return cts

eric ide

mercurial