Пример #1
0
 private static boolean isLiteral(PsiElement element) {
   if (element == null) return false;
   final ASTNode astNode = element.getNode();
   if (astNode == null) {
     return false;
   }
   final IElementType elementType = astNode.getElementType();
   final ParserDefinition parserDefinition =
       LanguageParserDefinitions.INSTANCE.forLanguage(element.getLanguage());
   if (parserDefinition != null) {
     final TokenSet literals = parserDefinition.getStringLiteralElements();
     return literals.contains(elementType);
   }
   return false;
 }
Пример #2
0
 @Override
 public boolean canBeVarDelimeter(@NotNull PsiElement element) {
   final ASTNode node = element.getNode();
   return node != null && getVariableDelimiters().contains(node.getElementType());
 }