// Path: src/io/github/jhsx/jet/lang/file/JetFileType.java
// public class JetFileType extends LanguageFileType implements TemplateLanguageFileType {
//     public static final LanguageFileType INSTANCE = new JetFileType();
// 
//     protected JetFileType() {
//         super(JetLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public String getName() {
//         return "Jet";
//     }
// 
//     @NotNull
//     @Override
//     public String getDescription() {
//         return "Jet template engine file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDefaultExtension() {
//         return "jet";
//     }
// 
//     @Nullable
//     @Override
//     public Icon getIcon() {
//         return AllIcons.Icons.Ide.NextStep;
//     }
// 
//     @Override
//     public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
//         return CharsetToolkit.UTF8;
//     }
// 
// 
//     public Charset extractCharsetFromFileContent(@Nullable final Project project,
//                                                  @Nullable final VirtualFile file,
//                                                  @NotNull final CharSequence content) {
//         LanguageFileType associatedFileType = getAssociatedFileType(file, project);
// 
//         if (associatedFileType == null) {
//             return null;
//         }
// 
//         return CharsetUtil.extractCharsetFromFileContent(project, file, associatedFileType, content);
//     }
// 
//     private static LanguageFileType getAssociatedFileType(VirtualFile file, Project project) {
//         if (project == null) {
//             return null;
//         }
//         Language language = TemplateDataLanguageMappings.getInstance(project).getMapping(file);
// 
//         LanguageFileType associatedFileType = null;
//         if (language != null) {
//             associatedFileType = language.getAssociatedFileType();
//         }
// 
//         if (language == null || associatedFileType == null) {
//             associatedFileType = JetLanguage.getDefaultTemplateLang();
//         }
//         return associatedFileType;
//     }
// 
// }


import com.intellij.lang.Language;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.psi.templateLanguages.TemplateLanguage;
import io.github.jhsx.jet.lang.file.JetFileType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/*
 *
 *  * Copyright 2016 José Santos
 *  *
 *  * Licensed under the Apache License, Version 2.0 (the "License");
 *  * you may not use this file except in compliance with the License.
 *  * You may obtain a copy of the License at
 *  *
 *  * http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  * Unless required by applicable law or agreed to in writing, software
 *  * distributed under the License is distributed on an "AS IS" BASIS,
 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  * See the License for the specific language governing permissions and
 *  * limitations under the License.
 *
 */

package io.github.jhsx.jet;


public class JetLanguage extends Language implements TemplateLanguage {
    public static final Language INSTANCE = new JetLanguage();

    private JetLanguage() {
        super("JetTemplateLanguage");
    }

    public static LanguageFileType getDefaultTemplateLang() {
        return StdFileTypes.HTML;
    }

    @NotNull
    @Override
    public String getDisplayName() {
        return "Jet template engine";
    }

// Path: src/io/github/jhsx/jet/lang/file/JetFileType.java
// public class JetFileType extends LanguageFileType implements TemplateLanguageFileType {
//     public static final LanguageFileType INSTANCE = new JetFileType();
// 
//     protected JetFileType() {
//         super(JetLanguage.INSTANCE);
//     }
// 
//     @NotNull
//     @Override
//     public String getName() {
//         return "Jet";
//     }
// 
//     @NotNull
//     @Override
//     public String getDescription() {
//         return "Jet template engine file";
//     }
// 
//     @NotNull
//     @Override
//     public String getDefaultExtension() {
//         return "jet";
//     }
// 
//     @Nullable
//     @Override
//     public Icon getIcon() {
//         return AllIcons.Icons.Ide.NextStep;
//     }
// 
//     @Override
//     public String getCharset(@NotNull VirtualFile file, @NotNull byte[] content) {
//         return CharsetToolkit.UTF8;
//     }
// 
// 
//     public Charset extractCharsetFromFileContent(@Nullable final Project project,
//                                                  @Nullable final VirtualFile file,
//                                                  @NotNull final CharSequence content) {
//         LanguageFileType associatedFileType = getAssociatedFileType(file, project);
// 
//         if (associatedFileType == null) {
//             return null;
//         }
// 
//         return CharsetUtil.extractCharsetFromFileContent(project, file, associatedFileType, content);
//     }
// 
//     private static LanguageFileType getAssociatedFileType(VirtualFile file, Project project) {
//         if (project == null) {
//             return null;
//         }
//         Language language = TemplateDataLanguageMappings.getInstance(project).getMapping(file);
// 
//         LanguageFileType associatedFileType = null;
//         if (language != null) {
//             associatedFileType = language.getAssociatedFileType();
//         }
// 
//         if (language == null || associatedFileType == null) {
//             associatedFileType = JetLanguage.getDefaultTemplateLang();
//         }
//         return associatedFileType;
//     }
// 
// }


// Path: src/io/github/jhsx/jet/JetLanguage.java
import com.intellij.lang.Language;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.fileTypes.StdFileTypes;
import com.intellij.psi.templateLanguages.TemplateLanguage;
import io.github.jhsx.jet.lang.file.JetFileType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/*
 *
 *  * Copyright 2016 José Santos
 *  *
 *  * Licensed under the Apache License, Version 2.0 (the "License");
 *  * you may not use this file except in compliance with the License.
 *  * You may obtain a copy of the License at
 *  *
 *  * http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  * Unless required by applicable law or agreed to in writing, software
 *  * distributed under the License is distributed on an "AS IS" BASIS,
 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  * See the License for the specific language governing permissions and
 *  * limitations under the License.
 *
 */

package io.github.jhsx.jet;


public class JetLanguage extends Language implements TemplateLanguage {
    public static final Language INSTANCE = new JetLanguage();

    private JetLanguage() {
        super("JetTemplateLanguage");
    }

    public static LanguageFileType getDefaultTemplateLang() {
        return StdFileTypes.HTML;
    }

    @NotNull
    @Override
    public String getDisplayName() {
        return "Jet template engine";
    }

    @Nullable