--- a/RefactoringRope/CodeAssistServer.py Mon Oct 16 19:58:35 2017 +0200 +++ b/RefactoringRope/CodeAssistServer.py Sat Oct 21 16:05:42 2017 +0200 @@ -345,9 +345,16 @@ """ language = editor.getLanguage() if language not in self.__editorLanguageMapping: + if Preferences.getDocuViewer("ShowInfoAsRichText"): + warning = self.tr("Language <b>{0}</b> is not supported.")\ + .format(language) + else: + warning = self.tr("Language '{0}' is not supported.")\ + .format(language) self.__documentationViewer.documentationReady( - self.tr("Language '{0}' is not supported.").format(language)) + warning, isWarning=True) return + idString = self.__editorLanguageMapping[language] filename = editor.getFileName() @@ -382,9 +389,9 @@ documentationDict = result["DocumentationDict"] if documentationDict: if "module" in documentationDict: - if Preferences.getDocuViewer("ShowInfoAsMarkdown"): + if Preferences.getDocuViewer("ShowInfoAsRichText"): documentationDict["note"] = \ - self.tr("Present in _{0}_ module", + self.tr("Present in <i>{0}</i> module", "Note with markdown syntax")\ .format(documentationDict["module"]) else: @@ -395,7 +402,12 @@ del documentationDict["module"] docu = documentationDict - self.__documentationViewer.documentationReady(docu) + if docu is None: + msg = self.tr("No documentation available.") + self.__documentationViewer.documentationReady( + msg, isDocWarning=True) + else: + self.__documentationViewer.documentationReady(docu) ####################################################################### ## Methods below handle the network connection