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

Add support for custom controllers and pages folders

Open alex-j-b opened this issue 5 months ago • 1 comments

Monorepo support - Issue https://github.com/Julien-R44/adonis-vscode-extension/issues/43

Proposed changes

  • The extension is currently not compatible with @adonisjs-community/modules or any other project having multiple controllers and pages folders. For example: https://github.com/filipebraida/adonisjs-starter-kit
  • This PR adds support for custom controllers and pages folders via new adonisjs.inertia.pagesDirectories and adonisjs.app.controllersDirectories configs.

Types of changes

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • [x] I have read the CONTRIBUTING doc
  • [ ] Lint and unit tests pass locally with my changes
  • [ ] I have added tests that prove my fix is effective or that my feature works.
  • [x] I have added necessary documentation (if appropriate)

alex-j-b avatar Sep 16 '25 16:09 alex-j-b

I'm not familiar with vs code extensions so I would appreciate some help with fixing/adding tests. I'm facing currently facing this error:

alex:~/Projects/adonis-vscode-extension(custom-controllers-pages-1)$ npm run quick:test

> [email protected] quick:test
> tsx test/run_pure_tests.ts


   Error: Cannot find module 'vscode'
   Require stack:
   - /home/alex/Projects/adonis-vscode-extension/src/vscode/logger.ts
   -
   /home/alex/Projects/adonis-vscode-extension/src/linkers/inertia_linker.ts
   -
   /home/alex/Projects/adonis-vscode-extension/test/suites/pure/linkers/inertia_linker.test.ts
 
   at <anonymous> src/vscode/logger.ts:2
   1|  import dedent from 'dedent'
 ❯ 2|  import { ExtensionMode, window } from 'vscode'
   3|  
   4|  import { getExtensionContext } from './extension'
   5|  
   6|  export class Logger {
   7|    static #channel = window.createOutputChannel('AdonisJS')

   ⁃ Function.g [as _resolveFilename]
     node_modules/tsx/dist/global-require-patch-CDlRjmTW.cjs:1

I installed vscode package but no luck

alex-j-b avatar Sep 16 '25 16:09 alex-j-b