code: public CodeMirrorLanguage getHighlightMode(CmsResource resource) {
  
          if (resource != null) {
              // determine resource type
              int type = resource.getTypeId();
              if (CmsResourceTypeJsp.isJspTypeId(type)) {
                  // JSP file
                  return CodeMirrorLanguage.JSP;
              }
              if (CmsResourceTypeXmlContent.isXmlContent(resource) || CmsResourceTypeXmlPage.isXmlPage(resource)) {
                  // XML content file or XML page file
                  return CodeMirrorLanguage.XML;
              }
              // all other files will be matched according to their suffix
              int dotIndex = resource.getName().lastIndexOf('.');
              if (dotIndex != -1) {
                  String suffix = resource.getName().substring(dotIndex + 1).toLowerCase();
                  for (CodeMirrorLanguage lang : CodeMirrorLanguage.values()) {
                      if (lang.isSupportedFileType(suffix)) {
                          return lang;
                      }
                  }
              }
          }
          // return HTML type as default
          return CodeMirrorLanguage.HTML;
      }
docs: Returns the syntax highlighting type for the currently edited resource.<p>
  
  @param resource the resource to edit
  
  @return the syntax highlighting type