marlonfan / coc-phpls

🐭 php language server for coc.nvim
MIT License
212 stars 16 forks source link

Enums support #114

Closed BrayanCaro closed 1 year ago

BrayanCaro commented 1 year ago

Describe the bug A simple enum definition throws:

foo.php:3 [intelephense 1001] Error Unexpected 'Name'. Expected ';'.
foo.php:4 [intelephense 1001] Error Unexpected 'case'.

To Reproduce Create a file foo.php with:

<?php

enum Status
{
    case DRAFT;
    case PUBLISHED;
    case ARCHIVED;
}

Expected behavior No errors excepted.

Screenshots image

Desktop

axmad386 commented 1 year ago

any workaround for this? may be just how to suspress the errors warning

tateren commented 1 year ago

In coc-settings.json you can set "intelephense.environment.phpVersion": "8.1.0" (or later). default is 7.4.0

BrayanCaro commented 1 year ago

That solves the issue, thank you so much!