Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>AdonisJS ExtensionNew to Visual Studio Code? Get it now.

AdonisJS Extension

jripouteau

|
8,764 installs
| (12) | Free
| Sponsor
The official VSCode extension of AdonisJS
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

💻 Official AdonisJS extension for VSCode


Features

  • Use all Adonis Assembler commands ( make:* )
  • Migrate and seed your database ( db:*, migration:* )
  • Run your commands from the Activity Bar just by clicking
  • View your routes within VSCode
  • Open and see docs within VSCode
  • .adonisrc.json file validation with JSON Schema
  • Edge Support, syntax highlighting + formatting
  • Multiple Workspaces and Monorepos support
  • Edge and AdonisJS Snippets
  • Go To Controller
  • Go To View

Note: I recommend you to take a look at the Japa extension for an even better experience:

https://github.com/Julien-R44/japa-vscode

Ace commands

Launch ace commands directly from VScode. Files created by adonis/assembler are automatically opened after their creation.

ActivityBar and Tree Views

Run your commands without typing anything, See your routes and go to its code just by clicking on the items in the Activity Bar.

List Routes

List all routes in your project from VSCode and filter them.

Documentations

Consult and search the Adonis and Japa documentation directly from VSCode.

JSON Schema for .adonisrc

Route controller completion + Go To

Autocompletion for the name and the handler of controllers. Ctrl + Click to open the file. Hovering the handler will show its documentation.

Edge support

Syntax highlighting, auto-completion of tags including partials, components, layouts. Ctrl + Click to open an included file. No automatic formatting for the moment.

Snippets

Snippets for Edge and AdonisJS are defined, take a look here to see the list of snippets.

Since I'm not a big snippet user, feel free to propose a PR with snippets you think are useful.

Configuration

  • nodePath: The path to the node executable.
  • useUnixCd: Use Unix-style cd for windows terminals (Useful when using Cygwin or Git Bash)
  • quickJump: Enable quick jump by using Ctrl + Click
  • runMigrationInBackground: Run migration/seeds commands in background. By default, they are executed in the built-in terminal of VSCode so that you can see the output.

Known Issues

Below is the list of unsupported features (for the moment) by the extension, feel free to make a PR if you'd like to contribute to the project:

  • Edge Links Provider for Component as tags
  • Edge Links Provider for @includeIf tag

IntelliSense while typing

In the context of controller and view autocompletion, we are inside strings. By default, VSCode totally disables the display of IntelliSense suggestions inside strings. If you want to see the autocompletion of your controllers and views, you will have to press Ctrl + Space to manually trigger IntelliSense.

If you want the suggestions while typing, you can add this to your VSCode settings:

"editor.quickSuggestions": {
  "other": "off",
  "comments": "off",
  "strings": "on" 👈 // This
}

But be warned, this will automatically display intellisense even in "traditional" strings

Emmet doesn't work in Edge files

Just add this in your VSCode settings:

"emmet.includeLanguages": {
  "edge": "html"
}

Contributing

  • See contributing guide
  • Clone the project and open it in VSCode
  • Run npm install
  • Press F5 to open a new VSCode window with your extensions loaded.
  • You can relaunch the extension from the debug toolbar after changing code in src/extension.ts.
  • You can also reload (Ctrl+R or Cmd+R on Mac) the VS Code window with your extension to load your changes.
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft