Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jucaza1 opened this issue Nov 22, 2024 · 0 comments

Comments

@Jucaza1
Copy link

Jucaza1 commented Nov 22, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant