Comments (5)
I got it working after cloning the project and build it. The path for cmd is pointed to the compiled binary.
from laravel-dev-tools.
i cant compile!
you need to "composer install" first to install dependencies and autoloader
from laravel-dev-tools.
i cant compile!
from laravel-dev-tools.
Just to be clear this lsp provides autocomplete just for components (at least in my case), if you expect something like coo-blade, i dont think this is capable of that.
Please correct me if im wrong
from laravel-dev-tools.
What it is capable of is in the readme. It provides some diagnostics and the ability to jump to components as well as other things.
Your config looks correct. I stole how you handled determining the root directory so here is mine for reference in case you need it. You can replace/ignore all the lines with "lvim" specific stuff.
local configs = require("lspconfig.configs")
configs.blade = {
default_config = {
name = "blade",
cmd = { "/home/bdinh/.local/bin/laravel-dev-tools/laravel-dev-tools", "lsp" },
filetypes = { 'blade' },
root_dir = function(pattern)
local util = require("lspconfig.util")
local cwd = vim.loop.cwd()
local root = util.root_pattern("composer.json", ".git", ".phpactor.json", ".phpactor.yml")(pattern)
return util.path.is_descendant(cwd, root) and cwd or root -- prefer cwd if root is a descendant
end,
settings = {},
},
}
local lsp_zero = require("lsp-zero")
require("lspconfig").blade.setup({
on_attach = require("lvim.lsp").common_on_attach,
on_init = require("lvim.lsp").common_on_init,
on_exit = require("lvim.lsp").common_on_exit,
-- capabilities = require("lvim.lsp").common_capabilities(),
capabilities = lsp_zero.get_capabilities(),
})
lsp_zero.default_setup("blade")
I was running into a weird issue with getting the autocomplete to work as well though but after setting some breakpoints in I found out it was because I was naming a livewire component file "Index.php" which the livewire componentregistry will ignore as part of the class name when you call "classToName" for some reason.
You can test this out yourself by just creating a livewire component like "App\Livewire\Test\Index.php" or something. I fixed this by just renaming my file to "Page.php".
@haringsrob
"nameToClass" is invoked here in "app/helpers/SubCommands/Snippets.php"
And because only the "Index" portion is cut off, the "class_exists" doesn't throw so when you hit the line to create a new reflection class object an exception is thrown.
Adding another try catch could fix this but at the same time I think just telling people not to name their livewire components index is fine. This was honestly such a marginal edge case.
from laravel-dev-tools.
Related Issues (15)
- Livewire styles and scripts not found HOT 1
- How do it works? HOT 3
- Couldn't start client Laravel blade lsp HOT 9
- Filament components are not picked up by the parser. HOT 1
- Model extractor does not support enum migrations
- Auto build release on commit
- Laravel new command HOT 1
- How to install for Neovim??? HOT 5
- Help with LSP JSON-RPC Response.. HOT 4
- Docker support
- Add support for composer packages
- I dont even know how to title this issue HOT 1
- Nested properties not being found. HOT 1
- Where is "laravel-dev-generators"? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-dev-tools.