Skip to content

Releases: smuuf/vscode-latte-lang

0.0.7

10 Dec 22:23

Choose a tag to compare

  • (issue #1) 🆕 New: Rudimentary cache for info about classes parsed from PHP files.
  • 🆕 New: Support for {include file.latte}, {layout file.latte}, {extends file.latte} and {capture $var} tag.
  • 🆕 New: Support for type inferring in {var} tag if the expression is a simple expression of scalar types int, float, string, bool. (Support for null is missing now, because it messes up specified nullable types - we can't process these properly yet.)
  • 🔨 We first extract PHP classes from files outside of any /vendor/ directory and then only those. This is to have info about non-third-party classes faster and first.

Full Changelog: 0.0.6...0.0.7

0.0.6

20 Nov 01:00

Choose a tag to compare

  • Fixed hovers and goto definitions for inherited methods.

0.0.5

15 Nov 22:47

Choose a tag to compare

  • We're now able to read and use @return tags in docblocks of PHP methods. For example:
    <?php
    class X {
      /**
       * @return array<\DateTime>
       */
      public function giveMeArrayOfDateTimes(): array {
        return ...;
      }
    }
    ... will now be processed as method giveMeArrayOfDateTimes() returning array<\DateTime> instead of just array.
  • Fixed processing of "partial imports". For example:
    <?php
    use A\B\C;
    class X extends C\D\E {}
    ... was being resolved incorrectly as class X extending class C\D\E instead of A\B\C\D\E. This is now fixed.
  • (issue #4) Fixed case of overly aggressive type inferring, which would override explicitly specified type even if we weren't able to properly process the type of the expression assigned to the variable.
    • E.g. {var SomeExplicitlySpecifiedType $someVariable = someFunction()}, if we didn't know what type someFunction() returns (which we don't, because at the moment we're able to infer type only from method calls of objects of known type), would result in $someVariable being of type mixed. This is now fixed and if we're unsure of the inferred type, we use the explicitly specified type SomeExplicitlySpecifiedType instead.
  • Improved solution to the rescan-loop previously fixed in 0.0.4.
    • This also fixed race-conditions that could occur during evaluation of php-expression-based type inferring.

0.0.4

15 Nov 00:44

Choose a tag to compare

Fixed infinite rescan loop.

0.0.3

14 Nov 22:31

Choose a tag to compare

  • New: Ability to infer types in variable assignments.
    • For example, if we have a Latte source:
    {var SomeClass $object}
    
    ...while class SomeClass has a method callMe(): OtherClass, then for:
    {var $result = $object->callMe()}
    
    ... we will infer that the $result variable is of type OtherClass (that is - there's no need to specify type in the {var ...} tag, because we will infer it from the expression after it.) This works for ˙{var}˙ and {default} Latte tags.

0.0.2

10 Nov 10:43

Choose a tag to compare

Version 0.0.2