RefactoringRope/CodeAssistServer.py

branch
server_client_variant
changeset 223
d30d3b0d1df5
parent 221
b3592afc8718
child 232
65d7d745543d
diff -r 5771e459f94c -r d30d3b0d1df5 RefactoringRope/CodeAssistServer.py
--- 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

eric ide

mercurial