-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CM KCL: add annotations #5314
base: main
Are you sure you want to change the base?
CM KCL: add annotations #5314
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Is it possible to do something similar to |
It's kind of possible, but there are issues:
I think the right way to do this is to use @external token to parse the |
Thank you for the explanation. I suspect that it's an oversight that whitespace isn't allowed between Related: the name after |
635d5fd goes with the second bullet and 4054e6e aligns with #5324. This will need some adjustment when adding support for unlabeled args in fn definitions, which also uses @. About the space before the |
There are plans to allow annotations anywhere. Yes, it currently conflicts with the unlabeled arg in function definitions. I don't think we decided how to resolve that yet. People seemed to be leaning towards changing how unlabeled args are defined. |
What
In
codemirror-lang-kcl
, add support for annotations to the Lezer parser.I've done this the simple way by treating the annotation as a statement and allowing space, eg between the
@
andsetting
and(
. If it really needs to parse the spacing correctly in future it might need to use Lezer's external tokenizer feature.Note that the
!annotation
forces the parser to choose theAnnotationList
, because at that point the(
could also be the start of a statement.Why
Prepares for adding highlights to annotations.
References
Related: /issues/5204.