PluginRefactoringRope.py

Mon, 22 Jun 2020 18:08:10 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 22 Jun 2020 18:08:10 +0200
changeset 335
9438c2ed7732
parent 333
dbaee558f3ba
child 337
cfff39f4594d
permissions
-rw-r--r--

Removed support for Python2.

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
326
67bcde9c65b9 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 324
diff changeset
3 # Copyright (c) 2010 - 2020 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
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
13
191
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
14 from PyQt5.QtCore import Qt, QObject, QTranslator, QCoreApplication
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
15
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
16 from E5Gui.E5Application import e5App
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
17
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
18 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
19 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
20
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
21 # Start-Of-Header
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
22 name = "Refactoring Rope Plugin"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
24 autoactivate = True
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
25 deactivateable = True
335
9438c2ed7732 Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 333
diff changeset
26 version = "7.0.0"
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
27 className = "RefactoringRopePlugin"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
28 packageName = "RefactoringRope"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
29 internalPackages = "rope"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
30 shortDescription = "Refactoring using the Rope library."
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
31 longDescription = (
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
32 """This plug-in implements refactoring functionality"""
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
33 """ using the Rope refactoring library. Additionally it implements an"""
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
34 """ alternative auto-completion and call-tips provider. It is a"""
248
59e983db024b Adjusted the code style checking parameters and fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 246
diff changeset
35 """ provider for code documentation as well."""
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
36 )
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
37 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
38 doNotCompile = True
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
39 # End-Of-Header
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
40
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
41 error = ""
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
42
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
43 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
44
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
45
2bfe9e3fad8d Ported 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 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
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 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
49
2bfe9e3fad8d Ported 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 @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
51 @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
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 global refactoringRopePluginObject
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
54 from RefactoringRope.ConfigurationPage.AutoCompletionRopePage import (
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
55 AutoCompletionRopePage
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
56 )
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
57 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
58 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
59
2bfe9e3fad8d Ported 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
2bfe9e3fad8d Ported 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 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
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 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
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 @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
66 @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
67 """
2bfe9e3fad8d Ported 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 global refactoringRopePluginObject
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
69 from RefactoringRope.ConfigurationPage.CallTipsRopePage import (
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
70 CallTipsRopePage
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
71 )
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
72 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
73 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
74
2bfe9e3fad8d Ported 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
129
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
76 def createMouseClickHandlerPage(configDlg):
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
77 """
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
78 Module function to create the mouse click handler configuration page.
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
79
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
80 @param configDlg reference to the configuration dialog
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
81 @return reference to the configuration page
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
82 """
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
83 global refactoringRopePluginObject
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
84 from RefactoringRope.ConfigurationPage.MouseClickHandlerRopePage import (
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
85 MouseClickHandlerRopePage
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
86 )
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
87 page = MouseClickHandlerRopePage(
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
88 refactoringRopePluginObject)
129
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
89 return page
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
90
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
91
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
92 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
93 """
2bfe9e3fad8d Ported 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 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
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 @return dictionary containing the relevant data
201
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
97 @rtype dict
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
98 """
327
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
99 try:
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
100 usesDarkPalette = e5App().usesDarkPalette()
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
101 except AttributeError:
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
102 from PyQt5.QtGui import QPalette
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
103 palette = e5App().palette()
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
104 lightness = palette.color(QPalette.Window).lightness()
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
105 usesDarkPalette = lightness <= 128
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
106 if usesDarkPalette:
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
107 iconSuffix = "dark"
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
108 else:
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
109 iconSuffix = "light"
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
110
129
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
111 data = {
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
112 "ropeAutoCompletionPage": [
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
113 QCoreApplication.translate("RefactoringRopePlugin", "Rope"),
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
114 os.path.join("RefactoringRope", "ConfigurationPage",
327
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
115 "preferences-refactoring-{0}".format(iconSuffix)),
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
116 createAutoCompletionPage, "editorAutocompletionPage", None],
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
117 "ropeCallTipsPage": [
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
118 QCoreApplication.translate("RefactoringRopePlugin", "Rope"),
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
119 os.path.join("RefactoringRope", "ConfigurationPage",
327
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
120 "preferences-refactoring-{0}".format(iconSuffix)),
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
121 createCallTipsPage, "editorCalltipsPage", None],
191
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
122 "ropeMouseClickHandlerPage": [
129
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
123 QCoreApplication.translate("RefactoringRopePlugin", "Rope"),
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
124 os.path.join("RefactoringRope", "ConfigurationPage",
327
473fd642982e Replaced pixmap icons by vector icons.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 326
diff changeset
125 "preferences-refactoring-{0}".format(iconSuffix)),
191
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
126 createMouseClickHandlerPage, "1editorMouseClickHandlers", None],
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
127 }
129
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
128
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
129 return data
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
130
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
131
2bfe9e3fad8d Ported 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 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
133 """
2bfe9e3fad8d Ported 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 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
135 """
2bfe9e3fad8d Ported 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 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
137
20
83b71483e198 Made the code PEP-8 compliant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1
diff changeset
138
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
139 class RefactoringRopePlugin(QObject):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
140 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
141 Class implementing the Rope refactoring plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
142 """
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
143 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
144
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
145 def __init__(self, ui):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
146 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
147 Constructor
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
148
201
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
149 @param ui reference to the user interface object
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
150 @type UI.UserInterface
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
151 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
152 QObject.__init__(self, ui)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
153 self.__ui = ui
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
154 self.__initialize()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
155
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
156 self.__defaults = {
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
157 "CodeAssistEnabled": False,
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
158 "MaxFixes": 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
159
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
160 "CodeAssistCalltipsEnabled": False,
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
161 "CalltipsMaxFixes": 10,
129
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
162
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
163 "MouseClickEnabled": True,
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
164 "MouseClickGotoModifiers": int(Qt.ControlModifier),
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
165 "MouseClickGotoButton": int(Qt.LeftButton),
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
166 }
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
167
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
168 self.__translator = None
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
169 self.__loadTranslator()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
170
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
171 def __initialize(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
172 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
173 Private slot to (re)initialize the plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
174 """
191
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
175 self.__refactoringServer = None
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 191
diff changeset
176 self.__codeAssistServer = 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
177
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
178 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
179
2bfe9e3fad8d Ported 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 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
181 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
182 self.__oldEditorText = ""
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
183
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
184 def activate(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
185 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
186 Public method to activate this plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
187
201
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
188 @return tuple of None and activation status
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
189 @rtype tuple of (None, bool)
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
190 """
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
191 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
192 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
193
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
194 e5App().getObject("PluginManager").shutdown.connect(
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
195 self.__shutdown)
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
196
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 191
diff changeset
197 from RefactoringRope.CodeAssistServer import CodeAssistServer
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 191
diff changeset
198 self.__codeAssistServer = CodeAssistServer(self, self.__ui)
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
199 self.__codeAssistServer.activate()
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
200
191
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
201 from RefactoringRope.RefactoringServer import RefactoringServer
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
202 self.__refactoringServer = RefactoringServer(self, self.__ui)
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
203 self.__refactoringServer.activate()
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
204
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
205 e5App().getObject("PluginManager").shutdown.connect(
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
206 self.__shutdown)
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
207 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
208 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
209 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
210 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
211
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
212 for editor in e5App().getObject("ViewManager").getOpenEditors():
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
213 self.__editorOpened(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
214
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
215 return None, True
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
216
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
217 def deactivate(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
218 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
219 Public method to deactivate this plugin.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
220 """
222
5771e459f94c Fixed an issue deactivating the rope plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 217
diff changeset
221 if self.__refactoringServer:
5771e459f94c Fixed an issue deactivating the rope plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 217
diff changeset
222 self.__refactoringServer.deactivate()
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
223
222
5771e459f94c Fixed an issue deactivating the rope plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 217
diff changeset
224 if self.__codeAssistServer:
5771e459f94c Fixed an issue deactivating the rope plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 217
diff changeset
225 self.__codeAssistServer.deactivate()
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
226
200
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
227 e5App().getObject("PluginManager").shutdown.disconnect(
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
228 self.__shutdown)
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
229 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
230 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
231 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
232 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
233
2bfe9e3fad8d Ported 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 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
235 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
236
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
237 self.__initialize()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
238
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
239 def __shutdown(self):
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
240 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
241 Private slot handling the shutdown signal of the plug-in manager.
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
242 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
243 if self.__codeAssistServer:
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
244 self.__codeAssistServer.deactivate()
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
245
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
246 def __loadTranslator(self):
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
247 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
248 Private method to load the translation file.
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
249 """
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
250 if self.__ui is not None:
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
251 loc = self.__ui.getLocale()
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
252 if loc and loc != "C":
320
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
253 locale_dir = os.path.join(os.path.dirname(__file__),
91b171fdd85f Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 319
diff changeset
254 "RefactoringRope", "i18n")
151
5260100b6700 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 148
diff changeset
255 translation = "rope_{0}".format(loc)
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
256 translator = QTranslator(None)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
257 loaded = translator.load(translation, locale_dir)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
258 if loaded:
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
259 self.__translator = translator
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
260 e5App().installTranslator(self.__translator)
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
261 else:
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
262 print("Warning: translation file '{0}' could not"
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
263 " be loaded.".format(translation))
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
264 print("Using default.")
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
265
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
266 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
267 """
2bfe9e3fad8d Ported 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 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
269
2bfe9e3fad8d Ported 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 @param key the key of the value to get
201
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
271 @type str
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
272 @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
273 """
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 116
diff changeset
274 if key in ["CodeAssistEnabled", "CodeAssistCalltipsEnabled",
153
9557ef516806 Removed the outdated check for the correct eric version.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 151
diff changeset
275 "MouseClickEnabled"]:
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
276 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
277 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
278 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
279 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
280 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
281
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
282 def setPreferences(self, key, value):
1
9f687137a929 Started implementing the basic functions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 0
diff changeset
283 """
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
284 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
285
201
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
286 @param key the key of the setting to be set
e677d82706d4 Extended the auto completions pictures supported by code assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
287 @type str
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
288 @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
289 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
290 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
291 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
292
293
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
293 if key in ["MouseClickGotoModifiers", "MouseClickGotoButton"]:
129
23ee57a96ea3 Added capability to go to the definition of a class or function by clicking on it (while holding the Ctrl key or another configurable modifier sequence) (needs eric 6.1.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 127
diff changeset
294 for editor in self.__editors:
293
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
295 self.__disconnectMouseClickHandler(editor)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
296 self.__connectMouseClickHandler(editor)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
297
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
298 def __determineLanguage(self):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
299 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
300 Private method to determine the valid language strings.
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
301
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
302 @return list of valid language strings
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
303 @rtype list of str
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
304 """
335
9438c2ed7732 Removed support for Python2.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 333
diff changeset
305 return ["Python3", "Pygments|Python 3", "MicroPython"]
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
306
2bfe9e3fad8d Ported 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 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
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 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
310
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
311 @param editor reference to the new editor
217
874115c79ca7 Added support for the extraction of source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 212
diff changeset
312 @type QScintilla.Editor.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
313 """
293
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
314 languages = self.__determineLanguage()
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
315
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
316 if editor.getLanguage() in languages:
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
317 self.__connectEditor(editor)
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
318
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
319 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
320 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
321
2bfe9e3fad8d Ported 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 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
323 """
2bfe9e3fad8d Ported 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 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
325
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
326 @param editor reference to the editor
217
874115c79ca7 Added support for the extraction of source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 212
diff changeset
327 @type QScintilla.Editor.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
328 """
2bfe9e3fad8d Ported 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 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
330 editor.languageChanged.disconnect(self.__editorLanguageChanged)
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
331 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
332 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
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 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
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 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
337
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
338 @param language programming language of the editor
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
339 @type str
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
340 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
341 editor = self.sender()
293
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
342 languages = self.__determineLanguage()
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
343
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
344 self.__disconnectEditor(editor)
293
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
345 if language in languages:
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
346 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
347
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
348 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
349 """
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
350 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
351
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
352 @param editor reference to the editor
217
874115c79ca7 Added support for the extraction of source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 212
diff changeset
353 @type QScintilla.Editor.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
354 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 99
diff changeset
355 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
356 editor.editorSaved.connect(self.__editorSaved)
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
357
293
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
358 self.__setAutoCompletionHook(editor)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
359 self.__setCalltipsHook(editor)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
360
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
361 self.__connectMouseClickHandler(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
362
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
363 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
364 """
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
365 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
366
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
367 @param editor reference to the editor
217
874115c79ca7 Added support for the extraction of source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 212
diff changeset
368 @type QScintilla.Editor.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
369 """
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
370 try:
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
371 editor.editorAboutToBeSaved.disconnect(self.__editorAboutToBeSaved)
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
372 editor.editorSaved.disconnect(self.__editorSaved)
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
373 except TypeError:
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
374 # just ignore it
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
375 pass
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
376
293
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
377 self.__unsetAutoCompletionHook(editor)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
378 self.__unsetCalltipsHook(editor)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
379
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
380 self.__disconnectMouseClickHandler(editor)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
381
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
382 def __connectMouseClickHandler(self, editor):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
383 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
384 Private method to connect the mouse click handler to an editor.
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
385
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
386 @param editor reference to the editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
387 @type QScintilla.Editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
388 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
389 if self.getPreferences("MouseClickGotoButton"):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
390 editor.setMouseClickHandler(
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
391 "rope",
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
392 self.getPreferences("MouseClickGotoModifiers"),
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
393 self.getPreferences("MouseClickGotoButton"),
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
394 self.__codeAssistServer.gotoDefinition
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
395 )
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
396
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
397 def __disconnectMouseClickHandler(self, editor):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
398 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
399 Private method to disconnect the mouse click handler from an editor.
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
400
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
401 @param editor reference to the editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
402 @type QScintilla.Editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
403 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
404 editor.removeMouseClickHandlers("rope")
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
405
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
406 def __setAutoCompletionHook(self, editor):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
407 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
408 Private method to set the autocompletion hook.
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
409
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
410 @param editor reference to the editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
411 @type QScintilla.Editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
412 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
413 try:
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
414 editor.addCompletionListHook(
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
415 "rope", self.__codeAssistServer.requestCompletions, True)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
416 self.__codeAssistServer.setAsyncCompletions(True)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
417 except TypeError:
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
418 # interface before 17.11
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
419 editor.addCompletionListHook(
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
420 "rope", self.__codeAssistServer.getCompletions)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
421 self.__codeAssistServer.setAsyncCompletions(False)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
422
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
423 def __unsetAutoCompletionHook(self, editor):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
424 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
425 Private method to unset the autocompletion hook.
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
426
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
427 @param editor reference to the editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
428 @type QScintilla.Editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
429 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
430 editor.removeCompletionListHook("rope")
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
431
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
432 def __setCalltipsHook(self, editor):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
433 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
434 Private method to set the calltip hook.
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
435
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
436 @param editor reference to the editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
437 @type QScintilla.Editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
438 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
439 editor.addCallTipHook("rope", self.__codeAssistServer.getCallTips)
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
440
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
441 def __unsetCalltipsHook(self, editor):
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
442 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
443 Private method to unset the calltip hook.
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
444
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
445 @param editor reference to the editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
446 @type QScintilla.Editor
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
447 """
dd1c7ed6d880 Code Assist: started to move the Mouse Click handler to Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 287
diff changeset
448 editor.removeCallTipHook("rope")
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
449
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
450 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
451 """
2bfe9e3fad8d Ported 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 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
453
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
454 @param filename name of the file about to be saved
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
455 @type str
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
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 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
458 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
459 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
460 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
461 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
462 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
463 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
464 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
465 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
466
2bfe9e3fad8d Ported 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 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
468 """
2bfe9e3fad8d Ported 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 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
470
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
471 @param filename name of the file that was saved
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 201
diff changeset
472 @type str
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
473 """
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 101
diff changeset
474 if filename == self.__savedEditorName and self.__oldEditorText:
191
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
475 self.__refactoringServer.reportChanged(self.__savedEditorName,
203
c38750e1bafd Performed some code cleanup actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 202
diff changeset
476 self.__oldEditorText)
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 191
diff changeset
477 self.__codeAssistServer.reportChanged(self.__savedEditorName,
203
c38750e1bafd Performed some code cleanup actions.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 202
diff changeset
478 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
479 else:
191
2af42804bca2 Did some code refactoring and removed backward compatability code for eric < 6.1.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 189
diff changeset
480 self.__refactoringServer.reportChanged(filename, "")
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 191
diff changeset
481 self.__codeAssistServer.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
482
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
483 def getCodeAssistServer(self):
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
484 """
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
485 Public method to get a reference to the code assist server.
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
486
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
487 @return reference to the code assist server
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
488 @rtype CodeAssistServer
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
489 """
212
f05681349336 Changed code assist to use the new async interface of the Editor class, if it available and performed some code refactorings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 203
diff changeset
490 return self.__codeAssistServer
151
5260100b6700 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 148
diff changeset
491
5260100b6700 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 148
diff changeset
492 #
5260100b6700 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 148
diff changeset
493 # eflag: noqa = M801

eric ide

mercurial