mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 10:51:25 +07:00
Test fixes
1. Removed static processing for FormatterUtilHelper; 2. Merged FormatterUtilHelper with WhiteSpaceFormattingStrategy;
This commit is contained in:
+7
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,20 +16,15 @@
|
||||
package com.intellij.psi.formatter;
|
||||
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.impl.source.tree.ElementType;
|
||||
import com.intellij.psi.impl.source.tree.LeafElement;
|
||||
import com.intellij.psi.JavaDocTokenType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author max
|
||||
*/
|
||||
public class JavadocFormatterUtilHelper implements FormatterUtilHelper {
|
||||
public class JavadocWhiteSpaceFormattingStrategy extends WhiteSpaceFormattingStrategyAdapter {
|
||||
@Override
|
||||
public boolean addWhitespace(final ASTNode treePrev, final LeafElement whiteSpaceElement) {
|
||||
return false;
|
||||
public boolean containsWhitespacesOnly(@NotNull final ASTNode node) {
|
||||
return node.getElementType() == JavaDocTokenType.DOC_COMMENT_DATA && node.textContains('\n') && node.getText().trim().length() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsWhitespacesOnly(final ASTNode node) {
|
||||
return node.getElementType() == ElementType.DOC_COMMENT_DATA && node.textContains('\n') && node.getText().trim().length() == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,8 +22,6 @@ import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiField;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.formatter.FormatterUtil;
|
||||
import com.intellij.psi.formatter.JavadocFormatterUtilHelper;
|
||||
import com.intellij.psi.javadoc.JavadocManager;
|
||||
import com.intellij.psi.javadoc.JavadocTagInfo;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,10 +37,6 @@ import java.util.List;
|
||||
public class JavadocManagerImpl implements JavadocManager {
|
||||
private final List<JavadocTagInfo> myInfos;
|
||||
|
||||
static {
|
||||
FormatterUtil.addHelper(new JavadocFormatterUtilHelper());
|
||||
}
|
||||
|
||||
public JavadocManagerImpl(Project project) {
|
||||
myInfos = new ArrayList<JavadocTagInfo>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user