Search in sources :

Example 1 with Language

use of com.intellij.lang.Language in project idea-handlebars by dmarcotte.

the class HbCommentActionTest method testNativeInsertBlockComment2.

public void testNativeInsertBlockComment2() {
    Language prevCommenterLang = HbConfig.getCommenterLanguage();
    HbConfig.setCommenterLanguage(HbLanguage.INSTANCE);
    doBlockCommentTest("{{#foo}}\n" + "    <caret>{{bar}}\n" + "{{/foo}", "{{#foo}}\n" + "    {{!--<caret>--}}{{bar}}\n" + "{{/foo}");
    HbConfig.setCommenterLanguage(prevCommenterLang);
}
Also used : Language(com.intellij.lang.Language) HbLanguage(com.dmarcotte.handlebars.HbLanguage) JavaLanguage(com.intellij.lang.java.JavaLanguage)

Example 2 with Language

use of com.intellij.lang.Language in project idea-handlebars by dmarcotte.

the class HbCommentActionTest method testInsertNonDefaultLineComment.

public void testInsertNonDefaultLineComment() {
    Language prevCommenterLanguage = HbConfig.getCommenterLanguage();
    HbConfig.setCommenterLanguage(JavaLanguage.INSTANCE);
    doLineCommentTest("{{#foo}}<caret>", "//{{#foo}}<caret>");
    HbConfig.setCommenterLanguage(prevCommenterLanguage);
}
Also used : Language(com.intellij.lang.Language) HbLanguage(com.dmarcotte.handlebars.HbLanguage) JavaLanguage(com.intellij.lang.java.JavaLanguage)

Example 3 with Language

use of com.intellij.lang.Language in project idea-handlebars by dmarcotte.

the class HbCommentActionTest method testInsertNonDefaultBlockComment.

public void testInsertNonDefaultBlockComment() {
    Language prevCommenterLanguage = HbConfig.getCommenterLanguage();
    HbConfig.setCommenterLanguage(JavaLanguage.INSTANCE);
    doBlockCommentTest("{{#foo}}<caret>", "{{#foo}}/*<caret>*/");
    HbConfig.setCommenterLanguage(prevCommenterLanguage);
}
Also used : Language(com.intellij.lang.Language) HbLanguage(com.dmarcotte.handlebars.HbLanguage) JavaLanguage(com.intellij.lang.java.JavaLanguage)

Example 4 with Language

use of com.intellij.lang.Language in project idea-handlebars by dmarcotte.

the class HbCommentActionTest method testNativeInsertLineComment1.

public void testNativeInsertLineComment1() {
    Language prevCommenterLang = HbConfig.getCommenterLanguage();
    HbConfig.setCommenterLanguage(HbLanguage.INSTANCE);
    doLineCommentTest("{{#foo}}<caret>", "{{!--{{#foo}}<caret>--}}");
    HbConfig.setCommenterLanguage(prevCommenterLang);
}
Also used : Language(com.intellij.lang.Language) HbLanguage(com.dmarcotte.handlebars.HbLanguage) JavaLanguage(com.intellij.lang.java.JavaLanguage)

Example 5 with Language

use of com.intellij.lang.Language in project idea-handlebars by dmarcotte.

the class HbCommentActionTest method testNativeInsertBlockCommentWithSelection.

public void testNativeInsertBlockCommentWithSelection() {
    Language prevCommenterLang = HbConfig.getCommenterLanguage();
    HbConfig.setCommenterLanguage(HbLanguage.INSTANCE);
    doBlockCommentTest("<selection><caret>{{#foo}}" + "    {{bar}}</selection>" + "{{/foo}", "<selection>{{!--<caret>{{#foo}}" + "    {{bar}}--}}</selection>" + "{{/foo}");
    HbConfig.setCommenterLanguage(prevCommenterLang);
}
Also used : Language(com.intellij.lang.Language) HbLanguage(com.dmarcotte.handlebars.HbLanguage) JavaLanguage(com.intellij.lang.java.JavaLanguage)

Aggregations

Language (com.intellij.lang.Language)292 NotNull (org.jetbrains.annotations.NotNull)58 Nullable (org.jetbrains.annotations.Nullable)49 PsiElement (com.intellij.psi.PsiElement)46 PsiFile (com.intellij.psi.PsiFile)45 FileType (com.intellij.openapi.fileTypes.FileType)31 Project (com.intellij.openapi.project.Project)31 TextRange (com.intellij.openapi.util.TextRange)25 LanguageFileType (com.intellij.openapi.fileTypes.LanguageFileType)23 VirtualFile (com.intellij.openapi.vfs.VirtualFile)21 FileViewProvider (com.intellij.psi.FileViewProvider)21 HbLanguage (com.dmarcotte.handlebars.HbLanguage)20 JavaLanguage (com.intellij.lang.java.JavaLanguage)16 Editor (com.intellij.openapi.editor.Editor)14 XMLLanguage (com.intellij.lang.xml.XMLLanguage)12 TemplateLanguageFileViewProvider (com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider)11 List (java.util.List)11 HTMLLanguage (com.intellij.lang.html.HTMLLanguage)9 JavascriptLanguage (com.intellij.lang.javascript.JavascriptLanguage)9 Document (com.intellij.openapi.editor.Document)9