AppCode 2022.2 Help

Auto Import

Objective-C

Show import popup

Automatically display import popup dialog when typing a name of the class that lacks import statement.

Auto import in completion

Add import statements on code completion.

Predeclare in .h/Import in .m

Add class declarations to header files and #import statements to .m files.

Import in .h

Add #import statements to header files.

XML

Show auto-import tooltip

Automatically show an auto-import tooltip when typing the name of an unbound namespace. See importing unbound namespaces for details.

TypeScript/JavaScript

Add ES6 imports on code completion

  • If this checkbox is selected, AppCode automatically inserts an import statement in JavaScript code when you complete a symbol exported using ES6 exports in another project file:

    Add ES6 imports on code completion
  • When the checkbox is cleared, on pressing ⌥ ⏎ AppCode shows a popup that suggests to import the symbol:

    Add ES6 imports on code completion disabled
  • Completion and auto-import also work for React components, including stateless components. AppCode properly detects them, provides code completion, and adds import statements automatically:

    Completion for imports in React stateless components

Add TypeScript imports automatically

Select this checkbox if you want AppCode to generate import statements in TypeScript code. Use the checkboxes below to choose when import generation will be invoked.

  • On code completion If this checkbox is selected, AppCode automatically inserts an import statement in TypeScript code when you complete a symbol exported in another project file.

  • With auto-import tooltip If this checkbox is selected, AppCode shows a tooltip with an import suggestion when you position the caret at an unresolved symbol that can be imported. When the checkbox is cleared, you can invoke import generation only be pressing ⌥ ⏎.

  • Unambiguous imports on the fly With this checkbox selected, AppCode adds import statements when you type your code or paste a fragment with a symbol that is not yet imported if there is only one source to import the symbol from.

When you are using ES6 modules in a browser that requires full file names, for example, in Chrome, it is important that the names of ES6 modules in import statements have the .js extensions.

  • To add the extension automatically in the JavaScript context, select the Use file extension checkbox on the Imports tab of the Code Style: JavaScript page.

  • To add the extension automatically in the TypeScript context, select the Use file extension checkbox on the Imports tab of the Code Style: TypeScript page.

Last modified: 21 July 2022