eclipse-archived / ceylon.formatter

A formatter for the Ceylon programming language, written in Ceylon.
Apache License 2.0
14 stars 11 forks source link

Write fake source code for compiler model #127

Open lucaswerkmeister opened 8 years ago

lucaswerkmeister commented 8 years ago

It would be useful to have a tool that, given some compiler model (from a .car file or a -model.js file or whatever), wrote some equivalent Ceylon code for the declarations in that model (eliding the actual code, of course – empty blocks).

For one, the IDE currently can’t load -model.js files, so unless that’s resolved first, to work with TypeScript modules using the IDE the TypeScript loader will have to create some form of .src file from which the IDE can load declarations. This tool would use the JS backend to read the -model.js file and write out files that can then be zipped up into an appropriate .src file.

This will probably be a separate project (using ceylon.ast, hopefully), but I’m filing the issue here for now.

jvasileff commented 8 years ago

Can typescript APIs be fully described in terms of Ceylon source?

I thought about this for Dart, but the typechecker supports things like static members and maybe-optional types that are necessary but aren't part of the language.

lucaswerkmeister commented 8 years ago

Hm, that’s a good point. For full support, we’d have to make up fake syntax for these features, then teach the IDE to load them…

Still, some support could be better than no support, I think.