Giter Site home page Giter Site logo

laravel-dev-tools's People

Contributors

haringsrob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

titonova

laravel-dev-tools's Issues

Add support for composer packages

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

Couldn't start client Laravel blade lsp

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

I dont even know how to title this issue

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({})

I got this error:
image

So i went straight to folder and tried running from the cli and i get this error:
image

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

How to install for Neovim???

Hi,

you write 'download the compiled version from releases`. Which of them exactly:
Screenshot 2023-06-20 at 23 13 43

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" },

Docker support

Is there any config to make It work with docker? Like point PHP path.

php artisan make:component abc
image

neovim setup

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?

Livewire styles and scripts not found

First, thanks for this amazing project

Many components are not showing for me, like the livewire or other directives. I believe will be really useful to have an ability to ignore patterns
image

Help with LSP JSON-RPC Response..

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:

  1. As per your guide, I added your repo as a submodule
  2. Generated the executable using the ./laravel-dev-tools app:build and copied into the extension root.
  • I also tired to copy the executable that is already in the builds/ folder of your repo inside my extension.
  1. Then I hooked up the Nova 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 👇

1. Error Messages

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))

2. Nova's Request to the LSP

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"
    }
  }
}

3. Laravel-dev-tools Response

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
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.