Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code reformat using IJ4 code style (part 3). #26

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@
* @author VISTALL
* @since 2018-06-17
*/
public abstract class ErrorReporter
{
public static ErrorReporter ourInstance = new ErrorReporter()
{
@Override
public void reportWarning(@Nonnull Project project, @Nonnull String text)
{
System.out.println(text);
}
};
public abstract class ErrorReporter {
public static ErrorReporter ourInstance = new ErrorReporter() {
@Override
public void reportWarning(@Nonnull Project project, @Nonnull String text) {
System.out.println(text);
}
};

public abstract void reportWarning(@Nonnull Project project, @Nonnull String text);
public abstract void reportWarning(@Nonnull Project project, @Nonnull String text);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,45 @@
* @author VISTALL
* @since 25-Mar-22
*/
public enum PlatformClass
{
PSI_ELEMENT("com.intellij.psi.PsiElement", "consulo.language.psi.PsiElement"),
PSI_TREE_UTIL("com.intellij.psi.util.PsiTreeUtil", "consulo.language.psi.util.PsiTreeUtil"),
AST_NODE("com.intellij.lang.ASTNode", "consulo.language.ast.ASTNode"),
AST_WRAPPER_PSI_ELEMENT("com.intellij.extapi.psi.ASTWrapperPsiElement", "consulo.language.impl.psi.ASTWrapperPsiElement"),
COMPOSITE_PSI_ELEMENT("com.intellij.psi.impl.source.tree.CompositePsiElement", "consulo.language.impl.psi.CompositePsiElement"),
TOKEN_SET("com.intellij.psi.tree.TokenSet", "consulo.language.ast.TokenSet"),
LANGUAGE("com.intellij.lang.Language", "consulo.language.Language"),
LANGUAGE_VERSION("consulo.lang.LanguageVersion", "consulo.language.version.LanguageVersion"),
PSI_BUILDER("com.intellij.lang.PsiBuilder", "consulo.language.parser.PsiBuilder"),
PSI_PARSER("com.intellij.lang.PsiParser", "consulo.language.parser.PsiParser"),
PSI_ELEMENT_VISITOR("com.intellij.psi.PsiElementVisitor", "consulo.language.psi.PsiElementVisitor"),
STUB_BASED_PSI_ELEMENT("com.intellij.psi.StubBasedPsiElement", "consulo.language.psi.StubBasedPsiElement"),
STUB_BASED_PSI_ELEMENT_BASE("com.intellij.extapi.psi.StubBasedPsiElementBase", "com.intellij.extapi.psi.StubBasedPsiElementBase"),
ISTUB_ELEMENT_TYPE("com.intellij.psi.stubs.IStubElementType", "consulo.language.psi.stub.IStubElementType"),
GENERATED_PARSER_UTIL_BASE("com.intellij.lang.parser.GeneratedParserUtilBase", "consulo.language.impl.parser.GeneratedParserUtilBase"),
IELEMENT_TYPE("com.intellij.psi.tree.IElementType", "consulo.language.ast.IElementType");
public enum PlatformClass {
PSI_ELEMENT("com.intellij.psi.PsiElement", "consulo.language.psi.PsiElement"),
PSI_TREE_UTIL("com.intellij.psi.util.PsiTreeUtil", "consulo.language.psi.util.PsiTreeUtil"),
AST_NODE("com.intellij.lang.ASTNode", "consulo.language.ast.ASTNode"),
AST_WRAPPER_PSI_ELEMENT("com.intellij.extapi.psi.ASTWrapperPsiElement", "consulo.language.impl.psi.ASTWrapperPsiElement"),
COMPOSITE_PSI_ELEMENT("com.intellij.psi.impl.source.tree.CompositePsiElement", "consulo.language.impl.psi.CompositePsiElement"),
TOKEN_SET("com.intellij.psi.tree.TokenSet", "consulo.language.ast.TokenSet"),
LANGUAGE("com.intellij.lang.Language", "consulo.language.Language"),
LANGUAGE_VERSION("consulo.lang.LanguageVersion", "consulo.language.version.LanguageVersion"),
PSI_BUILDER("com.intellij.lang.PsiBuilder", "consulo.language.parser.PsiBuilder"),
PSI_PARSER("com.intellij.lang.PsiParser", "consulo.language.parser.PsiParser"),
PSI_ELEMENT_VISITOR("com.intellij.psi.PsiElementVisitor", "consulo.language.psi.PsiElementVisitor"),
STUB_BASED_PSI_ELEMENT("com.intellij.psi.StubBasedPsiElement", "consulo.language.psi.StubBasedPsiElement"),
STUB_BASED_PSI_ELEMENT_BASE("com.intellij.extapi.psi.StubBasedPsiElementBase", "com.intellij.extapi.psi.StubBasedPsiElementBase"),
ISTUB_ELEMENT_TYPE("com.intellij.psi.stubs.IStubElementType", "consulo.language.psi.stub.IStubElementType"),
GENERATED_PARSER_UTIL_BASE("com.intellij.lang.parser.GeneratedParserUtilBase", "consulo.language.impl.parser.GeneratedParserUtilBase"),
IELEMENT_TYPE("com.intellij.psi.tree.IElementType", "consulo.language.ast.IElementType");

private final String myClassNameV2;
private final String myClassNameV3;
private final String myClassNameV2;
private final String myClassNameV3;

PlatformClass(String v2, String v3)
{
myClassNameV2 = v2;
myClassNameV3 = v3;
}
PlatformClass(String v2, String v3) {
myClassNameV2 = v2;
myClassNameV3 = v3;
}

public String getClassNameV2()
{
return myClassNameV2;
}
public String getClassNameV2() {
return myClassNameV2;
}

public String getClassNameV3()
{
return myClassNameV3;
}
public String getClassNameV3() {
return myClassNameV3;
}

public String select(String version)
{
if("3".equals(version))
{
return myClassNameV3;
}
public String select(String version) {
if ("3".equals(version)) {
return myClassNameV3;
}

return myClassNameV2;
}
return myClassNameV2;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@
* @author VISTALL
* @since 25-Mar-22
*/
public class PlatformClassKnownAttribute extends KnownAttribute<String>
{
private final PlatformClass myPlatformClass;
public class PlatformClassKnownAttribute extends KnownAttribute<String> {
private final PlatformClass myPlatformClass;

public PlatformClassKnownAttribute(boolean global, String name, PlatformClass platformClass)
{
super(global, name, String.class, platformClass.select(null));
myPlatformClass = platformClass;
}
public PlatformClassKnownAttribute(boolean global, String name, PlatformClass platformClass) {
super(global, name, String.class, platformClass.select(null));
myPlatformClass = platformClass;
}

@Override
public String getDefaultValue(String version)
{
return myPlatformClass.select(version);
}
@Override
public String getDefaultValue(String version) {
return myPlatformClass.select(version);
}
}
Loading
Loading