Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

💭 Nicer detection of non existent categories created with scripts/ast-create-node #1058

Closed
dibenso opened this issue Aug 13, 2020 · 2 comments

Comments

@dibenso
Copy link
Contributor

dibenso commented Aug 13, 2020

Notice the singular "statement" category directory does not exist in internal/ast/js

Running:

./rome run scripts/ast-create-node js JSDecorator statement

Outputs:

unknown internalError/fs  INTERNAL  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ /home/dibenso/source/repos/rome/internal/ast/js/statement/JSDecorator.ts does not exist

  ⚠ No stacktrace available for this error. This is a Node.js limitation: https://github.com/nodejs/node/issues/30944

  ℹ Try setting the ROME_FS_ERRORS=1 envvar to capture stacktraces for fs calls.

  File stats for internal/ast/js

    Object {
      atime: 2020-08-12T16:11:18.887Z
      atimeMs: 1_597_248_678_887.1875
      birthtime: 2020-08-12T16:10:14.200Z
      birthtimeMs: 1_597_248_614_199.7334
      blksize: 4_096
      blocks: 8
      ctime: 2020-08-12T16:10:14.208Z
      ctimeMs: 1_597_248_614_207.7341
      dev: 2_053
      gid: 1_000
      ino: 1_313_744
      isBlockDevice: false
      isCharacterDevice: false
      isDirectory: true
      isFIFO: false
      isFile: false
      isSocket: false
      isSymbolicLink: false
      mode: 16_893
      mtime: 2020-08-12T16:10:14.208Z
      mtimeMs: 1_597_248_614_207.7341
      nlink: 15
      rdev: 0
      size: 4_096
      uid: 1_000
    }

  ⚠ This diagnostic was derived from an internal Rome error. Potential bug, please report if necessary.

It would make things more clear to contributors if this showed a list of possible current categories instead of this peculiar message shown above

@sebmck
Copy link
Contributor

sebmck commented Aug 16, 2020

Want to submit a PR? Adding AST nodes isn't common so these scripts have been very ad-hoc so far. On the specific topic of decorators, there likely needs to be more discussion that needs to happen. I don't want you to do a bunch of work that doesn't end up getting merged (unless you want to).

@dibenso
Copy link
Contributor Author

dibenso commented Aug 20, 2020

#1124 fixes this

@dibenso dibenso closed this as completed Aug 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants