When write some code with PHP errors PHP Tools tries to import stuff in a very wrong way

<?php

namespace App\Mail;

class TestClass
{
    public function __construct()
    {
        // Try to import here some classes then 2 classes of the same vendor
        // Error happens when the importing need a sorting
    }

    public function handle()
    {
        return $->;
    }
}

Bug (replication)

  • Miss type anything that will leave PHP to die
  • Try to type something else at the top of the document and use autocompletion (importing objects from other files)
  • Error replicated, imported object is messed up

Expected

Import class without messing with other parts of our scripts

Using version: 1.18.10716

    22 days later

    You are right. This happens if there are syntax errors and you keep editing different parts of the code.

    3 months later

    We have fixed one part of the problem - the use should be placed on a correct place now.

    Next we'll also ensure to not add duplicit items!

      Write a Reply...