fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper.visitServiceCallArgumentMethodIndex()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper.visitServiceCallArgumentMethodIndex()方法的一些代码示例,展示了YamlHelper.visitServiceCallArgumentMethodIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlHelper.visitServiceCallArgumentMethodIndex()方法的具体详情如下:
包路径:fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper
类名称:YamlHelper
方法名:visitServiceCallArgumentMethodIndex

YamlHelper.visitServiceCallArgumentMethodIndex介绍

[英]Consumer for method parameter match service_name: class: FOOBAR calls: - [onFoobar, [@foo]]
[中]方法参数匹配服务的使用者\u name:class:FOOBAR调用:-[onFoobar,[@foo]]

代码示例

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

/**
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#visitServiceCallArgumentMethodIndex
 */
public void testVisitServiceCallArgumentMethodIndexForNamedServices() {
  myFixture.configureByText(YAMLFileType.YML, "services:\n" +
    "    Foo\\Bar:\n" +
    "       calls:\n" +
    "           - [ 'setBar', ['@foo', @f<caret>oo] ]\n"
  );
  PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset());
  YAMLScalar parent = (YAMLScalar) psiElement.getParent();
  Collection<Parameter> parameters = new ArrayList<>();
  YamlHelper.visitServiceCallArgumentMethodIndex(parent, parameters::add);
  assertNotNull(ContainerUtil.find(parameters, parameter -> "arg2".equals(parameter.getName())));
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

/**
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#visitServiceCallArgumentMethodIndex
 */
public void testVisitServiceCallArgumentMethodIndex() {
  myFixture.configureByText(YAMLFileType.YML, "services:\n" +
    "    foobar:\n" +
    "       class: Foo\\Bar\n" +
    "       calls:\n" +
    "           - [ 'setBar', [@f<caret>oo] ]\n"
  );
  PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset());
  YAMLScalar parent = (YAMLScalar) psiElement.getParent();
  Collection<Parameter> parameters = new ArrayList<>();
  YamlHelper.visitServiceCallArgumentMethodIndex(parent, parameters::add);
  assertNotNull(ContainerUtil.find(parameters, parameter -> "arg1".equals(parameter.getName())));
}

代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin

YamlHelper.visitServiceCallArgumentMethodIndex((YAMLScalar) psiElement, parameter ->
  match[0] = new Match(createTypeHintFromParameter(psiElement.getProject(), parameter), psiElement.getTextRange().getEndOffset())
);

相关文章