code: def detectSyntax(self,
                       xmlFileName=None,
                       mimeType=None,
                       language=None,
                       sourceFilePath=None,
                       firstLine=None):
          
          oldLanguage = self.language()
  
          self.clearSyntax()
  
          syntax = self._globalSyntaxManager.getSyntax(xmlFileName=xmlFileName,
                                                       mimeType=mimeType,
                                                       languageName=language,
                                                       sourceFilePath=sourceFilePath,
                                                       firstLine=firstLine)
  
          if syntax is not None:
              self._highlighter = SyntaxHighlighter(syntax, self)
              self._indenter.setSyntax(syntax)
              keywords = {kw for kwList in syntax.parser.lists.values() for kw in kwList}
              self._completer.setKeywords(keywords)
  
          newLanguage = self.language()
          if oldLanguage != newLanguage:
              self.languageChanged.emit(newLanguage)
  
          return syntax is not None
docs: Get syntax by next parameters (fill as many, as known):
  
              * name of XML file with syntax definition
              * MIME type of source file
              * Programming language name
              * Source file path
              * First line of source file
  
          First parameter in the list has the hightest priority.
          Old syntax is always cleared, even if failed to detect new.
  
          Method returns ``True``, if syntax is detected, and ``False`` otherwise