Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.98 KB

README.md

File metadata and controls

53 lines (36 loc) · 1.98 KB

🚧 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.