Skip to content

andreluisos/nvim-javagenie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Genie

Bringing joy to Java programming on Neovim

Lua Python Neovim

Nvim's Java-Genie

Introduction

nvim-javagenie is a Neovim plugin that streamlines Java Persistence API (JPA) development, offering powerful commands and interactive UI components for generating entities, attributes, and relationships directly within Java files, among other functionalities.

The plugin mainly aims to replicate the advanced functionalities of modern JPA development tools, bringing those capabilities seamlessly to Neovim. This effort seeks to attract Java developers back to Neovim by enabling an efficient and integrated workflow for JPA-centric tasks. It is a part of a series of plugins I'm working on, related to Java and Spring development.

nvim-javagenie utilizes a standalone Tree-sitter instance provided by Python in a virtual environment, rather than relying on Neovim’s built-in Tree-sitter support. This standalone setup allows precise control over syntax tree parsing and customization, enabling the plugin to execute advanced Tree-sitter queries and modifications unique to JPA code. By directly identifying and manipulating Java elements like annotations, relationships, and specific JPA patterns, nvim-javagenie ensures accurate and efficient handling of code without interference from Neovim’s default Tree-sitter configuration.

It is still under development.

I'll be slowly developing it. Feel free to contribute.

Dependencies

The plugin depends on three Python libraries, which are installed in a virtual environment (venv):

  • pynvim
  • tree-sitter
  • tree-sitter-java

For the TUI, it relies on nui-components.nvim, which also depends on nui.nvim.

jdtls should be properly configured on Neovim.

Installation

Lazy

{ 'andreluisos/nvim-javagenie',
  dependencies = {
    'grapp-dev/nui-components.nvim',
    'MunifTanjim/nui.nvim',
  }
}

Packer

use {
  'andreluisos/nvim-javagenie',
  requires = {
    { 'grapp-dev/nui-components.nvim' },
    { 'MunifTanjim/nui.nvim' },
  }
}

TODO

Among with bug fixing, I also plan to:

  • Create DTO for an entity (WIP)
  • Implement UI for JPA repository creation
  • Create Java files (enum, interface, annotation, class, record) - #f6ba974
  • Implement Spring Initializr and project creation/loading interfaces WIP
  • Runner for Java applications - #053b0d3
  • Figure out a way to create tests
  • Implement Entity attribute/relationship editing
  • Port to Java?

Request new features in the Issues tab and I will check it out.

Please, also report bugs in the Issues tab. It's important.

Features Overview

The plugin includes a range of features, each powered by dedicated Tree-sitter queries, to streamline common JPA tasks. These functionalities are aimed at giving Java developers a robust development experience within Neovim:

Create a JPA Entity

JPA Entity creation

Easily add Entity attributes

  • ID attributes
  • Basic type attributes
  • Enum type attributes

Entity ID attribute creation Entity basic attribute creation Entity enum attribute creation

Quickly create Entity relationships

  • Many-to-one relationships
  • One-to-one relationships
  • Many-to-one relationships with automatic equals() and hashCode() method generation

Entity ID attribute creation Entity basic attribute creation Entity enum attribute creation

About

Brings JPABuddy's functionalities to Neovim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published