PHP Intellisense/code-completion for VS Code
Crane is an extension for VS Code that provides an early implementation of PHP Intellisense/code-completion.
- Q. How do I view code suggestions?
- Press ctrl + space to open the suggestions list with scope-aware suggestions depending where the caret is positioned. Alternatively, the suggestion list is triggered automatically after typing a trigger character such as $, ->, : or ..
- Q. Why isn't Crane showing my variables/classes/functions in the suggestion list?
- The parsing engine is unable to build intellisense options if there is a syntax error in your code. Make sure you've got the built-in PHP linter enabled in your user settings file.
- Q. Why is Crane suggesting classes/traits/interfaces are defined in other files that aren't included?
- In the current version, Crane is unable to detect file includes or autoloaders so it suggests all classes, traits and interfaces that it can find in the workspace. This will be fixed in a future version, but for now I figured it's better to have some class suggestions that are out of scope than no suggestions at all.
- Q. Why is the suggestion list full of PHP functions all the time?
- This is built-in functionality of VS Code. We don't have control over this... yet. Hopefully there will be an update to VS Code to allow extensions to remove existing completion items from the list.
Got a problem with Crane? Send me an email at [email protected]
Found a bug in Crane? Great! Please report it in the GitHub issues tracker.