src/eric7/JediInterface/AssistantJedi.py

branch
eric7
changeset 10970
2ad8a7d0867c
parent 10704
27d21e5163b8
child 11000
f8371a2dd08f
equal deleted inserted replaced
10969:705b71b3fde6 10970:2ad8a7d0867c
57 """ 57 """
58 Private slot handling changes of the Disassembly viewer settings. 58 Private slot handling changes of the Disassembly viewer settings.
59 """ 59 """
60 for editor in self.__editors: 60 for editor in self.__editors:
61 self.__disconnectMouseClickHandler(editor) 61 self.__disconnectMouseClickHandler(editor)
62 self.__connectMouseClickHandler(editor) 62 if not FileSystemUtilities.isRemoteFileName(editor.getFileName()):
63 self.__connectMouseClickHandler(editor)
63 64
64 def __determineLanguage(self): 65 def __determineLanguage(self):
65 """ 66 """
66 Private method to determine the valid language strings. 67 Private method to determine the valid language strings.
67 68
82 Private slot called, when a new editor was opened. 83 Private slot called, when a new editor was opened.
83 84
84 @param editor reference to the new editor 85 @param editor reference to the new editor
85 @type Editor 86 @type Editor
86 """ 87 """
87 languages = self.__determineLanguage() 88 if not FileSystemUtilities.isRemoteFileName(editor.getFileName()):
88 89 languages = self.__determineLanguage()
89 if editor.getLanguage() in languages: 90
90 self.__connectEditor(editor) 91 if editor.getLanguage() in languages:
91 92 self.__connectEditor(editor)
92 editor.languageChanged.connect(self.__editorLanguageChanged) 93
93 self.__editors.append(editor) 94 editor.languageChanged.connect(self.__editorLanguageChanged)
95 self.__editors.append(editor)
94 96
95 def __editorClosed(self, editor): 97 def __editorClosed(self, editor):
96 """ 98 """
97 Private slot called, when an editor was closed. 99 Private slot called, when an editor was closed.
98 100
123 Private method to connect an editor. 125 Private method to connect an editor.
124 126
125 @param editor reference to the editor 127 @param editor reference to the editor
126 @type Editor 128 @type Editor
127 """ 129 """
128 self.__setAutoCompletionHook(editor) 130 if not FileSystemUtilities.isRemoteFileName(editor.getFileName()):
129 self.__setCalltipsHook(editor) 131 self.__setAutoCompletionHook(editor)
130 132 self.__setCalltipsHook(editor)
131 self.__connectMouseClickHandler(editor) 133
132 134 self.__connectMouseClickHandler(editor)
133 editor.registerMouseHoverHelpFunction(self.__jediServer.hoverHelp) 135
134 136 editor.registerMouseHoverHelpFunction(self.__jediServer.hoverHelp)
135 menu = editor.getMenu("Main") 137
136 if menu is not None: 138 menu = editor.getMenu("Main")
137 checkAction = editor.getMenu("Checks").menuAction() 139 if menu is not None:
138 act = menu.insertMenu(checkAction, self.__menu) 140 checkAction = editor.getMenu("Checks").menuAction()
139 self.__menuActions[editor] = [act] 141 act = menu.insertMenu(checkAction, self.__menu)
140 editor.showMenu.connect(self.__editorShowMenu) 142 self.__menuActions[editor] = [act]
143 editor.showMenu.connect(self.__editorShowMenu)
141 144
142 def __disconnectEditor(self, editor): 145 def __disconnectEditor(self, editor):
143 """ 146 """
144 Private method to disconnect an editor. 147 Private method to disconnect an editor.
145 148
168 Private method to connect the mouse click handler to an editor. 171 Private method to connect the mouse click handler to an editor.
169 172
170 @param editor reference to the editor 173 @param editor reference to the editor
171 @type Editor 174 @type Editor
172 """ 175 """
173 if Preferences.getJedi("MouseClickGotoButton"): 176 if (
177 Preferences.getJedi("MouseClickGotoButton")
178 and not FileSystemUtilities.isRemoteFileName(editor.getFileName())
179 ):
174 editor.setMouseClickHandler( 180 editor.setMouseClickHandler(
175 "jedi", 181 "jedi",
176 Preferences.getJedi("MouseClickGotoModifiers"), 182 Preferences.getJedi("MouseClickGotoModifiers"),
177 Preferences.getJedi("MouseClickGotoButton"), 183 Preferences.getJedi("MouseClickGotoButton"),
178 self.__jediServer.gotoDefinition, 184 self.__jediServer.gotoDefinition,

eric ide

mercurial