Tinkerwell 5: Welcome to the AI age
See what's new
Tinkerwell background image
Tinkerwell Logo Tinkerwell

Documentation

Autocompletion
#

Tinkerwell provides best-in-class autocompletion for your PHP projects. Therefore, Tinkerwell indexes your codebase to quickly find the code that you need – the fuzzy search provides you with a world-class search logic, no matter if you are searching for classes, methods, constants or simply chain method calls.

Auto code completion works for local projects as well as for projects that you access via SSH. This works by indexing a local version of your remote project to provide the autocompletion features.

The autocompletion feature uses a language server to index your codebase and provide autocompletion features. This language server does not work on WSL paths at the moment, and so it does not work with WSL-based projects on Windows. We hope to solve this in the future.

Setup
#

The code completion feature of Tinkerwell runs a PHP based language server locally – this means that you need a working PHP version on your local machine, even if you access your application via SSH, Docker or Laravel Vapor. The language server needs PHP versions 8.1+ and you can configure the local PHP version in the general settings. The PHP binary does not need to match the PHP version of your project.

Tinkerwell settings

If you use Docker and don't have local PHP installed, try out the simple install for command-line PHP at php.new.

Remote Setup
#

Code completion on remote projects works by indexing a local version of your remote application. This has the benefit that the indexing does not need to scan your remote project at all. To enable autocompletion for existing projects or add it to new ones, set the path to the local project on your machine in the connection settings.

Tinkerwell SSH settings

Code completion for magic methods (Laravel)
#

Laravel uses magic methods heavily – for example if you access a model to run Eloquent queries, Eloquent calls are usually done via these magic methods. The language server is not smart enough to detect these methods (yet), but you can make this work as you do in PHPStorm or VS Code. Install the Laravel IDE Helper Generator as a dev dependency and enjoy code completion for even complex scenarios.

You can install the package via:

composer require --dev barryvdh/laravel-ide-helper

After that, you can reindex your project by clicking on the language server status message on the bottom right.

AI-Powered Code Completion
#

Tinkerwell includes AI-powered code completion alongside traditional language server autocompletion. This provides intelligent, context-aware suggestions to help you write code faster.

Getting Started
#

Configure AI completion in Settings → AI → Code Completion. You'll need an API key from your chosen provider.

Supported Providers
#

Provider Models Available
OpenAI GPT-3.5, GPT-4, etc.
Anthropic Claude models
Mistral Mistral AI models

Trigger Modes
#

Choose how you want AI suggestions to appear:

  • On Typing - Suggestions appear automatically as you type
  • On Idle - Suggestions after you pause typing
  • On Demand - Trigger manually with keyboard shortcut

Smart Features
#

AI completion includes caching support to reduce API calls and costs. The toolbar shows your completion provider status and current activity.

[Screenshot placeholder: AI completion settings panel showing provider dropdown and trigger options]

Troubleshooting the Tinkerwell language server
#

Sometimes things don't work as expected and this is why you are looking at this troubleshooting guide. You can fix most problems by checking these steps:

  1. Restart Tinkerwell
  2. Check your local PHP version (the server needs 8.1+)
  3. Sometimes the language server crashes and corrupts data within its own directory. If 1+2 did not fix the problem, try closing the app, deleting the following directories and try again.

Language Server paths
#

macOS: ~/.cache/phpactor
Linux: ~/.cache/phpactor
Windows: C:\Users\USERNAME\.cache\phpactor