haringsrob / laravel-dev-tools Goto Github PK
View Code? Open in Web Editor NEWDeveloper tools for easier Laravel development (Blade lsp)
License: Apache License 2.0
Developer tools for easier Laravel development (Blade lsp)
License: Apache License 2.0
The current Laravel Language Server Protocol (LSP) lacks support for Composer packages in Laravel. As a result, the tool isn't as useful as it could be, especially for projects utilizing Composer packages extensively.
Feature Request:
I suggest adding support for Composer packages in the Laravel LSP. This enhancement would greatly benefit developers who rely on external packages in their Laravel projects. With Composer being a fundamental tool in the Laravel ecosystem, having LSP support for Composer packages would enhance the overall development experience.
exemple composer package mainly for theme / basic components but not limited only for this.
https://github.com/jeroennoten/Laravel-AdminLTE
I get the following error:
[Error - 12:51:21 PM] Starting client failed
Launching server using command c:\DevTools\code-insiders\data\extensions\haringsbe-haringsrob.laravel-blade-livewire-lsp-1.2.1\laravel-dev-tools failed.
Am I missing something or am I doing something wrong in the setup?
Thank you very much!
Kind regards,
Florian
Instead of generating with ide-helper. Why not use the :
php artisan model:show
This is my init.lua configuration:
local lsp_zero = require("lsp-zero")
local lsp_configurations = require("lspconfig.configs")
if not lsp_configurations.blade then
lsp_configurations.blade = {
default_config = {
name = "blade",
cmd = { "~/.local/share/nvim/laravel-dev-tools", "lsp" },
filetypes = { "blade" },
root_dir = require("lspconfig.util").root_pattern("composer.json"),
},
}
end
require("lspconfig").blade.setup({})
So i went straight to folder and tried running from the cli and i get this error:
i can not understand the error, so i cant title this issue properly, but as the creator you might get it, i hope. so pls check this out.
author of #9 also suffered from this impaired documentation ig. so better documentation would be greatly appreciated
Hi,
you write 'download the compiled version from releases`. Which of them exactly:
Where I have to place it / what I have to do with it?
What is with the 'path to the executable'? The place where the compile file lives???
default_config = {
-- Path to the executable: laravel-dev-generators
cmd = { "laravel-dev-generators", "lsp" },
Hi. I am trying to follow your neovim setup recommendation, however I am struggling a bit to make the setup work. This is how I do it using lsp-zero
:
local lsp_config = require("lspconfig.configs")
if not lsp_config.laravel_ls then
lsp_config.laravel_ls = {
default_config = {
name = "laravel_ls",
cmd = { vim.fn.expand("$HOME/.local/share/nvim/laravel/laravel-dev-tools"), "lsp", "-vvv" },
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)
-- prefer cwd if root is a descendant
return util.path.is_descendant(cwd, root) and cwd or root
end,
},
}
end
local lsp_zero = require("lsp-zero")
require("lspconfig").laravel_ls.setup({
capabilities = lsp_zero.get_capabilities(),
})
lsp_zero.default_setup("laravel_ls")
I am able to start the lsp (i.e., I can see it by running :LspInfo), however I am getting no LSP completions. Is this lsp dependent on any other piece of particular setup?
Hello @haringsrob.
I am very keen to try your LSP however I hit some roadblocks. I was wondering if you could help. I should also mention I am not an expert in LSP by any means. I am just trying to port this LSP into Nova by following the documentations 😊
I am writing an extension for the Nova editor. Please checkout the branch named LSP
if you need to.
You can check out the documentation by Nova about their language-client. Here is a summary of installation:
./laravel-dev-tools app:build
and copied into the extension root.builds/
folder of your repo inside my extension.LanguageClient
to your executable via stdio
Based on the docs on Nova and your repo that should be it. In fact it seemed to have worked fine in sublime, neovim and vsCode looking at the other issues. But I get errors in return for some reason.
Once I initiate the LSP I get the following error in debug mode:
To summerise Nova is moaning about the hoverProvider
not having Expected Bool or HoverOptions
as the value because the value is Phpactor\\LanguageServerProtocol\\HoverClientCapabilities
, see below 👇
Example Language Server[22:26:46.707000] The data couldn’t be read because it isn’t in the correct format.
Example Language Server[22:26:46.707000] Example Language Server connection closed unexpectedly: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "result", intValue: nil), CodingKeys(stringValue: "capabilities", intValue: nil), CodingKeys(stringValue: "hoverProvider", intValue: nil)], debugDescription: "Expected Bool or HoverOptions", underlyingError: nil))
Example Language Server[22:26:46.112000] Sending JSON-RPC request: number(0) initialize
{
"jsonrpc" : "2.0",
"id" : 0,
"method" : "initialize",
"params" : {
"locale" : "en_GB",
"capabilities" : {
"window" : {
"showMessage" : {
"messageActionItem" : {
"additionalPropertiesSupport" : true
}
},
"showDocument" : {
"support" : true
}
},
"workspace" : {
"configuration" : true,
"applyEdit" : true,
"didChangeConfiguration" : {
"dynamicRegistration" : true
},
"executeCommand" : {
},
"workspaceFolders" : true,
"workspaceEdit" : {
"failureHandling" : "undo",
"documentChanges" : true,
"resourceOperations" : [
"create",
"rename",
"delete"
]
}
},
"textDocument" : {
"codeAction" : {
"resolveSupport" : {
"properties" : [
"edit"
]
},
"codeActionLiteralSupport" : {
"codeActionKind" : {
"valueSet" : [
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports",
"source.fixAll"
]
}
},
"isPreferredSupport" : true
},
"hover" : {
"contentFormat" : [
"markdown",
"plaintext"
]
},
"completion" : {
"completionItem" : {
"resolveSupport" : {
"properties" : [
"documentation",
"insertText",
"insertTextFormat",
"insertTextMode",
"textEdit",
"textEditText",
"additionalTextEdits",
"commitCharacters",
"command"
]
},
"snippetSupport" : true,
"documentationFormat" : [
"markdown",
"plaintext"
],
"tagSupport" : {
"valueSet" : [
1
]
},
"insertReplaceSupport" : true,
"deprecatedSupport" : true,
"commitCharactersSupport" : true
},
"completionItemKind" : {
"valueSet" : [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
},
"contextSupport" : true
},
"documentHighlight" : {
},
"codeLens" : {
},
"synchronization" : {
"didSave" : true,
"willSave" : true,
"willSaveWaitUntil" : true
},
"publishDiagnostics" : {
"tagSupport" : {
"valueSet" : [
1,
2
]
},
"versionSupport" : true,
"relatedInformation" : true
},
"declaration" : {
"linkSupport" : true
},
"typeDefinition" : {
"linkSupport" : true
},
"definition" : {
"linkSupport" : true
},
"implementation" : {
"linkSupport" : true
},
"signatureHelp" : {
"signatureInformation" : {
"documentationFormat" : [
"markdown",
"plaintext"
]
}
}
}
},
"processId" : 2416,
"rootPath" : "\/Users\/Emran\/Developer\/nova-extension\/Laravel-Suit",
"workspaceFolders" : [
{
"uri" : "file:\/\/\/Users\/Emran\/Developer\/nova-extension\/Laravel-Suit\/",
"name" : "Laravel Suite"
}
],
"rootUri" : "file:\/\/\/Users\/Emran\/Developer\/nova-extension\/Laravel-Suit\/",
"clientInfo" : {
"name" : "Nova",
"version" : "534827"
}
}
}
Example Language Server[22:26:46.707000] Received JSON-RPC response: number(0) initialize
{
"jsonrpc" : "2.0",
"result" : {
"serverInfo" : {
"version" : 1
},
"capabilities" : {
"executeCommandProvider" : {
"commands" : [
"create_component",
"create_livewire_component"
]
},
"completionProvider" : {
"triggerCharacters" : [
"<",
":",
"@"
]
},
"hoverProvider" : "Phpactor\\LanguageServerProtocol\\HoverClientCapabilities",
"definitionProvider" : "Phpactor\\LanguageServerProtocol\\DefinitionClientCapabilities",
"documentSymbolProvider" : "Phpactor\\LanguageServerProtocol\\DocumentSymbolClientCapabilities",
"codeActionProvider" : {
"codeActionKinds" : [
"quickfix"
]
},
"textDocumentSync" : 1
}
},
"id" : 0
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.