All Projects → iiifx-production → yii2-autocomplete-helper

iiifx-production / yii2-autocomplete-helper

Licence: MIT License
Yii2 IDE Autocomplete Helper

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to yii2-autocomplete-helper

Ide Stubs
Phalcon IDE Stubs
Stars: ✭ 137 (+260.53%)
Mutual labels:  autocompletion, ide, phpstorm
Laravel Whoops Editor
Laravel Whoops Editor helps to open your code editor from exception stack trace.
Stars: ✭ 83 (+118.42%)
Mutual labels:  ide, phpstorm
Phpstorm Ide Config
My PhpStorm configuration for writing modern PHP code
Stars: ✭ 55 (+44.74%)
Mutual labels:  ide, phpstorm
Cmake Ide
Use Emacs as a C/C++ IDE
Stars: ✭ 661 (+1639.47%)
Mutual labels:  autocompletion, ide
Awesome Phpstorm
A curated list of amazingly awesome PHPStorm plugins, resources and other shiny things.
Stars: ✭ 719 (+1792.11%)
Mutual labels:  ide, phpstorm
Monaco Ide Font
〽️ Patched Monaco font for use in popular IDEs and editors
Stars: ✭ 127 (+234.21%)
Mutual labels:  ide, phpstorm
Php Ide Serenata
Atom IDE package that integrates the Serenata server to provide PHP code assistance
Stars: ✭ 277 (+628.95%)
Mutual labels:  autocompletion, ide
Micropy Cli
Micropython Project Management Tool with VSCode support, Linting, Intellisense, Dependency Management, and more!
Stars: ✭ 112 (+194.74%)
Mutual labels:  autocompletion, ide
Yii2support
Yii2 Support for PhpStorm / IntelliJ IDEA
Stars: ✭ 280 (+636.84%)
Mutual labels:  yii2, phpstorm
Yii2 Stubs Generator
No more pain with autocomplete in PhpStorm.
Stars: ✭ 143 (+276.32%)
Mutual labels:  yii2, phpstorm
TheVimIDE
Modern Vim IDE with support for C/C++, Java, Python, Lua, PHP, JavaScript, Ruby and much more ...
Stars: ✭ 33 (-13.16%)
Mutual labels:  autocompletion, ide
UnrealScriptIDE
Auto-completion, Syntax Highlighting, Go to Declaration, Build and Run and more..
Stars: ✭ 86 (+126.32%)
Mutual labels:  autocompletion, ide
JetBrainsRunner
A Krunner Plugin which allows you to open your recent projects
Stars: ✭ 31 (-18.42%)
Mutual labels:  ide, phpstorm
DictionaryAutoComplete
This adds dictionary entries to the completions inside comments. For lazy typers!
Stars: ✭ 89 (+134.21%)
Mutual labels:  autocompletion
collection
Basic collection library for Yii Framework 2.0
Stars: ✭ 29 (-23.68%)
Mutual labels:  yii2
pymolsnips
Pymolsnips is a library of PyMOL scripting language code fragments for several popular text editors.
Stars: ✭ 19 (-50%)
Mutual labels:  autocompletion
yii2-material-theme
Material Theme for Yii2
Stars: ✭ 15 (-60.53%)
Mutual labels:  yii2
asn1scc.IDE
Qt Creator plugin for asn1scc - ASN.1/ACN compiler for embedded systems
Stars: ✭ 15 (-60.53%)
Mutual labels:  ide
yii2-dropzone
This extension provides the Dropzone integration for the Yii2 framework.
Stars: ✭ 11 (-71.05%)
Mutual labels:  yii2
yii2-multi-select-widget
Bootstrap MultiSelect and MultiSelect Listbox widgets for Yii2
Stars: ✭ 45 (+18.42%)
Mutual labels:  yii2

Yii2 IDE Autocomplete Helper

Autocompletion generator for custom components in Yii2.

SensioLabsInsight

Latest Version on Packagist Total Downloads Code Coverage Software License

[English documentation] [Документация на русском]

By default in Yii2 not working autocompletion for custom components. IDE sees no added components and this causes inconvenience in operation.

This extension allows you to automatically generate a file with the autocomplete PHPDoc blocks with which the IDE will recognize all of the components in the application configuration.

Installation

Using Composer:

composer require "iiifx-production/yii2-autocomplete-helper"

Configuration

After installation, you need to one-time set up component to work.

For Yii2 Basic, in @app/config/console.php:

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
        ],
        # ...
    ]

For Yii2 Advanced, in @console/config/main.php:

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
        ],
        # ...
    ]

Using

To generate autocompletion in the console:

php yii ide-components

Generator automatically detects the type of application, read all configuration files and generate the autocomplete file to the application root.

Yii2 IDE auto-completion helper
Vitaliy IIIFX Khomenko, 2019

Success: /home/iiifx/Projects/myProject/_ide_components.php

Important: For IDE did not swear on the two copies of the Yii class must be main Yii class file marked as a text document - example. The main class is located on the way: @vendor/yiisoft/yii2/Yii.php

Advanced customization

Sometimes the structure of the application differs from the standard and the need to change the generator behavior.

The following are examples of possible configuration options.

Changing the name of the component

If you need to change the name of a autocomplete to another, it is quite simple:

    'bootstrap' => ['log', 'new-component-name'], # <-- new component name
    'components' => [
        'new-component-name' => [ # <-- new component name
            'class' => 'iiifx\Yii2\Autocomplete\Component',
        ],
        # ...
    ]

When the generator run in the console you need to pass the correct component name:

php yii ide-components --component=new-component-name

Changing environment

By default, a generator start is only possible for YII_ENV = "dev" environment.

You can change the environment:

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
            'environment' => 'local', # <-- environment
        ],
        # ...
    ]

Changing the generator controller

By default, the generator uses a console controller to create autocompletion.

You can replace the default controller, extend it, or add your own implementation:

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
            'controllerMap' => [
                'ide-components' => 'iiifx\Yii2\Autocomplete\Controller', # <-- default controller
                'my-custom-generator' => 'path\to\your\custom\Controller', # <-- your controller
            ],
        ],
        # ...
    ]

Now you can run your controller:

php yii my-custom-generator

Link to the controller by default: source/Controller.php.

Changing the autocompletion file

By default, autocompletion file will be named _ide_components.php and will be placed in the application root.

You can change the name and location of the file:

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
            'result' => '@app/new-file-name.php' # <-- name and path
        ],
        # ...
    ]

The file path must be relative to aliases framework. Example: @common/../new-file-name.php.

Special configuration files

Sometimes you need to manually specify the application configuration files from which you want to generate autocompletion.

In this case, the generator will not seek configuration, the generator immediately uses this list.

For Yii2 Advanced:

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
            'config' => [
                '@common/config/main.php', # <-- config list
                '@common/config/main-local.php',
                '@console/config/main.php',
                '@console/config/main-local.php',
                '@backend/config/main.php',
                '@backend/config/main-local.php',
                '@frontend/config/main.php',
                '@frontend/config/main-local.php',
            ],
        ],
        # ...
    ]

For Yii2 Basic:

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
            'config' => [
                '@app/config/console.php', # <-- config list
                '@app/config/web.php',
            ],
        ],
        # ...
    ]

Configuration groups

In big projects sometimes need to be able to generate different autocomplete files depending on the stage of development.

You can group configuration files and generate autocompletion only for a specific group.

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
            'config' => [
                'frontend' => [
                    '@common/config/main.php', # <-- frontend group
                    '@common/config/main-local.php',
                    '@frontend/config/main.php',
                    '@frontend/config/main-local.php',
                ],
                'backend' => [
                    '@common/config/main.php', # <-- backend group
                    '@common/config/main-local.php',
                    '@backend/config/main.php',
                    '@backend/config/main-local.php',
                ],
                'api' => [
                    '@common/config/main.php', # <-- api group
                    '@common/config/main-local.php',
                    '@common/../api/config/main.php',
                    '@common/../api/config/main-local.php',
                ],
            ],
        ],
        # ...
    ]

Now you can generate autocompletion for the desired group:

php yii ide-components --config=api

Configuring Application Classes

Some projects can sometimes use overridden application classes for web and console.

You can do this through the appropriate setting in the config.

    'bootstrap' => ['log', 'autocomplete'],
    'components' => [
        'autocomplete' => [
            'class' => 'iiifx\Yii2\Autocomplete\Component',
            'webAppClass' => '\full\namespace\to\WebApplicationClass',
            'consoleAppClass' => '\full\namespace\to\ConsoleApplicationClass',
        ],
        # ...
    ]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].