adonis-vscode-extension icon indicating copy to clipboard operation
adonis-vscode-extension copied to clipboard

Custom commands not registered in the Commands panel

Open jarrodek opened this issue 1 year ago • 0 comments

Package version

@adonisjs/core: 6.12.1 AdonisJS Extension: 1.3.1

Node.js and npm version

npm: 10.8.3 node: v20.15.1

The output of running node ace list --json is the following

[
  ...,
  {
    "commandName": "mongo:fresh",
    "description": "Clears documents from all collections.",
    "help": "",
    "namespace": "mongo",
    "aliases": [],
    "flags": [],
    "args": [],
    "options": {
      "startApp": true
    },
    "filePath": "mongo_fresh.js"
  }
]

According to this line https://github.com/Julien-R44/adonis-vscode-extension/blob/ffd1c7e992088cb4fb638670ea8fdfed16e177f1/src/adonis_project/adonis6_project.ts#L38 the custom commands are only registered when the absoluteFilePath is set on the command. However, my custom command does not have that.

This line causes the problem: https://github.com/adonisjs/ace/blob/4d5a2ea74e887ff70dd05ef153c0303b2ddeeee3/src/loaders/fs_loader.ts#L99 The file, which is the absolute path, is used to import the command, but after this function is called, the absolute path does not exist anymore. At least, that's my understanding of it.

jarrodek avatar Feb 15 '25 02:02 jarrodek