--- a/RefactoringRope/RefactoringServer.py Sun Nov 11 19:43:56 2018 +0100 +++ b/RefactoringRope/RefactoringServer.py Mon Nov 12 19:03:47 2018 +0100 @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # -*- coding: utf-8 -*- # Copyright (c) 2010 - 2018 Detlev Offenbach <detlev@die-offenbachs.de> @@ -1743,39 +1744,13 @@ line, index = aw.getCursorPosition() offset = self.__getOffset(aw, line, index) - # TODO: remove Subcommand handling self.sendJson("QueryDefinition", { "Title": title, "FileName": filename, "Offset": offset, "Source": aw.text(), - "Subcommand": "Query", }) - # TODO: move this to code assist -## def gotoDefinition(self, editor): -## """ -## Public slot to find the definition for the word at the cursor position -## and go to it. -## -## Note: This is executed upon a mouse click sequence. -## -## @param editor reference to the calling editor -## @type QScintilla.Editor.Editor -## """ -## if self.__projectopen: -## filename = editor.getFileName() -## line, index = editor.getCursorPosition() -## offset = self.__getOffset(editor, line, index) -## -## self.sendJson("QueryDefinition", { -## "Title": "", -## "FileName": filename, -## "Offset": offset, -## "Source": editor.text(), -## "Subcommand": "Goto", -## }) -## def __queryDefinitionResult(self, result): """ Private method to handle the "Query Definition" result sent by @@ -1784,38 +1759,20 @@ @param result dictionary containing the result data @type dict """ - # TODO: remove Subcommand handling - if result["Subcommand"] == "Query": - if self.handleRopeError(result): - title = result["Title"] - if "Location" in result: - location = result["Location"] - - from .MatchesDialog import MatchesDialog - self.dlg = MatchesDialog(self.__ui, False) - self.dlg.show() - self.dlg.addEntry(location[0], location[1]) - # file name, lineno - else: - E5MessageBox.warning( - self.__ui, title, - self.tr("No matching definition found.")) - # TODO: move this to code assist -## elif result["Subcommand"] == "Goto": -## if "Error" not in result: -## # ignore errors silently -## if "Location" in result: -## location = result["Location"] -## try: -## self.__vm.openSourceFile( -## location[0], location[1], addNext=True) -## except TypeError: -## # backward compatibility; <= 17.03 -## self.__vm.openSourceFile( -## location[0], location[1], next=True) -## else: -## e5App().getObject("UserInterface").statusBar().showMessage( -## self.tr('No definition found'), 5000) + if self.handleRopeError(result): + title = result["Title"] + if "Location" in result: + location = result["Location"] + + from .MatchesDialog import MatchesDialog + self.dlg = MatchesDialog(self.__ui, False) + self.dlg.show() + self.dlg.addEntry(location[0], location[1]) + # file name, lineno + else: + E5MessageBox.warning( + self.__ui, title, + self.tr("No matching definition found.")) def __queryImplementations(self): """ @@ -2331,55 +2288,3 @@ else: ok = False return ok -## -## ######################################################################### -## ## Methods below handle setting/unsetting the mouse click handler methods -## ######################################################################### -## -## # TODO: move this to code assist -## def connectEditor(self, editor): -## """ -## Public method to connect an editor. -## -## @param editor reference to the editor -## @type QScintilla.Editor.Editor -## """ -## if self.__plugin.getPreferences("MouseClickEnabled"): -## self.__disconnectMouseClickHandler(editor) -## self.__connectMouseClickHandler(editor) -## -## # TODO: move this to code assist -## def disconnectEditor(self, editor): -## """ -## Public method to disconnect an editor. -## -## @param editor reference to the editor -## @type QScintilla.Editor.Editor -## """ -## self.__disconnectMouseClickHandler(editor) -## -## # TODO: move this to code assist -## def __connectMouseClickHandler(self, editor): -## """ -## Private method to connect the mouse click handler to an editor. -## -## @param editor reference to the editor -## @type QScintilla.Editor.Editor -## """ -## if self.__plugin.getPreferences("MouseClickGotoButton"): -## editor.setMouseClickHandler( -## "rope", -## self.__plugin.getPreferences("MouseClickGotoModifiers"), -## self.__plugin.getPreferences("MouseClickGotoButton"), -## self.gotoDefinition -## ) -## -## # TODO: move this to code assist -## def __disconnectMouseClickHandler(self, editor): -## """ -## Private method to disconnect the mouse click handler from an editor. -## -## @param editor reference to the editor -## @type QScintilla.Editor.Editor -## """ -## editor.removeMouseClickHandlers("rope")