haringsrob / laravel-dev-tools

Developer tools for easier Laravel development (Blade lsp)
Apache License 2.0
84 stars 5 forks source link

Couldn't start client Laravel blade lsp #4

Closed furopi closed 1 year ago

furopi commented 1 year ago

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

haringsrob commented 1 year ago

Hey @furopi,

I have not really used this with vscode lately. The code may be out of date and need to be build from scratch in order to work.

haringsrob commented 1 year ago

Most likely this will be an issue with a laravel version mismatch.

furopi commented 1 year ago

To me it looks like Windows doesn't know how to execute the binary file "laravel-dev-tools" in the extension. How can I tell windows to execute this file with the php interpreter or any file beginning with "#!/usr/bin/env php"?

Thank you! 🙃

haringsrob commented 1 year ago

Oof, good question, I honestly do not know :). Have you considered using docker WSL using vscode remote?

haringsrob commented 1 year ago

Closing this for now, I feel vscode remote is the way to go until I somehow make an executable for windows (if ever). This is a non goal at this stage of the project.

furopi commented 1 year ago

@haringsrob You actually don't need to compile a new version, you just have to execute the file with the PHP interpreter. And maybe add a settings option to specifiy the PHP executable path for systems where it is not included in the path variable.

It's kind of sad that there is no Windows support, what should be an easy fix :_(

And no, WSL is cool and so on, but it's not an option for me as it messes up my entire setup. Also it's much slower to access native Windows filesystem via WSL, and that's where all my projects are stored... Sorry

haringsrob commented 1 year ago

Hey @furopi I am open to a PR if you have an idea on how to add support.

furopi commented 1 year ago

Well I'm not familiar with you code, @haringsrob , neither with github PR's but what you need to change is executing the devtools binary with "php laravel-dev-tools" instead of "./laravel-dev-tools" when running on Windows. At least from what I have tested the devtools binary runs fine than...

Hope I could help here in a little way!

furopi commented 1 year ago

As far as I can see it's the line 12 in the extension.ts which reads like: const cmd = context.asAbsolutePath('laravel-dev-tools') as any; should be like

let cmd = context.asAbsolutePath('laravel-dev-tools') as any;
if(windows) {
     cmd = "php " + cmd;
}