eclipse-pdt / pdt

PHP Development Tools project (PDT)
https://eclipse.org/pdt
Eclipse Public License 2.0
189 stars 46 forks source link

Base PHP8.0 support #148

Closed zulus closed 1 year ago

zulus commented 1 year ago

Umbrella issue for PHP8.0 implementation

zulus commented 1 year ago

Parsers for all current PHP8.* versions are done

stanolacko commented 1 year ago

Amazing!

Dňa st 3. 5. 2023, 19:58 Dawid Pakuła @.***> napísal(a):

Parsers for all current PHP8.* versions are done

— Reply to this email directly, view it on GitHub https://github.com/eclipse/pdt/issues/148#issuecomment-1533477818, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOSNOBMTKOCSBE37MT2UCTXEKME7ANCNFSM6AAAAAAXD5OZ5U . You are receiving this because you are subscribed to this thread.Message ID: @.***>

zulus commented 1 year ago

Current dev build should be in general usable in daily work for all PHP8.* versions:

  1. Syntax highlight and validation
  2. Basic error reporting (except missing new built-in classes)
  3. Code formatter will not destroy code
  4. Basic CA work correctly
pounard commented 1 year ago

@zulus I can confirm, it's usable. There's a few missing stuff, I'm writing those I could spot here, in case you'd miss something:

I know it's unfinished work yet, but I'm just writing those so they don't get forgotten into the oblivion. Probably some of those would belong to another issues (especially the styling parts).

It's mostly a huge win, I'm so happy it works even if it lacks a few details ! I at least don't experience red errors everywhere anymore, and autocompletion is finally working for PHP 8 code, yay \o/

zulus commented 1 year ago

@zulus I can confirm, it's usable. There's a few missing stuff, I'm writing those I could spot here, in case you'd miss something:

* you can't CTRL+click over an attribute and go to its definition, EDIT: actually you can, when there is no parenthesis (eg. `#[Foo]` works, `#[Foo()]` does not,

* you can't CTRL+click on a named parameter and go to its definition,

* attributes are styled like constants, they don't have their own styling entry in editor style preferences,

They should be styled as classes right now, hmm

* to go further in that topic, the editor style preferences is missing all PHP 8 niceness (match expressions, attributes, named parameters, etc...) 

this one should be available in recent build. there are formatter setttings for:

  1. Attribute group (attributes are styled as constructro calls)
  2. Match expression
  3. Named expresion
  4. Enum declaration / enum case

    • code style preferences is missing all that stuff too.

I know it's unfinished work yet, but I'm just writing those so they don't get forgotten into the oblivion. Probably some of those would belong to another issues (especially the styling parts).

It's mostly a huge win, I'm so happy it works even if it lacks a few details ! I at least don't experience red errors everywhere anymore, and autocompletion is finally working for PHP 8 code, yay \o/ :D

pounard commented 1 year ago

I'll try an update tomorow, build I installed is dated at may, 7th if I remember correctly. Attributes when followed by parenthesis seem to be styled like functions (in my setup) maybe that's the symbol navigation problem root cause ?

pounard commented 1 year ago

I can confirm that I was using the latest build available on the update site.

zulus commented 1 year ago

I can confirm that I was using the latest build available on the update site.

I forgot that not everything was committed due some problems :P

Recent patch fixes highlighting inside attributes. It also introduce base CA for attribute instantiation (same as for "new |") and selection/navigation/hover support for attributes.

Later I'll probably use similar colors as in Java Annotations

pounard commented 1 year ago

Thanks, I can't wait to use next build !

EDIT: Oups:

HTTP Server 'Bad Gateway' : https://download.eclipse.org/tools/pdt/updates/latest-nightly/compositeContent.xml
HttpComponents connection error response code 502.
zulus commented 1 year ago

should be fine now, morning problems on foundation side ;)

zulus commented 1 year ago

New highlighters has been introduced, together with CA for named parameters ;) Last step is LanguageLibrary and probably more tests.

After that other things can be done via separate tasks.

zulus commented 1 year ago

Looks like done now ;) Please test

I implemented language model, and some extra TI/CA for enums. This update will force re-index workspace

pounard commented 1 year ago

I'll try tomorrow, thanks a lot !

pounard commented 1 year ago

Very nice, syntax colouring on named arguments, even in attributes instanciation, love it ! Thank you so much for all the work !

pounard commented 1 year ago

If you ever come by to the west of France someday, I'll buy you a beer (or even a keg).

pounard commented 1 year ago

Whenever I write this:

#[\Attribute(flags: \Attribute::TARGET_CLASS|\Attribute::TARGET_METHOD)]
class Foo
{
}

I cannot control-click and navigate to TARGET_CLASS or TARGET_METHOD definition.

Everything else works fine.

sajushko commented 1 year ago

First of all, I want to say thanks for the amazing job on PDT for PHP 8.x. It works like a charm although I found this small issue:

enum MyEnum
{
    case EnumCase;

    public function isEnum() : bool
    {
        return $this === self::EnumCase;
    }
}

Variable $this is undefined in enum functions.

zulus commented 1 year ago

First of all, I want to say thanks for the amazing job on PDT for PHP 8.x. It works like a charm although I found this small issue:

Thank You, looks anti-depression and anti-ADHD pills works :P

enum MyEnum
{
    case EnumCase;

    public function isEnum() : bool
    {
        return $this === self::EnumCase;
    }
}

Variable $this is undefined in enum functions.

Thank You for testing. I'll fix this later today

zulus commented 1 year ago

Closing for now. Other topics should be realized via separate tasks