本文整理汇总了Java中com.intellij.lang.javascript.JSTokenTypes.C_STYLE_COMMENT属性的典型用法代码示例。如果您正苦于以下问题:Java JSTokenTypes.C_STYLE_COMMENT属性的具体用法?Java JSTokenTypes.C_STYLE_COMMENT怎么用?Java JSTokenTypes.C_STYLE_COMMENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.lang.javascript.JSTokenTypes
的用法示例。
在下文中一共展示了JSTokenTypes.C_STYLE_COMMENT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPlaceholderText
@Override
public String getPlaceholderText(ASTNode node)
{
final IElementType type = node.getElementType();
if(type == JSTokenTypes.DOC_COMMENT)
{
return "/**...*/";
}
else if(type == JSTokenTypes.C_STYLE_COMMENT)
{
return "/*...*/";
}
else if(type == JSTokenTypes.END_OF_LINE_COMMENT)
{
return "//...";
}
else if(type == JSElementTypes.IMPORT_STATEMENT)
{
return "import ...";
}
else if(type == JSElementTypes.BLOCK_STATEMENT ||
type == JSElementTypes.OBJECT_LITERAL_EXPRESSION ||
type == JSElementTypes.CLASS ||
type == JSElementTypes.PACKAGE_STATEMENT)
{
return "{...}";
}
else if(type == JSElementTypes.ARRAY_LITERAL_EXPRESSION)
{
return "[...]";
}
else if(type == JSElementTypes.XML_LITERAL_EXPRESSION)
{
return "<xml/>";
}
return null;
}
示例2: appendDescriptors
private static ASTNode appendDescriptors(final ASTNode node, final Document document, final List<FoldingDescriptor> descriptors)
{
final IElementType type = node.getElementType();
if(type == JSElementTypes.BLOCK_STATEMENT ||
type == JSElementTypes.OBJECT_LITERAL_EXPRESSION ||
type == JSElementTypes.ARRAY_LITERAL_EXPRESSION ||
type == JSElementTypes.XML_LITERAL_EXPRESSION)
{
TextRange textRange = node.getTextRange();
if(textRange.getEndOffset() < document.getTextLength() && document.getLineNumber(textRange.getStartOffset()) != document.getLineNumber(textRange
.getEndOffset()))
{
addDescriptorForNode(node, descriptors);
}
}
else if(type == JSTokenTypes.DOC_COMMENT)
{
addDescriptorForNode(node, descriptors);
}
else if(type == JSTokenTypes.C_STYLE_COMMENT)
{
addDescriptorForNode(node, descriptors);
}
else if(type == JSTokenTypes.END_OF_LINE_COMMENT)
{
return collapseConsequentNodesOfSpecifiedType(node, descriptors, JSTokenTypes.END_OF_LINE_COMMENT);
}
else if(type == JSElementTypes.IMPORT_STATEMENT)
{
return collapseConsequentNodesOfSpecifiedType(node, descriptors, JSElementTypes.IMPORT_STATEMENT);
}
else if(type == JSElementTypes.CLASS || type == JSElementTypes.PACKAGE_STATEMENT)
{
ASTNode lbrace = node.findChildByType(JSTokenTypes.LBRACE);
if(lbrace != null)
{
addDescriptorForRange(node, descriptors, new TextRange(lbrace.getStartOffset(), node.getTextRange().getEndOffset()));
}
}
if(type instanceof JSFileElementType)
{
// expand chameleon
node.getPsi().getFirstChild();
}
ASTNode child = node.getFirstChildNode();
while(child != null)
{
child = appendDescriptors(child, document, descriptors).getTreeNext();
}
return node;
}