https://github.com/haehnchen/idea-intellij-espend
https://github.com/haehnchen/idea-intellij-espend
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/haehnchen/idea-intellij-espend
- Owner: Haehnchen
- Created: 2023-05-25T12:34:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-01T18:51:43.000Z (over 2 years ago)
- Last Synced: 2025-01-12T16:32:44.481Z (9 months ago)
- Language: Java
- Size: 1.27 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# idea-intellij-espend
[](https://github.com/Haehnchen/idea-intellij-espend/actions/workflows/build.yml)
| Key | Value |
|------------|---------------------------|
| Plugin Url | TBA |
| ID | TBA |
| Changelog | [CHANGELOG](CHANGELOG.md) |## PHP
### Completion
**Given Scope**
```php
namespace App;
class Foobar
{
/** @var \App\Foobar[] */
public $cars = [];/** @var string[] */
public $myIds = [];/** @return \App\Foobar[] */
public function getFoobar() {}
}
``````php
public function getFoobar()
{
$items = ['test', 'test2'];
$ids = [12, 12];
$prices = [12.12, 12.12];
$test = new Foobar();
function(__CARET__);
function($scopeLeft, __CARET__);
function(__CARET__, $scopeRight);
}
```#### Arrow / Anonymous Function Completion
**Results**
```php
foo(fn(int $id) => $id, $ids);
foo(fn(string $item) => $item, $items);
foo(fn(Foobar $foobar) => $foobar, $test->getFoobar());
foo(fn(Foobar $foobar) => $foobar, $test->cars);foo($test->getFoobar(), fn(Foobar $foobar) => $foobar);
foo(static fn(int $id) => $id, $ids);
foo(static fn(string $item) => $item, $items);
foo(static fn(Foobar $foobar) => $foobar, $test->getFoobar());
foo(static fn(Foobar $foobar) => $foobar, $test->cars);foo(function(int $id) => { return $id;}, $ids)
```#### WIP: for and foreach
```php
for
``````php
foreach ($test->getFoobar() as $foobar) {}
for(...) { }
```### WIP: Parameter Scope Fill
**Given Scope**
```php
function foo(Foobar $foo, int $foo, float $bar);class Foobar
{
/** @return \DateTimeInterface[] */
public function getDate() {}
}function f()
{
$test1 = new Foobar();
$test2 = 1;
$test3 = 1.3;
foo(__CARET__);
foo(, __CARET__);
foo(__CARET__, );
}
```**Results**
```php
foo($foo->getDate(), $test2, $test3);
```