felixfbecker / php-language-server

PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
ISC License
1.15k stars 186 forks source link

LanguageServer script failing #795

Open phatwhalemedia opened 3 years ago

phatwhalemedia commented 3 years ago

Guys/ladies, I'm having some trouble getting composer/language-server setup in Ubuntu Linux. This is the latest error in my quest to finish this apparently insurmountably difficult task. Granted I'm new to composer, so this is all still a bit confusing.

After running

composer run-script --working-dir=vendor/felixfbecker/language-server parse-stubs

The script fails on line

Parsing file:///home/phatwhalemedia/.config/composer/vendor/jetbrains/phpstorm-stubs/http/http.php

Giving this error

Script LanguageServer\ComposerScripts::parseStubs handling the parse-stubs event terminated with an exception

  [RuntimeException]                         
  A type is missing before a type separator

If there's any further info required, please let me know.

I've been following the steps from the following link:

611

pfernandez commented 3 years ago

Same. My "workaround" was to simply remove ~/.config/composer/vendor/jetbrains/phpstorm-stubs/http/http.php for the time being.

3ynm commented 3 years ago

same err here :-1:

apfelchips commented 3 years ago

You can use the bundled language server from the vscode extension https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-intellisense --> download extension --> rename to .zip --> /extension/vendor/felixfbecker/language-server/bin

AJenbo commented 3 years ago

Also fails on vendor/jetbrains/phpstorm-stubs/standard/standard_8.php

CodyWilson commented 3 years ago

I submitted a simple pull request to fix this.

The simple solution until that's merged is to setup your composer.json like so:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/CodyWilson/php-language-server"
        }
    ],
    "require": {
        "felixfbecker/language-server": "dev-master"
    }
}

Alternatively you could fork it yourself and do that change, and set the version control to point to your fork.

Mte90 commented 3 years ago

@felixfbecker any updates for this project?