astrocommunity icon indicating copy to clipboard operation
astrocommunity copied to clipboard

Laravel ls

Open aliresool621 opened this issue 11 months ago • 13 comments

Is your feature related to a problem?

No response

Describe the new feature

Could be used with the laravel pack, idk

Additional context

https://github.com/laravel-ls/laravel-ls

https://www.reddit.com/r/neovim/comments/1hpmsih/php_laravel_announcing_laravells_an_language/

aliresool621 avatar Jan 04 '25 04:01 aliresool621

It is not complete or 100% stable ... Author words

aliresool621 avatar Jan 04 '25 04:01 aliresool621

Having a quick look it looks promising but still missing a lot

ALameLlama avatar Jan 04 '25 04:01 ALameLlama

Yeah, just wanted to share my finding with you all

aliresool621 avatar Jan 04 '25 05:01 aliresool621

Definitely keen on getting better laravel support in nvim, unfortunately, I still need to use PHPStorm just because of the QoL support it has.

https://github.com/ccaglak had a laravel LSP going at some point too but I believe they've private the repo for now

ALameLlama avatar Jan 04 '25 05:01 ALameLlama

This LSP too alpha at this point. Gonna hold off..

Uzaaft avatar Jan 04 '25 09:01 Uzaaft

Related: https://github.com/mason-org/mason-registry/pull/10110

azdanov avatar Jun 02 '25 04:06 azdanov

Is it better use this https://github.com/adibhanna/laravel.nvim

jeeeem avatar Jul 03 '25 05:07 jeeeem

@jeeeem This looks fantastic, if I get some time I'll try and test this plugin and we can update the laravel pack https://github.com/AstroNvim/astrocommunity/tree/main/lua/astrocommunity/pack/laravel

Having a quick look, seems like we can replace "adalessa/laravel.nvim", "Bleksak/laravel-ide-helper.nvim" and "ricardoramirezr/blade-nav.nvim"

ALameLlama avatar Jul 03 '25 06:07 ALameLlama

@jeeeem This looks fantastic, if I get some time I'll try and test this plugin and we can update the laravel pack main/lua/astrocommunity/pack/laravel

Having a quick look, seems like we can replace "adalessa/laravel.nvim", "Bleksak/laravel-ide-helper.nvim" and "ricardoramirezr/blade-nav.nvim"

Yes please that would be very helpful. Thanks

jeeeem avatar Jul 03 '25 08:07 jeeeem

We should perhaps hold off for a bit. That plugin is 3 weeks old, adding it to a pack could be unstable.

Uzaaft avatar Jul 03 '25 08:07 Uzaaft

We should perhaps hold off for a bit. That plugin is 3 weeks old, adding it to a pack could be unstable.

That's understandable, for the meantime I will use it on my config.

jeeeem avatar Jul 03 '25 08:07 jeeeem

Adding it in as a plugin in the meantime would be a good first step.

Uzaaft avatar Jul 03 '25 08:07 Uzaaft

For referance this is what I currently have set as my laravel plugin. laravel.nvim creates a bunch of it's own mappings under L automatically

I'm sure the making and the lazy load command will need some cleaning up. I haven't used to a bunch tho.

return {
	{ import = "astrocommunity.pack.php" },
	{ import = "astrocommunity.pack.html-css" },
	{ import = "astrocommunity.pack.blade" },
	{
		"adibhanna/laravel.nvim",
		event = { "VeryLazy" },
		cmd = {
			"Artisan",
			"Composer",
			"Sail",
			"LaravelMake",
			"LaravelRoutes",
			"LaravelGoto",
		},
		dependencies = {
			"MunifTanjim/nui.nvim",
			"nvim-lua/plenary.nvim",
			{
				"AstroNvim/astrocore",
				---@param opts AstroCoreOpts
				opts = function(_, opts)
					local maps = assert(opts.mappings)
					local prefix = "<Leader>L"
					maps.n[prefix] = { desc = require("astroui").get_icon("Laravel", 1, true) .. "Laravel" }
					maps.n[prefix .. "D"] = { desc = require("astroui").get_icon("Dump", 1, true) .. "Dump Menu" }
				end,
			},
			{ "AstroNvim/astroui", opts = { icons = { Laravel = "󰫐", Dump = "" } } },
		},
		specs = {
			{
				"Saghen/blink.cmp",
				optional = true,
				opts = {
					sources = {
						default = { "laravel", "lsp", "path", "snippets", "buffer" },
						providers = {
							laravel = {
								name = "laravel",
								module = "laravel.blink_source",
							},
						},
					},
				},
			},
			{
				"hrsh7th/nvim-cmp",
				optional = true,
				opts = {
					sources = { { name = "laravel", priority = 750 } },
				},
			},
		},
		opts = {
			notifications = false,
		},
	},
}

ALameLlama avatar Jul 04 '25 05:07 ALameLlama