You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a configuration for the official Laravel language server
enable PHP and Blade files
start the server only when an artisan project root is found
Motivation
Laravel maintains a separate language server at laravel/lsp. The existing laravel_ls configuration targets the unrelated laravel-ls/laravel-ls project, so users of the official server currently need to define a custom Neovim configuration.
Impact
Users can enable the official server with:
vim.lsp.enable('laravel_lsp')
Non-Laravel PHP projects are unaffected because the configuration requires an artisan root marker.
Validation
stylua --check lsp/laravel_lsp.lua
headless Neovim config loading and root callback assertions
bash .github/ci/lint.sh origin/master HEAD
git diff --check
The full Vusted and EmmyLua checks were not run because vusted and emmylua_check are not installed locally.
The existing laravel_ls configuration targets the unrelated laravel-ls/laravel-ls project, so users of the official server currently need to define a custom Neovim configuration.
Well this is confusing. How are users supposed to know which one to choose? They both look similar.
Is laravel-ls/laravel-ls still relevant, what are the tradeoffs?
The existing laravel_ls configuration targets the unrelated laravel-ls/laravel-ls project, so users of the official server currently need to define a custom Neovim configuration.
Well this is confusing. How are users supposed to know which one to choose? They both look similar.
Is laravel-ls/laravel-ls still relevant, what are the tradeoffs?
I don't know about laravel-ls/laravel-ls but 'Laravel/lsp' is provided by the laravel team
@justinmk I looked into both implementations more closely.
[laravel/lsp](https://github.com/laravel/lsp)
is the official Laravel-maintained server. It is PHP-based, installed through
Composer as laravel-lsp, and currently covers a broader Laravel surface:
Blade components, translations, middleware, Livewire, Inertia, authorization,
validation, Eloquent, and multiple PHP environments such as Sail, Herd, Valet,
DDEV, and Lando.
[laravel-ls/laravel-ls](https://github.com/laravel-ls/laravel-ls)
is an independent Go implementation exposed as laravel-ls. It is still
maintained and not deprecated or archived. It supports the core routes, views,
config, environment, bindings, and assets features, with some distinct
functionality such as route-action inlay hints and code actions for creating
missing resources. It also offers standalone binaries and existing Mason
support.
Therefore, I don’t think the existing configuration should be replaced. laravel_lsp should be the recommended choice for most users, while laravel_ls remains available for users who prefer the community Go
implementation or depend on its specific features.
I can also update both configuration descriptions to cross-reference each other:
laravel_lsp: official Laravel-maintained language server
laravel_ls: community Go language server; see laravel_lsp for the official
implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
artisanproject root is foundMotivation
Laravel maintains a separate language server at
laravel/lsp. The existinglaravel_lsconfiguration targets the unrelatedlaravel-ls/laravel-lsproject, so users of the official server currently need to define a custom Neovim configuration.Impact
Users can enable the official server with:
Non-Laravel PHP projects are unaffected because the configuration requires an
artisanroot marker.Validation
stylua --check lsp/laravel_lsp.luabash .github/ci/lint.sh origin/master HEADgit diff --checkThe full Vusted and EmmyLua checks were not run because
vustedandemmylua_checkare not installed locally.