gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-18 15:31:31 24 4
gpt4 key购买 nike

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

YamlHelper.getYamlArrayOnSequenceOrArrayElements介绍

[英]Simplify getting of array psi elements in array or sequence context arguments: [@foo] arguments: - @foo TODO: can be handled nice know because on new yaml plugin
[中]简化数组或序列上下文参数中数组psi元素的获取:[@foo]参数:-@foo-TODO:可以处理,因为在新的yaml插件上

代码示例

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

List<PsiElement> yamlArrayOnSequenceOrArrayElements = YamlHelper.getYamlArrayOnSequenceOrArrayElements((YAMLCompoundValue) yamlCompoundValue);
if(yamlArrayOnSequenceOrArrayElements != null) {
  serviceArguments = yamlArrayOnSequenceOrArrayElements.size();

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

List<PsiElement> yamlArguments = YamlHelper.getYamlArrayOnSequenceOrArrayElements((YAMLCompoundValue) yamlCompoundValue);
if(yamlArguments != null && yamlArguments.size() > 0) {
  appendEndOffset = yamlArguments.get(yamlArguments.size() - 1).getTextRange().getEndOffset();

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

/**
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#getYamlArrayOnSequenceOrArrayElements
 */
public void testGetYamlArrayOnSequenceOrArrayElementsForArray() {
  YAMLCompoundValue fromText = YamlPsiElementFactory.createFromText(getProject(), YAMLCompoundValue.class, "" +
    "calls: [@foo, @bar] \n"
  );
  assertNotNull(fromText);
  String join = StringUtils.join(ContainerUtil.map(YamlHelper.getYamlArrayOnSequenceOrArrayElements(fromText), new Function<PsiElement, String>() {
    @Override
    public String fun(PsiElement psiElement) {
      return psiElement.getText();
    }
  }), ",");
  assertTrue(join.contains("foo"));
  assertTrue(join.contains("bar"));
}

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

/**
 * @see fr.adrienbrault.idea.symfony2plugin.util.yaml.YamlHelper#getYamlArrayOnSequenceOrArrayElements
 */
public void testGetYamlArrayOnSequenceOrArrayElements() {
  String[] strings = {
    "calls: [@foo, @bar] \n",
    "calls:\n  - @foo\n  - @bar\n",
  };
  for (String s : strings) {
    YAMLCompoundValue fromText = YamlPsiElementFactory.createFromText(getProject(), YAMLCompoundValue.class, s);
    assertNotNull(fromText);
    List<PsiElement> elements = YamlHelper.getYamlArrayOnSequenceOrArrayElements(fromText);
    assertNotNull(elements);
    String join = StringUtils.join(ContainerUtil.map(elements, new Function<PsiElement, String>() {
      @Override
      public String fun(PsiElement psiElement) {
        return psiElement.getText();
      }
    }), ",");
    assertTrue(join.contains("foo"));
    assertTrue(join.contains("bar"));
  }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com