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

feat(pack): add laravel.nvim #1108

Merged
merged 7 commits into from
Jul 22, 2024
Merged

Conversation

ALameLlama
Copy link
Contributor

@ALameLlama ALameLlama commented Jul 13, 2024

Closes #1103

📑 Description

Add support for laravel.nvim with some mappings

ℹ Additional Information

Copy link

github-actions bot commented Jul 13, 2024

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).

  • Proper usage of opts table rather than setting things up with the config function.

  • Proper usage of specs table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).

@ALameLlama ALameLlama changed the title Laravel O Laravel Pack Jul 13, 2024
@ALameLlama ALameLlama changed the title Laravel Pack feat(pack): laravel Jul 13, 2024
@ALameLlama ALameLlama changed the title feat(pack): laravel feat(pack): add laravel.nvim Jul 13, 2024
@mehalter
Copy link
Member

Just heads up, I updated the body of the PR to correctly link issues it closes

@ALameLlama
Copy link
Contributor Author

My bad, I also added a last minute change noting the blade syntax highlighting

@ALameLlama
Copy link
Contributor Author

The more i play around with this, I am noticing missing feature from other IDE's but there are plugins to bring them back.

I'm gonna put this into draft so i can try and create a better out of the box experience for everyone

@Uzaaft
Copy link
Member

Uzaaft commented Jul 15, 2024

@ALameLlama Feel free to ping me if you want a sparring partner.

@ALameLlama
Copy link
Contributor Author

ALameLlama commented Jul 16, 2024

@Uzaaft That would be awesome, I've added https://github.com/Bleksak/laravel-ide-helper.nvim which is working great and I've tried to add https://github.com/RicardoRamirezR/blade-nav.nvim but I'm getting some error and i think some of these are pebcak

  {
    "ricardoramirezr/blade-nav.nvim",
    dependencies = {
      "hrsh7th/nvim-cmp",
    },
    ft = { "blade", "php" },
  },

route cmp is dying https://github.com/RicardoRamirezR/blade-nav.nvim/blob/main/lua/blade-nav/utils.lua#L96 but other plugins are working https://github.com/Bleksak/laravel-ide-helper.nvim/blob/main/lua/laravel-ide-helper/helpers.lua#L15, Imma keep playing around with this since this might be a plugin issue

using the goto file seems to blow up

Using gf on a view

E5108: Error executing lua: ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:64: attempt to perform arithmetic on local 'start_pos' (a nil value)
stack traceback:
        ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:64: in function 'find_name'
        ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:205: in function 'get_component_and_prefix'
        ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:262: in function 'gf'
        ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:344: in function <...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:342>

using gf on a route

E5108: Error executing lua: ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:270: module 'gf_routes' not found:
        no field package.preload['gf_routes']
cache_loader: module gf_routes not found
cache_loader_lib: module gf_routes not found
        no file './gf_routes.lua'
        no file '/home/vagrant/neovim/.deps/usr/share/luajit-2.1/gf_routes.lua'
        no file '/usr/local/share/lua/5.1/gf_routes.lua'
        no file '/usr/local/share/lua/5.1/gf_routes/init.lua'
        no file '/home/vagrant/neovim/.deps/usr/share/lua/5.1/gf_routes.lua'
        no file '/home/vagrant/neovim/.deps/usr/share/lua/5.1/gf_routes/init.lua'
        no file '/home/vagrant/.local/share/nvim/lazy-rocks/telescope.nvim/share/lua/5.1/gf_routes.lua'
        no file '/home/vagrant/.local/share/nvim/lazy-rocks/telescope.nvim/share/lua/5.1/gf_routes/init.lua'
        no file './gf_routes.so'
        no file '/usr/local/lib/lua/5.1/gf_routes.so'
        no file '/home/vagrant/neovim/.deps/usr/lib/lua/5.1/gf_routes.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file '/home/vagrant/.local/share/nvim/lazy-rocks/telescope.nvim/lib/lua/5.1/gf_routes.so'
stack traceback:
        [C]: in function 'require'
        ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:270: in function 'gf'
        ...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:344: in function <...ocal/share/nvim/lazy/blade-nav.nvim/lua/blade-nav/gf.lua:342>

I'll keep trying to resolve these myself, In an ideal world we could recreate https://laravel-idea.com/ within nvim 😅

edit: I've opened a PR to fix the route:list dying
edit 2: I've created a PR to fix the require issue with the plugin.

@ALameLlama
Copy link
Contributor Author

Those PR's have been merged, I'll keep playing around with things to see how if I spot anything else

@ALameLlama
Copy link
Contributor Author

Looking into some test plugins for phpunit/pest and then I'll move this pr out of draft.

That should cover enough to give a good experience for laravel devs

@mehalter
Copy link
Member

Truly amazing attention to detail and work here. Thanks so much! Very much looking forward to getting this added in :)

@ALameLlama ALameLlama marked this pull request as ready for review July 19, 2024 12:55
Copy link
Member

@mehalter mehalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mehalter mehalter merged commit 110e758 into AstroNvim:main Jul 22, 2024
14 checks passed
@MrMic
Copy link
Contributor

MrMic commented Jul 22, 2024

It is buggy!!!
Even when I add laravel pack to repro.lua: "No specs found for astrocommunity.pack.laravel"
Damn...

@mehalter
Copy link
Member

Cannot replicate @MrMic . Please take the extra time to really figure out what is happening with your local setup. My guess is you just have an old version of AstroCommunity

@Uzaaft
Copy link
Member

Uzaaft commented Jul 22, 2024

Amazing work @ALameLlama, really appreciate it!

@MrMic
Copy link
Contributor

MrMic commented Jul 23, 2024

Reinstall all and still got this error:

[null-ls] failed to run generator: ...share/AstroNvim4/lazy/laravel.nvim/lua/laravel/paths.lua:25: attempt to index local 'path' (a nil value)

laravel-dev-generators and laravel-dev-tools are in my path. 🤔

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

Successfully merging this pull request may close these issues.

Add Laravel.nvim support
4 participants