org.springframework.ide.vscode.commons.yaml.schema.YValueHint类的使用及代码示例

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

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

YValueHint介绍

暂无

代码示例

代码示例来源:origin: spring-projects/sts4

private ICompletionProposal createProposal(CompletionFactory f, DocumentRegion region, int offset, String query, double score, YValueHint domain) {
  DocumentEdits edits = new DocumentEdits(region.getDocument());
  region = region.subSequence(offset - query.length());
  boolean needSpace = region.textBefore(1).charAt(0)==':'; //Add extra space after ':' if needed!
  edits.replace(region.getStart(), region.getEnd(), needSpace ? " "+domain.getValue() : domain.getValue());
  return f.valueProposal(domain.getValue(), query, domain.getLabel(), schema.t_route_string,
      domain.getDocumentation(), score, edits, schema.getTypeUtil());
}

代码示例来源:origin: spring-projects/sts4

double score = FuzzyMatcher.matchScore(query, value.getValue());
if (score!=0 && value!=null && !query.equals(value.getValue())) {
  int queryStart = offset-query.length();
  DocumentEdits edits = new DocumentEdits(doc.getDocument());
    edits.insert(offset, " ");
  edits.insert(offset, value.getValue());
  String extraInsertion = value.getExtraInsertion();
  if (extraInsertion!=null) {
    edits.insert(offset, indenter.applyIndentation(extraInsertion, referenceIndent));
      value.getValue(), query, value.getLabel(), type,
      value.getDocumentation(), score, edits, typeUtil
  ));

代码示例来源:origin: spring-projects/sts4

public static Callable<Collection<String>> valuesFromHintProvider(Callable<Collection<YValueHint>> hintProvider) {
  Callable<Collection<String>> values = () -> {
    Collection<YValueHint> hints = hintProvider.call();
    if (hints != null) {
      ImmutableSet.Builder<String> builder = ImmutableSet.builder();
      for (YValueHint hint : hints ) {
        builder.add(hint.getValue());
      }
      return builder.build();
    }
    return null;
  };
  return values;
}

代码示例来源:origin: spring-projects/sts4

for (YValueHint domain : domains) {
  for (String query : queries) {
    double score = FuzzyMatcher.matchScore(query, domain.getValue());
    if (score!=0.0) {
      proposals.add(createProposal(f, region, offset, query, score, domain));

代码示例来源:origin: spring-projects/sts4

public YAtomicType yenumFromHints(String name, SchemaContextAware<BiFunction<String, Collection<String>, String>> errorMessageFormatter, SchemaContextAware<PartialCollection<YValueHint>> values) {
  YAtomicType t = yatomic(name);
  t.setHintProvider(values);
  t.parseWith((DynamicSchemaContext dc) -> {
    PartialCollection<YValueHint> hints = PartialCollection.fromCallable(() -> values.withContext(dc));
    return new EnumValueParser(name, hints.map(h -> h.getValue())) {
      @Override
      protected String createErrorMessage(String parseString, Collection<String> values) {
        try {
          return errorMessageFormatter.withContext(dc).apply(parseString, values);
        } catch (Exception e) {
          return super.createErrorMessage(parseString, values);
        }
      }
    };
  });
  return t;
}

相关文章