RefactoringRope/CodeAssistServer.py

changeset 273
803593e12756
parent 270
efc48da49a75
child 280
45f0a0511acd
equal deleted inserted replaced
272:b92aa38f8cc2 273:803593e12756
353 353
354 @param editor reference to the editor to get source code documentation 354 @param editor reference to the editor to get source code documentation
355 for 355 for
356 @type QScintilla.Editor.Editor 356 @type QScintilla.Editor.Editor
357 """ 357 """
358 if self.__documentationViewer is None:
359 return
360
358 language = editor.getLanguage() 361 language = editor.getLanguage()
359 if language not in self.__editorLanguageMapping: 362 if language not in self.__editorLanguageMapping:
360 if Preferences.getDocuViewer("ShowInfoAsRichText"): 363 if Preferences.getDocuViewer("ShowInfoAsRichText"):
361 warning = self.tr("Language <b>{0}</b> is not supported.")\ 364 warning = self.tr("Language <b>{0}</b> is not supported.")\
362 .format(language) 365 .format(language)
393 Private method to process the documentation sent by the client. 396 Private method to process the documentation sent by the client.
394 397
395 @param result dictionary containing the result sent by the client 398 @param result dictionary containing the result sent by the client
396 @type dict with keys 'name', 'argspec', 'note', 'docstring', 'typ' 399 @type dict with keys 'name', 'argspec', 'note', 'docstring', 'typ'
397 """ 400 """
401 if self.__documentationViewer is None:
402 return
403
398 docu = None 404 docu = None
399 405
400 if "Error" not in result: 406 if "Error" not in result:
401 documentationDict = result["DocumentationDict"] 407 documentationDict = result["DocumentationDict"]
402 if documentationDict: 408 if documentationDict:
571 """ 577 """
572 Public method to activate the code assist server. 578 Public method to activate the code assist server.
573 """ 579 """
574 try: 580 try:
575 self.__documentationViewer = self.__ui.documentationViewer() 581 self.__documentationViewer = self.__ui.documentationViewer()
576 self.__documentationViewer.registerProvider( 582 if self.__documentationViewer is not None:
577 "rope", self.tr("Rope"), self.requestCodeDocumentation, 583 self.__documentationViewer.registerProvider(
578 self.isSupportedLanguage) 584 "rope", self.tr("Rope"), self.requestCodeDocumentation,
585 self.isSupportedLanguage)
579 except AttributeError: 586 except AttributeError:
580 # eric6 before 17.11 doesn't have this 587 # eric6 before 17.11 doesn't have this
581 pass 588 pass
582 589
583 def deactivate(self): 590 def deactivate(self):

eric ide

mercurial