

To peek at a symbol's definition, place your cursor on the symbol anywhere it's used in your source code and then press ⌥F12 (Windows Alt+F12, Linux Ctrl+Shift+F10). This feature displays a few lines of code near the definition inside a peek window, so you can take a look without navigating away from your current location. You can take a quick look at how a symbol was defined by using the Peek Definition feature. Choose from the list of matches to navigate to its location. A list of potential matches will appear and be filtered as you type. To search for a symbol in the current file, use Quick Open ( ⌘P (Windows, Linux Ctrl+P)) then enter the command, then enter the name of the symbol you're looking for. ⌘T (Windows, Linux Ctrl+T) is just the shortcut for the '#' commands, so everything works the same. Alternatively, you can also use Quick Open ( ⌘P (Windows, Linux Ctrl+P)) then enter the '#' command to search the current workspace. If you choose a match that was found in a file that's not already open, the file will be opened before navigating to the match's location. A list of potential matches will appear as before. To search for a symbol in the current workspace, start by pressing ⌘T (Windows, Linux Ctrl+T), then enter the name of the symbol. You can search for symbols in the current file or workspace to navigate your code more quickly. As a Java editor, it also supports Call Hierarchy, Type Hierarchy, Definition Navigation, Search Types in Workspace, etc. Project view also provide a great overview of your project. With the Outline view, you can conveniently navigate the members within the current file. If you run into any issues when using the features below, you can contact us by entering an issue. In this document, we will go through a few Java-specific features, which are helpful when working with Java. Visual Studio Code is a source code editor first and foremost with rich editing features. Configure IntelliSense for cross-compiling.This fixes a common issue when an instance function is called without specyfying the $this object. If applicable, a code action suggesting to add $this-> is provided. Fix typo in PHPDoc keywordĮrror PHP6503 suggests that there is a typo in the PHPDoc keyword and offers a quick fix. Code actions include all the possible names that are found within the current workspace. The code action allows you to add use declaration or fully qualify the name in-place. If possible, a code actions with all available fixes is provided. Generated code contains PHPDoc annotations and base implementation of methods if applicable.Įrror PHP0413 indicates that the type does not exist in the current namespace context. The code action resolves the complete class hierarchy, taking into accound interfaces and classes. The generated code is inserted at the end of the class. The quick fix or code action automatically implements the missing abstract functions, including all the available documentation and type information. In case more properties are selected, the code action allows to generate getters/setters for all of them at once.Įrror PHP2414 indicates that the non-abstract class has some functions missing. The code action supports adding getter only, setter only, or both. For PHP 7.4 and higher, the property's type hint is taken into accound as well. In case the current version of PHP is 7 or higher, also the return type is added. The inserted code contains all the available type annotations. This will add function get and set for the selected property at the end of current class. Generating getters and/or setters for private and protected properties can be done using the following code action. This provides the same list of code actions that should resolve the issue.

The available code action is annotated with a light bulb next to the text.Īvailable code actions are listed by clicking on the light bulb or pressing associated keyboard shortcut (by default) Ctrl+.Ĭertain errors have also Quick Fix available. The editor is provided with so-called Code Actions - Quick Fixes and refactorings for the text currently under the caret.
