All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.aya.prettier.AyaPrettierOptions Maven / Gradle / Ivy

There is a newer version: 0.34.0
Show newest version
// Copyright (c) 2020-2024 Tesla (Yinsen) Zhang.
// Use of this source code is governed by the MIT license that can be found in the LICENSE.md file.
package org.aya.prettier;

import org.aya.util.prettier.PrettierOptions;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;

public class AyaPrettierOptions extends PrettierOptions {
  public AyaPrettierOptions() {
    super(Key.class);
  }

  public enum Key implements PrettierOptions.Key {
    InlineMetas,
    ShowImplicitArgs,
    ShowImplicitPats,
  }

  @Override public void reset() {
    for (Key value : Key.values()) map.put(value, false);
    map.put(Key.InlineMetas, true);
  }

  @Contract(pure = true, value = "->new") public static @NotNull AyaPrettierOptions debug() {
    var map = pretty();
    map.map.put(Key.ShowImplicitArgs, true);
    return map;
  }

  @Contract(pure = true, value = "->new") public static @NotNull AyaPrettierOptions pretty() {
    var map = new AyaPrettierOptions();
    map.map.put(Key.ShowImplicitPats, true);
    return map;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy