RefactoringRope/CodeAssistServer.py

Wed, 27 Sep 2017 18:42:35 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 27 Sep 2017 18:42:35 +0200
branch
server_client_variant
changeset 199
ae2ad82725b0
parent 198
898d8b4187de
child 200
1584892147ef
permissions
-rw-r--r--

Implemented the distributed code assist calltips method.

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 import sys
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
14
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
15 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
16
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
17 # TODO: eliminate this
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
18 sys.path.insert(0, os.path.dirname(__file__))
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
19
193
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
20 from JsonServer import JsonServer
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
21
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
22 import Globals
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
23 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
24
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 106
diff changeset
25
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
26 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
27 """
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
28 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
29 """
118
d242ba11a04c Fixed a few code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 106
diff changeset
30 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
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 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
33
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
34 @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
35 @type RefactoringRopePlugin
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
36 @param parent parent
47d95438c4d8 Started to change the CodeAssist class to support distributed operations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 147
diff changeset
37 @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
38 """
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
39 super(CodeAssistServer, self).__init__(
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
40 "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
41
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
42 self.__plugin = plugin
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
43 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
44
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
45 self.__editorLanguageMapping = {}
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
46
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
47 # 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
48 self.__completions = None
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
49 self.__calltips = None
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
50
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
51 self.__methodMapping = {
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
52 "CompletionsResult": self.__processCompletionsResult,
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
53 "CallTipsResult": self.__processCallTipsResult,
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
54 }
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
55
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
56 # Python 2
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
57 interpreter = Preferences.getDebugger("PythonInterpreter")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
58 self.__startCodeAssistClient(interpreter, "Python2")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
59
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
60 # Python 3
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
61 interpreter = Preferences.getDebugger("Python3Interpreter")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
62 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
63
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
64 def __updateEditorLanguageMapping(self):
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 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
67 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
68 self.__editorLanguageMapping = {}
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
69 for name in self.connectionNames():
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
70 if name == "Python2":
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
71 self.__editorLanguageMapping.update({
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
72 "Python": "Python2",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
73 "Python2": "Python2",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
74 "Pygments|Python": "Python2",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
75 })
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
76 elif name == "Python3":
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
77 self.__editorLanguageMapping.update({
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
78 "Python3": "Python3",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
79 "Pygments|Python 3": "Python3",
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
80 })
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
81
197
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
82 def isSupportedLanguage(self, language):
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 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
85
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
86 @param language editor programming language to check
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
87 @type str
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
88 @return flag indicating the support status
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
89 @rtype bool
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
90 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
91 return language in self.__editorLanguageMapping
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
92
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
93 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
94 """
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
95 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
96
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
97 @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
98 @type QScintilla.Editor
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
99 @return list of proposals
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
100 @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
101 """
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
102 # reset the completions buffer
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
103 self.__completions = None
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
104
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
105 language = editor.getLanguage()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
106 if language not in self.__editorLanguageMapping:
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
107 return []
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
108 idString = self.__editorLanguageMapping[language]
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
109
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
110 filename = editor.getFileName()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
111 line, index = editor.getCursorPosition()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
112 source = editor.text()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
113 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
114 maxfixes = self.__plugin.getPreferences("MaxFixes")
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
115
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
116 self.sendJson("getCompletions", {
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
117 "FileName": filename,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
118 "Source": source,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
119 "Offset": offset,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
120 "MaxFixes": maxfixes,
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
121 }, idString=idString)
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
122
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
123 # emulate the synchronous behaviour
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
124 timer = QTimer()
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
125 timer.setSingleShot(True)
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
126 timer.start(5000) # 5s timeout
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
127 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
128 QCoreApplication.processEvents()
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 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
131
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
132 def __processCompletionsResult(self, result):
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
133 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
134 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
135
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
136 @param result dictionary containg the result sent by the client
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
137 @type dict
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
138 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
139 if "Error" in result:
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
140 self.__completions = []
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
141 else:
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
142 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
143
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
144 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
145 """
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
146 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
147
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
148 @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
149 @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
150 @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
151 @type QScintilla.Editor
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
152 @return list of possible calltips
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
153 @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
154 """
199
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
155 # reset the calltips buffer
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
156 self.__calltips = None
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
157
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
158 language = editor.getLanguage()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
159 if language not in self.__editorLanguageMapping:
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
160 return []
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
161 idString = self.__editorLanguageMapping[language]
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
162
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
163 filename = editor.getFileName()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
164 source = editor.text()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
165 line, index = editor.lineIndexFromPosition(pos)
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
166 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
167 maxfixes = self.__plugin.getPreferences("CalltipsMaxFixes")
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
168
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
169 self.sendJson("getCallTips", {
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
170 "FileName": filename,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
171 "Source": source,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
172 "Offset": offset,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
173 "MaxFixes": maxfixes,
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
174 }, idString=idString)
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
175
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
176 # emulate the synchronous behaviour
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
177 timer = QTimer()
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
178 timer.setSingleShot(True)
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
179 timer.start(5000) # 5s timeout
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
180 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
181 QCoreApplication.processEvents()
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 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
184
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
185 def __processCallTipsResult(self, result):
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
186 """
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
187 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
188
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
189 @param result dictionary containg the result sent by the client
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
190 @type dict
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
191 """
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
192 if "Error" in result:
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
193 self.__calltips = []
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
194 else:
ae2ad82725b0 Implemented the distributed code assist calltips method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 198
diff changeset
195 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
196
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
197 # TODO: port this to the distributed variant
104
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
198 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
199 """
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
200 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
201
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
202 @param filename file name of the changed source (string)
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
203 @param oldSource source code before the change (string)
f6049d39f83d Made the code completion work in case no project is open.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 103
diff changeset
204 """
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
205 print("code assist: reportChanged")
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
206 ## try:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
207 ## rope.base.libutils.report_change(
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
208 ## self.__project, filename, oldSource)
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
209 ## except RuntimeError:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
210 ## # this could come from trying to do PyQt4/PyQt5 mixed stuff
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
211 ## # simply ignore it
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
212 ## pass
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
213
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 ## Methods below handle the network connection
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
216 #######################################################################
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
217
198
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
218 def handleCall(self, method, params):
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
219 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
220 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
221
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
222 Note: This is an empty implementation that must be overridden in
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
223 derived classes.
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
224
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
225 @param method requested method name
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
226 @type str
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
227 @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
228 @type dict
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
229 """
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
230 self.__methodMapping[method](params)
898d8b4187de IMplemented the distributed code assist completions method.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 197
diff changeset
231
195
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
232 def __startCodeAssistClient(self, interpreter, idString):
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
233 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
234 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
235 interpreter.
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
236
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
237 @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
238 @type str
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
239 @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
240 @type str
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
241 @return flag indicating a successful client start
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
242 @rtype bool
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
243 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
244 if interpreter:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
245 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
246 "CodeAssistClient.py")
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
247 ok = self.startClient(interpreter, client,
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
248 [Globals.getConfigDir()],
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
249 idString=idString)
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
250 if not ok:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
251 self.__ui.appendToStderr(self.tr(
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
252 "'{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
253 " could not be started."
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
254 ).format(idString))
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
255 else:
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
256 self.__ui.appendToStderr(self.tr(
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
257 "'{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
258 " configured."
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
259 ).format(idString))
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
260
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
261 @pyqtSlot()
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
262 def handleNewConnection(self):
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 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
265 """
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
266 super(CodeAssistServer, self).handleNewConnection()
5d614a567be3 Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 193
diff changeset
267 self.__updateEditorLanguageMapping()
197
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 def activate(self):
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
270 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
271 Public method to activate the code assist server.
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
272 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
273 pass
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
274
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
275 def deactivate(self):
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
276 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
277 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
278 """
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 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
281 """
7046ac1bcb4b Continued implementing the distributed Code Assist.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 195
diff changeset
282 self.stopAllClients()

eric ide

mercurial