Skip to content

chrisdns/prettier-java

 
 

Repository files navigation

🚧 Work in Progress! 🚧

Build Status

Prettier Java

Prettier Banner

How it works

A Prettier plugin must first parse the source code of the target language into a traversable data structure (Usually an Abstract Syntax Tree) and then print out that data structure in a "pretty" style.

Prettier-Java uses a Java-Parser implemented in JavaScript using the Chevrotain Parser Building Toolkit for JavaScript. What this means is that unlike many other prettier plugins, prettier-java has no additional runtime pre-requisites (e.g: Python executable). It could even be used inside a browser.

Status

  • Parser package alpha version done.
  • Now Investigating the re-printer (actually prettier-java package)

Road map to Alpha

  • Parser Package:

    • POC: optimized backtracking to handle Java Grammar non LL(k) nature.
    • Milestone 1 - Success parsing "Java Design Patterns" repo.
    • Milestone 2 - Success parsing "spring-boot" repo.
    • Investigate performance optimizations.
    • Release Alpha version to npm. - https://www.npmjs.com/package/java-parser
  • prettier-java package

    • POC: Prettier "Re-writer" based on a Chevrotain CST instead of an AST.
    • Milestone 1 - Success cyclic rewriting "Java Design Patterns" repo.
    • Milestone 2 - Success parsing "spring-boot" repo.

Contributing

Contributions are very welcome. See the contribution guide to get started. And the Help Wanted issues.

Credits

Special thanks to @thorbenvh8 for creating the original prettier-java plugin and the associated Java Parser implemented in JavaScript.

About

Prettier Java Plugin

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.7%
  • Other 0.3%