Code Monkey home page Code Monkey logo

Comments (10)

ymc9 avatar ymc9 commented on June 12, 2024 1

Happy to make a PR if ya don't mind pointing me on where to get started!

Awesome! You can make a fork and create a PR based off the "dev" branch.

I believe the only change needed is this line here: https://github.com/zenstackhq/zenstack/blob/fea8ec71eac83e880112d64057355e8d2979bd18/packages/language/src/zmodel.langium#L212C10-L212C19

name=RegularID to name=RegularIDWithTypeName.

If you run pnpm build, a few other files (like ast.ts) will be auto-updated and should be included in the change.

If you want to test it out locally, you can pnpm build in the language package, and copy over the content of "dist" folder into your node_modules.

Let me know if you run into any hurdle.

from zenstack.

ymc9 avatar ymc9 commented on June 12, 2024

Fixed in 2.1.0

from zenstack.

francistogram avatar francistogram commented on June 12, 2024

Hey @ymc9 seems like I'm still running into the same issue on v2.1.1

image image

Looking at the test in the commit seems like it only tests for the name used as a field on a model vs an enum value that either

  1. I'm doing something wrong (very possible)
  2. The change fixed it for fields but not enum names

https://github.com/zenstackhq/zenstack/pull/1424/files#diff-7883ee0ee292eabaa7686a78d64d6af8bab02fcc845bb7352c3c4aee213c9512R19

from zenstack.

ymc9 avatar ymc9 commented on June 12, 2024

Oh, my apologies. You're right, the support was only added for model fields not enum fields ... Will make one more fix later today. Please also let me know if you're interested in making a PR 😄 @francistogram

from zenstack.

francistogram avatar francistogram commented on June 12, 2024

Happy to make a PR if ya don't mind pointing me on where to get started!

from zenstack.

francistogram avatar francistogram commented on June 12, 2024

I've made the change and was able to build it'

image

I am a little stuck with testing it locally

If you want to test it out locally, you can pnpm build in the language package, and copy over the content of "dist" folder into your node_modules.

Was initially thinking maybe I'd copy over the changed files e.g. ast.ts but that file doesn't seem to exist in the node_modules, closest thing I found was ast-utils.js

Any pointers here on what I might be missing?

image

from zenstack.

ymc9 avatar ymc9 commented on June 12, 2024

Good to know the progress @francistogram ! The npm package corresponding to the "language" pnpm package is actually "@zenstackhq/language". You should be able to find "ast.js" at "node_modules/@zenstackhq/language".

from zenstack.

francistogram avatar francistogram commented on June 12, 2024

Ah the @ explains why I hadn't seen it in the folder 🤦‍♂️

Almost there I think, unclear to me if this is an issue related with my change or with my schema.zmodel as this is my first time setting up zenstack (this issue was preventing me from migrating easily)

image

These are some of the lines it's complaining about it you see any issues here?

image

I went ahead and put up a PR in case this helps in debugging if I did anything wrong

#1457

Thanks for the help here too!

from zenstack.

ymc9 avatar ymc9 commented on June 12, 2024

Ah the @ explains why I hadn't seen it in the folder 🤦‍♂️

Almost there I think, unclear to me if this is an issue related with my change or with my schema.zmodel as this is my first time setting up zenstack (this issue was preventing me from migrating easily)

image These are some of the lines it's complaining about it you see any issues here? image I went ahead and put up a PR in case this helps in debugging if I did anything wrong

#1457

Thanks for the help here too!

Hey @francistogram , the change looks cool to me. I've merged it. And then I found I overlooked that reference expressions also need to respect reserved type names, otherwise enum fields cannot be properly resolved. I've pushed an extra fix.

Will publish a patch release today. Thank you for the work!

from zenstack.

ymc9 avatar ymc9 commented on June 12, 2024

The change is live in v2.1.2 now!

from zenstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.