RefactoringRope/CodeAssistServer.py

Wed, 27 Sep 2017 19:50:44 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 27 Sep 2017 19:50:44 +0200
branch
server_client_variant
changeset 202
a111134b5dc7
parent 200
1584892147ef
child 203
c38750e1bafd
permissions
-rw-r--r--

Started correcting the source code documentation.

100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
147
3f8a995f6e49 Updated copyright for 2017.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 144
diff changeset
3 # Copyright (c) 2008 - 2017 Detlev Offenbach <detlev@die-offenbachs.de>
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the autocompletion interface to rope.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
101
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
10 from __future__ import unicode_literals
5098ad8960ed Fixed issues connecting/disconnecting editors.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 100
diff changeset
11
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 import os
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
14 from PyQt5.QtCore import pyqtSlot, QCoreApplication, QTimer
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
15
200
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
16 from E5Gui.E5Application import e5App
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
17
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
18 from .JsonServer import JsonServer
193
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
19
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
20 import Globals
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
21 import Preferences
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
22
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 106
diff changeset
23
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
24 class CodeAssistServer(JsonServer):
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Class implementing the autocompletion interface to rope.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 """
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 106
diff changeset
28 def __init__(self, plugin, parent=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:
diff changeset
29 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 Constructor
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 @param plugin reference to the plugin object
193
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
33 @type RefactoringRopePlugin
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
34 @param parent parent
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
35 @type QObject
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 """
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
37 super(CodeAssistServer, self).__init__(
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
38 "CodeAssistServer", multiplex=True, parent=parent)
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 self.__plugin = plugin
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
41 self.__ui = parent
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
42
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
43 self.__editorLanguageMapping = {}
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
44
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
45 # attributes to store the resuls of the client side
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
46 self.__completions = None
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
47 self.__calltips = None
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
48
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
49 self.__methodMapping = {
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
50 "CompletionsResult": self.__processCompletionsResult,
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
51 "CallTipsResult": self.__processCallTipsResult,
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
52 }
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
53
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
54 # Python 2
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
55 interpreter = Preferences.getDebugger("PythonInterpreter")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
56 self.__startCodeAssistClient(interpreter, "Python2")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
57
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
58 # Python 3
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
59 interpreter = Preferences.getDebugger("Python3Interpreter")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
60 self.__startCodeAssistClient(interpreter, "Python3")
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
62 def __updateEditorLanguageMapping(self):
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
63 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
64 Private method to update the editor language to connection mapping.
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
65 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
66 self.__editorLanguageMapping = {}
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
67 for name in self.connectionNames():
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
68 if name == "Python2":
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
69 self.__editorLanguageMapping.update({
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
70 "Python": "Python2",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
71 "Python2": "Python2",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
72 "Pygments|Python": "Python2",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
73 })
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
74 elif name == "Python3":
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
75 self.__editorLanguageMapping.update({
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
76 "Python3": "Python3",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
77 "Pygments|Python 3": "Python3",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
78 })
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
79
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
80 def isSupportedLanguage(self, language):
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
81 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
82 Public method to check, if the given language is supported.
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
83
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
84 @param language editor programming language to check
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
85 @type str
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
86 @return flag indicating the support status
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
87 @rtype bool
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
88 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
89 return language in self.__editorLanguageMapping
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
90
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
91 def getCompletions(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:
diff changeset
92 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 Public method to calculate the possible completions.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
95 @param editor reference to the editor object, that called this method
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
96 @type QScintilla.Editor
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
97 @return list of proposals
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
98 @rtype list of 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:
diff changeset
99 """
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
100 # reset the completions buffer
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
101 self.__completions = None
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
102
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
103 language = editor.getLanguage()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
104 if language not in self.__editorLanguageMapping:
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
105 return []
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
106 idString = self.__editorLanguageMapping[language]
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
107
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
108 filename = editor.getFileName()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
109 line, index = editor.getCursorPosition()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
110 source = editor.text()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
111 offset = len("".join(source.splitlines(True)[:line])) + index
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
112 maxfixes = self.__plugin.getPreferences("MaxFixes")
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
113
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
114 self.sendJson("getCompletions", {
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
115 "FileName": filename,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
116 "Source": source,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
117 "Offset": offset,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
118 "MaxFixes": maxfixes,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
119 }, idString=idString)
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
120
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
121 # emulate the synchronous behaviour
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
122 timer = QTimer()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
123 timer.setSingleShot(True)
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
124 timer.start(5000) # 5s timeout
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
125 while self.__completions is None and timer.isActive():
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
126 QCoreApplication.processEvents()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
127
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
128 return [] if self.__completions is None else self.__completions
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
129
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
130 def __processCompletionsResult(self, result):
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
131 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
132 Private method to process the completions sent by the client.
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
133
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
134 @param result dictionary containing the result sent by the client
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
135 @type dict
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
136 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
137 if "Error" in result:
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
138 self.__completions = []
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
139 else:
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
140 self.__completions = result["Completions"]
100
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
142 def getCallTips(self, 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:
diff changeset
143 """
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 Public method to calculate calltips.
2bfe9e3fad8d Ported the code completion and calltips support of the eric4 variant of this plug-in.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
146 @param pos position in the text for the calltip
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
147 @type int
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
148 @param editor reference to the editor object, that called this method
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
149 @type QScintilla.Editor
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
150 @return list of possible calltips
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
151 @rtype list of 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:
diff changeset
152 """
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
153 # reset the calltips buffer
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
154 self.__calltips = None
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
155
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
156 language = editor.getLanguage()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
157 if language not in self.__editorLanguageMapping:
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
158 return []
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
159 idString = self.__editorLanguageMapping[language]
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
160
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
161 filename = editor.getFileName()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
162 source = editor.text()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
163 line, index = editor.lineIndexFromPosition(pos)
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
164 offset = len("".join(source.splitlines(True)[:line])) + index
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
165 maxfixes = self.__plugin.getPreferences("CalltipsMaxFixes")
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
166
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
167 self.sendJson("getCallTips", {
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
168 "FileName": filename,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
169 "Source": source,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
170 "Offset": offset,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
171 "MaxFixes": maxfixes,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
172 }, idString=idString)
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
173
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
174 # emulate the synchronous behaviour
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
175 timer = QTimer()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
176 timer.setSingleShot(True)
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
177 timer.start(5000) # 5s timeout
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
178 while self.__calltips is None and timer.isActive():
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
179 QCoreApplication.processEvents()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
180
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
181 return [] if self.__calltips is None else self.__calltips
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
182
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
183 def __processCallTipsResult(self, result):
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
184 """
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
185 Private method to process the calltips sent by the client.
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
186
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
187 @param result dictionary containing the result sent by the client
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
188 @type dict
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
189 """
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
190 if "Error" in result:
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
191 self.__calltips = []
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
192 else:
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
193 self.__calltips = result["CallTips"]
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
194
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
195 def reportChanged(self, filename, oldSource):
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
196 """
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
197 Public slot to report some changed sources.
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
198
200
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
199 @param filename file name of the changed source
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
200 @type str
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
201 @param oldSource source code before the change
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
202 @type str
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
203 """
200
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
204 editor = e5App().getObject("ViewManager").getOpenEditor(filename)
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
205 if editor is not None:
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
206 language = editor.getLanguage()
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
207 if language in self.__editorLanguageMapping:
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
208 idString = self.__editorLanguageMapping[language]
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
209
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
210 self.sendJson("reportChanged", {
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
211 "FileName": filename,
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
212 "OldSource": oldSource,
1584892147ef Implemented the distributed code assist "report changed" method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 199
diff changeset
213 }, idString=idString)
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
214
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
215 #######################################################################
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
216 ## Methods below handle the network connection
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
217 #######################################################################
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
218
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
219 def handleCall(self, method, params):
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
220 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
221 Public method to handle a method call from the client.
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
222
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
223 @param method requested method name
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
224 @type str
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
225 @param params dictionary with method specific parameters
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
226 @type dict
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
227 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
228 self.__methodMapping[method](params)
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
229
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
230 def __startCodeAssistClient(self, interpreter, idString):
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
231 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
232 Private method to start the code assist client with the given
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
233 interpreter.
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
234
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
235 @param interpreter interpreter to be used for the code assist client
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
236 @type str
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
237 @param idString id of the client to be started
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
238 @type str
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
239 @return flag indicating a successful client start
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
240 @rtype bool
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
241 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
242 if interpreter:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
243 client = os.path.join(os.path.dirname(__file__),
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
244 "CodeAssistClient.py")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
245 ok = self.startClient(interpreter, client,
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
246 [Globals.getConfigDir()],
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
247 idString=idString)
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
248 if not ok:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
249 self.__ui.appendToStderr(self.tr(
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
250 "'{0}' is not supported because the configured interpreter"
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
251 " could not be started."
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
252 ).format(idString))
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
253 else:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
254 self.__ui.appendToStderr(self.tr(
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
255 "'{0}' is not supported because no suitable interpreter is"
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
256 " configured."
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
257 ).format(idString))
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
258
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
259 @pyqtSlot()
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
260 def handleNewConnection(self):
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
261 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
262 Public slot for new incoming connections from a client.
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
263 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
264 super(CodeAssistServer, self).handleNewConnection()
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
265 self.__updateEditorLanguageMapping()
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
266
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
267 def activate(self):
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
268 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
269 Public method to activate the code assist server.
202
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
270
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
271 Note: This method provides for some growth potential.
a111134b5dc7 Started correcting the source code documentation.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 200
diff changeset
272 Currently it is empty.
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
273 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
274 pass
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
275
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
276 def deactivate(self):
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
277 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
278 Public method to deactivate the code assist server.
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
279 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
280 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
281 Public method to shut down the code assist server.
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
282 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
283 self.stopAllClients()

eric ide

mercurial