• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JavaScriptFileType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.lang.javascript.JavaScriptFileType的典型用法代码示例。如果您正苦于以下问题:Java JavaScriptFileType类的具体用法?Java JavaScriptFileType怎么用?Java JavaScriptFileType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JavaScriptFileType类属于com.intellij.lang.javascript包,在下文中一共展示了JavaScriptFileType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testGetSnippetNamespaceFromFile

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
/**
 * @see ExtJsUtil#getSnippetNamespaceFromFile
 */
public void testGetSnippetNamespaceFromFile() {
    String[] foo = {
        "//{namespace name=backend/index/view/widgets}",
        "//{namespace name = backend/index/view/widgets}",
        "//{namespace foobar='aaaa' name='backend/index/view/widgets' }",
        "//{namespace name=\"backend/index/view/widgets\" }",
    };

    for (String s : foo) {
        PsiFile fileFromText = PsiFileFactory.getInstance(getProject())
            .createFileFromText("foo.js", JavaScriptFileType.INSTANCE, s);

        assertEquals("backend/index/view/widgets", ExtJsUtil.getSnippetNamespaceFromFile(fileFromText));
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:19,代码来源:ExtJsUtilTest.java


示例2: setupSdkPaths

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@Override
public void setupSdkPaths(Sdk sdk)
{
	SdkModificator modificator = sdk.getSdkModificator();

	VirtualFile stubsDirectory = LocalFileSystem.getInstance().findFileByIoFile(new File(PluginManager.getPluginPath(NodeJSBundleType.class), "stubs"));
	if(stubsDirectory != null)
	{
		for(VirtualFile file : stubsDirectory.getChildren())
		{
			if(file.getFileType() == JavaScriptFileType.INSTANCE)
			{
				modificator.addRoot(file, BinariesOrderRootType.getInstance());
				modificator.addRoot(file, SourcesOrderRootType.getInstance());
			}
		}
	}

	modificator.commitChanges();
}
 
开发者ID:consulo,项目名称:consulo-nodejs,代码行数:21,代码来源:NodeJSBundleType.java


示例3: findExecutableFile

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@Nullable
public static VirtualFile findExecutableFile(ConfigurationContext configurationContext, @Nullable Condition<JSFile> condition)
{
	PsiElement psiLocation = configurationContext.getPsiLocation();
	PsiFile psiFile = psiLocation == null ? null : psiLocation.getContainingFile();
	if(psiFile instanceof JSFile && psiFile.getFileType() == JavaScriptFileType.INSTANCE)
	{
		if(condition != null && !condition.value((JSFile) psiFile))
		{
			return null;
		}
		Module module = configurationContext.getModule();
		if(module == null)
		{
			return null;
		}
		NodeJSModuleExtension extension = ModuleUtilCore.getExtension(module, NodeJSModuleExtension.class);
		if(extension == null)
		{
			return null;
		}
		return psiFile.getVirtualFile();
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-nodejs,代码行数:26,代码来源:NodeJSConfigurationProducerUtil.java


示例4: apply

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@Override
public void apply(CodeStyleSettings settings) {
    CommonCodeStyleSettings commonSettings = settings.getCommonSettings(getLanguage());

    commonSettings.SPACE_WITHIN_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_METHOD_CALL_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_METHOD_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_IF_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_WHILE_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_FOR_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_CATCH_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_SWITCH_PARENTHESES = true;
    commonSettings.SPACE_WITHIN_ARRAY_INITIALIZER_BRACES = true;
    commonSettings.SPACE_AFTER_TYPE_CAST = true;

    CodeStyleSettings.IndentOptions indentOptions = settings.getIndentOptions(JavaScriptFileType.INSTANCE);
    indentOptions.USE_TAB_CHARACTER = true;
    indentOptions.SMART_TABS = true;
    indentOptions.TAB_SIZE = 4;
    indentOptions.INDENT_SIZE = 4;
    indentOptions.CONTINUATION_INDENT_SIZE = 4;
    indentOptions.LABEL_INDENT_SIZE = 0;
    indentOptions.LABEL_INDENT_ABSOLUTE = false;
    indentOptions.USE_RELATIVE_INDENTS = false;
}
 
开发者ID:reedy,项目名称:phpstorm-plugin-mediawiki,代码行数:26,代码来源:MediaWikiJsPredefinedCodeStyle.java


示例5: JavaScriptLineBreakpointType

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
public JavaScriptLineBreakpointType()
{
	super("javascript", "JavaScript Breakpoints", new XDebuggerEditorsProvider()
	{
		@NotNull
		@Override
		public FileType getFileType()
		{
			return JavaScriptFileType.INSTANCE;
		}

		@NotNull
		@Override
		public Document createDocument(@NotNull Project project, @NotNull String s, @Nullable XSourcePosition sourcePosition, @NotNull EvaluationMode evaluationMode)
		{
			return JSDebuggerSupportUtils.createDocument(s, project, sourcePosition == null ? null : sourcePosition.getFile(), sourcePosition == null ? 0 : sourcePosition.getOffset());
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:20,代码来源:JavaScriptLineBreakpointType.java


示例6: isGraphQLRelatedFile

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
protected boolean isGraphQLRelatedFile(VirtualFile file) {
    if(file.getFileType() == JSGraphQLFileType.INSTANCE) {
        return true;
    }
    if(JavaScriptFileType.getFileTypesCompilableToJavaScript().contains(file.getFileType())) {
        return true;
    }
    return false;
}
 
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:10,代码来源:JSGraphQLNodeInterpreterEditorNotificationProvider.java


示例7: getInputFilter

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> {
        FileType fileType = file.getFileType();
        return fileType == SmartyFileType.INSTANCE || fileType == JavaScriptFileType.INSTANCE || "ini".equalsIgnoreCase(file.getExtension());
    };
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:9,代码来源:SnippetIndex.java


示例8: testCompletionPrefixForSnippetNameWithFileScopeNamespace

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
public void testCompletionPrefixForSnippetNameWithFileScopeNamespace() {
    String[] dataProvider = {
        "{s name='<caret>'}",
        "{s name=<caret>}",
    };

    for (String s : dataProvider) {
        assertCompletionContains(
            JavaScriptFileType.INSTANCE,
            "//{namespace name=foobar/widgets}\n" +
                "var foo = {foo: \"" + s + "\"}",
            "swag-last-registrations/customer"
        );
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:16,代码来源:ShopwareJavaScriptCompletionTest.java


示例9: testCompletionPrefixForSnippetNameWithInlineNamespace

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
public void testCompletionPrefixForSnippetNameWithInlineNamespace() {
    String[] dataProvider = {
        "{s name='<caret>' name=foobar/widgets}",
        "{s name=<caret>} name=foobar/widgets}",
    };

    for (String s : dataProvider) {
        assertCompletionContains(
            JavaScriptFileType.INSTANCE,
            "//{namespace name=foobar/widgets}\n" +
                "var foo = {foo: \"" + s + "\"}",
            "swag-last-registrations/customer"
        );
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:16,代码来源:ShopwareJavaScriptCompletionTest.java


示例10: testCompletionPrefixForSnippetNamespace

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
public void testCompletionPrefixForSnippetNamespace() {
    String[] dataProvider = {
        "{s namespace='<caret>'}",
        "{s namespace=<caret>}",
    };

    for (String s : dataProvider) {
        assertCompletionContains(
            JavaScriptFileType.INSTANCE,
            "var foo = {foo: \"" + s + "\"}",
            "foobar/widgets"
        );
    }
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:15,代码来源:ShopwareJavaScriptCompletionTest.java


示例11: testCompletionPrefixForCommentNamespace

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
public void testCompletionPrefixForCommentNamespace() {
    assertCompletionContains(
        JavaScriptFileType.INSTANCE,
        "//{namespace name=<caret>}",
        "foobar/widgets"
    );
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:8,代码来源:ShopwareJavaScriptCompletionTest.java


示例12: testSnippetsNavigation

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
public void testSnippetsNavigation() {
    assertNavigationMatch(
        JavaScriptFileType.INSTANCE,
        "var foo = \"{s name='swag-last-registr<caret>ations/customer' namespace='foobar/widgets'}{/s}\"",
        PlatformPatterns.psiFile()
    );
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:8,代码来源:ExtJsGoToDeclarationHandlerTest.java


示例13: testNamespaceAsCommentNavigation

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
public void testNamespaceAsCommentNavigation() {
    assertNavigationMatch(
        JavaScriptFileType.INSTANCE,
        "\n//{namespace name=foo<caret>bar/widgets}",
        PlatformPatterns.psiFile()
    );
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:8,代码来源:ExtJsGoToDeclarationHandlerTest.java


示例14: testGetNamespaceFromStringLiteral

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
/**
 * @see ExtJsUtil#getNamespaceFromStringLiteral
 */
public void testGetNamespaceFromStringLiteral() {
    myFixture.configureByText(
        JavaScriptFileType.INSTANCE,
        "var foo = { foo: \"{s name=backend/inde<caret>x/view/widgets namespace='foobar'}\"}"
    );

    PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset()).getParent();

    assertEquals("foobar", ExtJsUtil.getNamespaceFromStringLiteral((JSLiteralExpression) psiElement));
}
 
开发者ID:Haehnchen,项目名称:idea-php-shopware-plugin,代码行数:14,代码来源:ExtJsUtilTest.java


示例15: resolveModuleImpl

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@Nullable
@RequiredReadAction
public Module resolveModuleImpl(@NotNull PsiDirectory psiDirectory, @NotNull FileType fileType)
{
	if(fileType == CSharpFileType.INSTANCE)
	{
		return findModule(psiDirectory, "CSharp");
	}
	else if(fileType == JavaScriptFileType.INSTANCE)
	{
		return findModule(psiDirectory, "UnityScript");
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:15,代码来源:Unity3dModuleResolver.java


示例16: createAssemblyUnityScriptModuleFirstPass

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
private static Module createAssemblyUnityScriptModuleFirstPass(final Project project,
		ModifiableModuleModel newModel,
		final Sdk unityBundle,
		MultiMap<Module, VirtualFile> virtualFilesByModule,
		ProgressIndicator progressIndicator)
{

	return createAndSetupModule("Assembly-UnityScript-firstpass", project, newModel, FIRST_PASS_PATHS, unityBundle, null, "unity3d-unityscript-child", JavaScriptFileType.INSTANCE,
			virtualFilesByModule, progressIndicator);
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:11,代码来源:Unity3dProjectImportUtil.java


示例17: registerFileTypes

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@Override
public void registerFileTypes(Consumer<FileType> consumer)
{
	consumer.accept(DotNetModuleFileType.INSTANCE);
	consumer.accept(CSharpFileType.INSTANCE);
	consumer.accept(JavaScriptFileType.INSTANCE);
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:8,代码来源:DefaultUnity3dProjectSourceFileTypeFactory.java


示例18: setName

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@RequiredWriteAction
@Override
public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException
{
	myFile.setName(name + "." + JavaScriptFileType.INSTANCE.getDefaultExtension());
	return this;
}
 
开发者ID:consulo,项目名称:consulo-unity3d,代码行数:8,代码来源:UnityScriptDotNetTypeDeclaration.java


示例19: detect

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@Nullable
@Override
public FileType detect(@NotNull VirtualFile file, @NotNull ByteSequence byteSequence, @Nullable CharSequence charSequence)
{
	if(FileUtil.isHashBangLine(charSequence, "/usr/bin/env node"))
	{
		return JavaScriptFileType.INSTANCE;
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-nodejs,代码行数:11,代码来源:NodeJSFileTypeDetector.java


示例20: buildDialog

import com.intellij.lang.javascript.JavaScriptFileType; //导入依赖的package包/类
@Override
protected void buildDialog(Project project, PsiDirectory directory, CreateFileFromTemplateDialog.Builder builder)
{
	builder.setTitle("Create JavaScript File");

	builder.addKind("Empty File", JavaScriptFileType.INSTANCE.getIcon(), "JavaScriptFile");
}
 
开发者ID:consulo,项目名称:consulo-javascript,代码行数:8,代码来源:JavaScriptCreateFileAction.java



注:本文中的com.intellij.lang.javascript.JavaScriptFileType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BrazilianAnalyzer类代码示例发布时间:2022-05-22
下一篇:
Java EventType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap