本文整理汇总了Java中org.jetbrains.yaml.YAMLLanguage类的典型用法代码示例。如果您正苦于以下问题:Java YAMLLanguage类的具体用法?Java YAMLLanguage怎么用?Java YAMLLanguage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
YAMLLanguage类属于org.jetbrains.yaml包,在下文中一共展示了YAMLLanguage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFileViewProvider
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
@NotNull
@Override
public FileViewProvider createFileViewProvider(@NotNull VirtualFile file, Language language, @NotNull PsiManager manager, boolean eventSystemEnabled) {
return new SingleRootFileViewProvider(manager, file, eventSystemEnabled) {
@NotNull
@Override
public Language getBaseLanguage() {
return YAMLLanguage.INSTANCE;
}
};
}
示例2: CloudSlangCompletionContributor
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
public CloudSlangCompletionContributor() {
extend(CompletionType.BASIC,
PlatformPatterns.psiElement().withLanguage(YAMLLanguage.INSTANCE),
new CompletionProvider<CompletionParameters>() {
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull CompletionResultSet resultSet) {
addSlangKeywords(resultSet);
addYamlKeywordsUsedByCloudSlang(resultSet);
}
}
);
}
示例3: getWithFirstRootKey
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
public static ElementPattern<PsiElement> getWithFirstRootKey() {
return PlatformPatterns.and(PlatformPatterns.or(
// foo:
// <caret>
PlatformPatterns
.psiElement().with(new ParentPathPatternCondition(
YAMLScalar.class, YAMLMapping.class,
YAMLKeyValue.class, YAMLMapping.class,
YAMLDocument.class
))
.withLanguage(YAMLLanguage.INSTANCE),
// foo:
// <caret> (on incomplete)
PlatformPatterns
.psiElement().afterLeaf(
PlatformPatterns.psiElement(YAMLTokenTypes.INDENT).with(
new ParentPathPatternCondition(YAMLKeyValue.class, YAMLMapping.class, YAMLDocument.class)
)
)
.withLanguage(YAMLLanguage.INSTANCE),
// foo:
// fo<caret>:
PlatformPatterns.psiElement().with(new ParentPathPatternCondition(
YAMLKeyValue.class, YAMLMapping.class,
YAMLKeyValue.class, YAMLMapping.class,
YAMLDocument.class)
)
));
}
示例4: getNodeTypeElementMatcher
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
protected PsiElementPattern.Capture<PsiElement> getNodeTypeElementMatcher(@NotNull String... keys) {
return PlatformPatterns
.psiElement()
.with(new ParentKeysPatternCondition(keys))
.with(new FilenamePrefixPatternCondition("NodeTypes."))
.withLanguage(YAMLLanguage.INSTANCE);
}
示例5: localReferencePattern
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<YAMLQuotedText> localReferencePattern(final String refTypePrefix) {
return psiElement(YAMLQuotedText.class)
.withParent(psiElement(YAMLKeyValue.class).withName(OpenApiConstants.REF_KEY))
.withText(StandardPatterns.string().contains(refTypePrefix))
.andNot(StandardPatterns.string().matches(".ya?ml"))
.withLanguage(YAMLLanguage.INSTANCE);
}
示例6: localDefinitionsPattern
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
private PsiElementPattern.Capture<YAMLQuotedText> localDefinitionsPattern() {
return swagger(psiElement(YAMLQuotedText.class)
.withParent(psiElement(YAMLKeyValue.class).withName(SwaggerConstants.REF_KEY))
.withText(StandardPatterns.string().contains(SwaggerConstants.LOCAL_DEFINITIONS_PREFIX))
.andNot(StandardPatterns.string().matches(".ya?ml"))
.withLanguage(YAMLLanguage.INSTANCE));
}
示例7: getSingleLineScalarKey
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
public static ElementPattern<PsiElement> getSingleLineScalarKey(String... keyName) {
// key: | and key: "quote" is valid here
// getKeyPattern
return PlatformPatterns.or(
PlatformPatterns
.psiElement(YAMLTokenTypes.TEXT)
.withParent(PlatformPatterns.psiElement(YAMLScalar.class)
.withParent(PlatformPatterns
.psiElement(YAMLKeyValue.class)
.withName(
PlatformPatterns.string().oneOf(keyName)
)
))
.withLanguage(YAMLLanguage.INSTANCE)
,
PlatformPatterns
.psiElement(YAMLTokenTypes.SCALAR_DSTRING)
.withParent(PlatformPatterns.psiElement(YAMLScalar.class)
.withParent(PlatformPatterns
.psiElement(YAMLKeyValue.class)
.withName(
PlatformPatterns.string().oneOf(keyName)
)
))
.withLanguage(YAMLLanguage.INSTANCE),
PlatformPatterns
.psiElement(YAMLTokenTypes.SCALAR_STRING)
.withParent(PlatformPatterns.psiElement(YAMLScalar.class)
.withParent(PlatformPatterns
.psiElement(YAMLKeyValue.class)
.withName(
PlatformPatterns.string().oneOf(keyName)
)
))
.withLanguage(YAMLLanguage.INSTANCE)
);
}
示例8: getServiceDefinition
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
/**
* find common services: @foo, "@foo", '@foo'
*/
public static ElementPattern<PsiElement> getServiceDefinition() {
return PlatformPatterns
.psiElement().with(SCALAR_ELEMENT_TYPES)
.withParent(
PlatformPatterns.psiElement(YAMLScalar.class).with(new YAMLScalarValueStartsWithPatternCondition("@"))
)
.withLanguage(YAMLLanguage.INSTANCE);
}
示例9: getServiceParameterDefinition
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
/**
* find common service parameter: %foo%, %foo%, %foo%
*/
public static ElementPattern<PsiElement> getServiceParameterDefinition() {
return PlatformPatterns
.psiElement().with(SCALAR_ELEMENT_TYPES)
.withParent(
PlatformPatterns.psiElement(YAMLScalar.class).with(new YAMLScalarValueStartsWithPatternCondition("%"))
)
.withLanguage(YAMLLanguage.INSTANCE);
}
示例10: YamlCompletionContributor
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
public YamlCompletionContributor() {
extend(CompletionType.BASIC, PlatformPatterns.psiElement().withLanguage(YAMLLanguage.INSTANCE),
new YamlCompletionProvider());
}
示例11: CoffigYamlLanguage
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
private CoffigYamlLanguage() {
super(YAMLLanguage.INSTANCE, "coffig/yaml", "application/yaml");
}
示例12: CoffigCompletionContributor
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
public CoffigCompletionContributor() {
extend(CompletionType.BASIC, PlatformPatterns.psiElement(YAMLTokenTypes.TEXT).withLanguage(YAMLLanguage.INSTANCE), DISPATCHING_COMPLETION_PROVIDER);
extend(CompletionType.BASIC, PlatformPatterns.psiElement(YAMLTokenTypes.SCALAR_STRING).withLanguage(YAMLLanguage.INSTANCE), DISPATCHING_COMPLETION_PROVIDER);
extend(CompletionType.BASIC, PlatformPatterns.psiElement(YAMLTokenTypes.SCALAR_DSTRING).withLanguage(YAMLLanguage.INSTANCE), DISPATCHING_COMPLETION_PROVIDER);
extend(CompletionType.BASIC, PlatformPatterns.psiElement(YAMLTokenTypes.SCALAR_KEY).withLanguage(YAMLLanguage.INSTANCE), DISPATCHING_COMPLETION_PROVIDER);
}
示例13: ThemeConfigurationFileType
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
public ThemeConfigurationFileType() {
super(YAMLLanguage.INSTANCE);
}
示例14: ThemeBlueprintsFileType
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
public ThemeBlueprintsFileType() {
super(YAMLLanguage.INSTANCE);
}
示例15: CloudSlangFileType
import org.jetbrains.yaml.YAMLLanguage; //导入依赖的package包/类
private CloudSlangFileType() {
super(YAMLLanguage.INSTANCE);
}