Skip to content
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

Register custom metadata to completion provider #10844

Closed
Jarrio opened this issue Nov 8, 2022 · 7 comments · Fixed by SchemaStore/schemastore#2619
Closed

Register custom metadata to completion provider #10844

Jarrio opened this issue Nov 8, 2022 · 7 comments · Fixed by SchemaStore/schemastore#2619

Comments

@Jarrio
Copy link

Jarrio commented Nov 8, 2022

I'm not sure how much of an issue this would be to implement, but I think it would be a nice quality of life improvement to be able to register custom defined metadata to the provider.

image

@ or @: would be allowed, an API for this could be haxe.macro.Completion.registerMeta('property', 'description') something "simple"

@Simn
Copy link
Member

Simn commented Nov 18, 2022

IMO this should be handled in some declarative way. We already have src-json/meta.json, so a user-defined extension of that in the same format which is picked up by the compiler seems sensible.

@kLabz
Copy link
Contributor

kLabz commented Nov 18, 2022

So each lib would provide their own meta.json which compiler would "merge" with its own meta.json?

@Simn
Copy link
Member

Simn commented Nov 18, 2022

Yes, and we can do the same with defines (although I forget where these show outside of --help-defines). I think the only question is how to tell the compiler where to look for these things. I thought we could just check the class paths, but I don't really want to mix JSON files with HX files...

@kLabz
Copy link
Contributor

kLabz commented Nov 18, 2022

Maybe something similar to extraParams resolution (though it would only work for libs and not user code...), but that would probably require to translate it to some init macro call registering the file (which could be used directly for user code?)

@Jarrio
Copy link
Author

Jarrio commented Nov 18, 2022

a user definable meta.json would be a nice solution! something like a .hxml param -metafile path/to/metas.json

@Aurel300
Copy link
Member

Small comment on this: keep in mind that the JSON files for metadata and defines are used during the compile time of the Haxe compiler. We can of course try to bring a similar mechanism to the Haxe compiler runtime.

@Simn
Copy link
Member

Simn commented Nov 18, 2022

Yes this would require moving some things around, but that should be doable even in OCaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants