Skip to content

Issue with generating new class, interface, enum; pattern matching for /java #11

@Jucaza1

Description

@Jucaza1

Given my project path: ~/dev/java/project-1/.../java/com/...
The feature that creates interface, enum, classes, fails on finding my java/ folder inside the project, I fixed it by changing the path on my system to : ~/dev/_java/project-1/.../java/com/...
Note that any parent folder begining with /java ,as for example ~/dev/java-something , will collide with this functionality, finding the wrong folder to create the package structure and thus creating a new structure like ~/dev/java/com/.../your_new_class.java

The issue might be here on this function , maybe the path_pattern would be the key, or doing the match from right to left instead.
generateclass.lua

local function generate_class()
    local file_path = vim.fn.fnamemodify(start_buf, ':p')
    local path_pattern = "(.-)/java"
...

Thanks for all the work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions